From: Date: August 11 2008 4:19pm Subject: bzr push into mysql-5.1 tree (frazer:2706 to 2706) Bug#38717 List-Archive: http://lists.mysql.com/commits/51318 X-Bug: 38717 Message-Id: <200808111419.m7BEJTFw010855@forth.ndb.mysql.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0902075503==" --===============0902075503== MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------ revno: 2706 revision-id: frazer@stripped parent: jonas@stripped parent: frazer@stripped committer: Frazer Clement branch nick: mysql-5.1-telco-6.4 timestamp: Mon 2008-08-11 13:51:32 +0100 message: Merge 6.3->6.4 modified: storage/ndb/include/ndbapi/NdbScanOperation.hpp sp1f-ndbscanoperation.hpp-20040414082357-fjxe5xe43jqfor2px56dwicnrkjwc2kz storage/ndb/src/ndbapi/NdbScanOperation.cpp sp1f-ndbscanoperation.cpp-20040414082425-yr5memqa2kvjbeg5kez5mhmsjkkzcxmz ------------------------------------------------------------ revno: 2585.10.7 revision-id: frazer@stripped parent: jonas@stripped parent: frazer@stripped committer: Frazer Clement branch nick: mysql-5.1-telco-6.3 timestamp: Mon 2008-08-11 13:46:21 +0100 message: Merge 6.2->6.3 modified: storage/ndb/include/ndbapi/NdbScanOperation.hpp sp1f-ndbscanoperation.hpp-20040414082357-fjxe5xe43jqfor2px56dwicnrkjwc2kz storage/ndb/src/ndbapi/NdbScanOperation.cpp sp1f-ndbscanoperation.cpp-20040414082425-yr5memqa2kvjbeg5kez5mhmsjkkzcxmz ------------------------------------------------------------ revno: 2572.21.12 revision-id: frazer@stripped parent: jonas@stripped committer: Frazer Clement branch nick: mysql-5.1-telco-6.2 timestamp: Mon 2008-08-11 13:44:24 +0100 message: Bug#38717 readTuples() can be called > once Add state to NdbScanOperation to determine whether readTuples() has already been called. modified: storage/ndb/include/ndbapi/NdbScanOperation.hpp sp1f-ndbscanoperation.hpp-20040414082357-fjxe5xe43jqfor2px56dwicnrkjwc2kz storage/ndb/src/ndbapi/NdbScanOperation.cpp sp1f-ndbscanoperation.cpp-20040414082425-yr5memqa2kvjbeg5kez5mhmsjkkzcxmz --===============0902075503== MIME-Version: 1.0 Content-Type: text/text/x-diff; charset="us-ascii"; name="patch-2706.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline === modified file 'storage/ndb/include/ndbapi/NdbScanOperation.hpp' --- a/storage/ndb/include/ndbapi/NdbScanOperation.hpp 2008-06-17 20:28:45 +0000 +++ b/storage/ndb/include/ndbapi/NdbScanOperation.hpp 2008-08-11 12:51:32 +0000 @@ -544,6 +544,9 @@ /* This flag indicates whether a scan operation is using the old API */ bool m_scanUsingOldApi; + /* Whether readTuples has been called - only valid for old Api scans */ + bool m_readTuplesCalled; + /* Scan definition information saved by RecAttr scan API */ LockMode m_savedLockModeOldApi; Uint32 m_savedScanFlagsOldApi; === modified file 'storage/ndb/src/ndbapi/NdbScanOperation.cpp' --- a/storage/ndb/src/ndbapi/NdbScanOperation.cpp 2008-08-06 15:46:41 +0000 +++ b/storage/ndb/src/ndbapi/NdbScanOperation.cpp 2008-08-11 12:51:32 +0000 @@ -54,6 +54,7 @@ m_executed = false; m_scan_buffer= NULL; m_scanUsingOldApi= true; + m_readTuplesCalled= false; m_interpretedCodeOldApi= NULL; } @@ -120,6 +121,7 @@ m_read_range_no = 0; m_executed = false; m_scanUsingOldApi= true; + m_readTuplesCalled= false; m_interpretedCodeOldApi= NULL; m_api_receivers_count = 0; @@ -937,15 +939,16 @@ Uint32 parallel, Uint32 batch) { - // It is only possible to call readTuples if the scan transaction - // doesn't already contain a scan operation - if (theNdbCon->theScanningOp != NULL) + // It is only possible to call readTuples if readTuples hasn't + // already been called + if (m_readTuplesCalled) { setErrorCode(4605); return -1; } /* Save parameters for later */ + m_readTuplesCalled= true; m_savedLockModeOldApi= lm; m_savedScanFlagsOldApi= scan_flags; m_savedParallelOldApi= parallel; --===============0902075503==--