Modified:
trunk/SDK/MYSQLPlus/Library/MResult.h
trunk/SDK/MYSQLPlus/Library/MResultRes.cpp
Log:
- changes/additions for block-cursor support
Modified: trunk/SDK/MYSQLPlus/Library/MResult.h
===================================================================
--- trunk/SDK/MYSQLPlus/Library/MResult.h 2006-09-14 19:33:25 UTC (rev 544)
+++ trunk/SDK/MYSQLPlus/Library/MResult.h 2006-09-15 18:25:55 UTC (rev 545)
@@ -188,20 +188,21 @@
(1st choice)
-------------------
- We do not buffer ResultSet. This is our preferred use case because
it is most efficient.
+ We do not buffer ResultSet. This is our preferred use-case because
it is most efficient.
Pros;
- does not have to pull all data to client during doExecute()
- uses less storage on client
Cons;
- - cursor can only move forward (sequentially)
- - we do not know ResultSetRows
+ - cursor can only move forward (sequentially - as in doNext)
+ - we do not know ResultSetRows (so ResultSetRows is always
approx. and <= real ResultSetRows)
Used if;
- CURSOR_TYPE_FORWARD_ONLY
- We can still update a fully unbuffered ResultSet because we always
buffer a RowSet.
+ We can still update a fully unbuffered ResultSet because we always
buffer a RowSet. This does, however,
+ limit our options for cursor sensitivity.
BUFFERED_MYSQL_CLIENT
(2nd choice)
@@ -216,7 +217,7 @@
Cons;
- pulls all data to client during doExecute()
- can cause considerable storage to be used on client
- - the ResultSet is read-only
+ - the ResultSet is read-only (as we do not want to sync our
changes server<->client)
Used if;
- CONCURRENCY_READ_ONLY
@@ -226,22 +227,22 @@
-------------------
We buffer ResultSet in MResult. Buffer is built up, as used, from a
forward-only cursor in mysql client or is
- otherwise created in MResult.
+ otherwise created in MResult (\sa MResultPlus).
Pros;
- the cursor can be moved randomly about the ResultSet
- - we know ResultSetRows
- - ResultSetRows is deferred which deferrs pulling all data to
client
+ - ResultSetRows is deferred which defers pulling all data to
client - possibly add option to get ResultSetRows
+ at doExecute enable this by switching 'use' result with 'store'
result - but this means even more double buffering
Cons;
- can cause considerable storage to be used on client
- more shuffling of data may be involved
Used if;
- - not CURSOR_TYPE_FORWARD_ONLY and not CONCURRENCY_READ_ONLY
+ - not CURSOR_TYPE_FORWARD_ONLY and not CONCURRENCY_READ_ONLY
- MYSQLPlus will buffer keys when CURSOR_TYPE_KEYSET_DRIVEN or
CURSOR_TYPE_DYNAMIC. We do not really
- support CURSOR_TYPE_DYNAMIC - we just do same thing as
CURSOR_TYPE_KEYSET_DRIVEN.
+ MYSQLPlus implements CURSOR_TYPE_KEYSET_DRIVEN with the use of
additional buffers which operate in parallel with data
+ buffers. We do not really support CURSOR_TYPE_DYNAMIC - we just do
same thing as CURSOR_TYPE_KEYSET_DRIVEN.
*/
enum BUFFERED
{
Modified: trunk/SDK/MYSQLPlus/Library/MResultRes.cpp
===================================================================
--- trunk/SDK/MYSQLPlus/Library/MResultRes.cpp 2006-09-14 19:33:25 UTC (rev 544)
+++ trunk/SDK/MYSQLPlus/Library/MResultRes.cpp 2006-09-15 18:25:55 UTC (rev 545)
@@ -432,11 +432,9 @@
case BUFFERED_MYSQL_PLUS:
// have we buffered everything yet?
- if ( !isResultSetRowsKnown() )
+ while ( !isResultSetRowsKnown() && nRow + getRowSetSize() >
getResultSetRows() )
{
- // do we need to load more data into our buffered ResultSet?
- if ( getResultSetRows() < getRowSetSize() )
- nReturn1 = getRowSetData();
+ nReturn1 = getRowSetData();
}
break;
| Thread |
|---|
| • Connector/ODBC 5 commit: r545 - trunk/SDK/MYSQLPlus/Library | pharvey | 15 Sep |