Loading mysql-test/r/ndb_subquery.result +19 −0 Original line number Diff line number Diff line Loading @@ -40,3 +40,22 @@ p u o 5 5 5 drop table t1; drop table t2; create table t1 (p int not null primary key, u int not null) engine=ndb; insert into t1 values (1,1),(2,2),(3,3); create table t2 as select t1.* from t1 as t1, t1 as t2, t1 as t3, t1 as t4, t1 as t5, t1 as t6, t1 as t7, t1 as t8 where t1.u = t2.u and t2.u = t3.u and t3.u = t4.u and t4.u = t5.u and t5.u = t6.u and t6.u = t7.u and t7.u = t8.u; select * from t2 order by 1; p u 1 1 2 2 3 3 drop table t1; drop table t2; mysql-test/t/ndb_subquery.test +23 −0 Original line number Diff line number Diff line Loading @@ -37,3 +37,26 @@ drop table t1; drop table t2; # bug#5367 ########## ### # bug#11205 create table t1 (p int not null primary key, u int not null) engine=ndb; insert into t1 values (1,1),(2,2),(3,3); create table t2 as select t1.* from t1 as t1, t1 as t2, t1 as t3, t1 as t4, t1 as t5, t1 as t6, t1 as t7, t1 as t8 where t1.u = t2.u and t2.u = t3.u and t3.u = t4.u and t4.u = t5.u and t5.u = t6.u and t6.u = t7.u and t7.u = t8.u; select * from t2 order by 1; drop table t1; drop table t2; ndb/include/ndbapi/Ndb.hpp +1 −1 Original line number Diff line number Diff line Loading @@ -1614,7 +1614,7 @@ private: Uint32 theNoOfPreparedTransactions; Uint32 theNoOfSentTransactions; Uint32 theNoOfCompletedTransactions; Uint32 theNoOfAllocatedTransactions; Uint32 theRemainingStartTransactions; Uint32 theMaxNoOfTransactions; Uint32 theMinNoOfEventsToWakeUp; Loading ndb/src/ndbapi/Ndb.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -425,12 +425,20 @@ Ndb::startTransactionLocal(Uint32 aPriority, Uint32 nodeId) DBUG_ENTER("Ndb::startTransactionLocal"); DBUG_PRINT("enter", ("nodeid: %d", nodeId)); if(unlikely(theRemainingStartTransactions == 0)) { theError.code = 4006; DBUG_RETURN(0); } NdbTransaction* tConnection; Uint64 tFirstTransId = theFirstTransId; tConnection = doConnect(nodeId); if (tConnection == NULL) { DBUG_RETURN(NULL); }//if theRemainingStartTransactions--; NdbTransaction* tConNext = theTransactionList; tConnection->init(); theTransactionList = tConnection; // into a transaction list. Loading Loading @@ -481,6 +489,7 @@ Ndb::closeTransaction(NdbTransaction* aConnection) CHECK_STATUS_MACRO_VOID; tCon = theTransactionList; theRemainingStartTransactions++; DBUG_PRINT("info",("close trans: 0x%x transid: 0x%llx", aConnection, aConnection->getTransactionId())); Loading ndb/src/ndbapi/NdbScanOperation.cpp +5 −1 Original line number Diff line number Diff line Loading @@ -89,15 +89,18 @@ int NdbScanOperation::init(const NdbTableImpl* tab, NdbTransaction* myConnection) { m_transConnection = myConnection; //NdbTransaction* aScanConnection = theNdb->startTransaction(myConnection); //NdbConnection* aScanConnection = theNdb->startTransaction(myConnection); theNdb->theRemainingStartTransactions++; // will be checked in hupp... NdbTransaction* aScanConnection = theNdb->hupp(myConnection); if (!aScanConnection){ theNdb->theRemainingStartTransactions--; setErrorCodeAbort(theNdb->getNdbError().code); return -1; } // NOTE! The hupped trans becomes the owner of the operation if(NdbOperation::init(tab, aScanConnection) != 0){ theNdb->theRemainingStartTransactions--; return -1; } Loading Loading @@ -675,6 +678,7 @@ void NdbScanOperation::close(bool forceSend, bool releaseOp) tCon->theScanningOp = 0; theNdb->closeTransaction(tCon); theNdb->theRemainingStartTransactions--; DBUG_VOID_RETURN; } Loading Loading
mysql-test/r/ndb_subquery.result +19 −0 Original line number Diff line number Diff line Loading @@ -40,3 +40,22 @@ p u o 5 5 5 drop table t1; drop table t2; create table t1 (p int not null primary key, u int not null) engine=ndb; insert into t1 values (1,1),(2,2),(3,3); create table t2 as select t1.* from t1 as t1, t1 as t2, t1 as t3, t1 as t4, t1 as t5, t1 as t6, t1 as t7, t1 as t8 where t1.u = t2.u and t2.u = t3.u and t3.u = t4.u and t4.u = t5.u and t5.u = t6.u and t6.u = t7.u and t7.u = t8.u; select * from t2 order by 1; p u 1 1 2 2 3 3 drop table t1; drop table t2;
mysql-test/t/ndb_subquery.test +23 −0 Original line number Diff line number Diff line Loading @@ -37,3 +37,26 @@ drop table t1; drop table t2; # bug#5367 ########## ### # bug#11205 create table t1 (p int not null primary key, u int not null) engine=ndb; insert into t1 values (1,1),(2,2),(3,3); create table t2 as select t1.* from t1 as t1, t1 as t2, t1 as t3, t1 as t4, t1 as t5, t1 as t6, t1 as t7, t1 as t8 where t1.u = t2.u and t2.u = t3.u and t3.u = t4.u and t4.u = t5.u and t5.u = t6.u and t6.u = t7.u and t7.u = t8.u; select * from t2 order by 1; drop table t1; drop table t2;
ndb/include/ndbapi/Ndb.hpp +1 −1 Original line number Diff line number Diff line Loading @@ -1614,7 +1614,7 @@ private: Uint32 theNoOfPreparedTransactions; Uint32 theNoOfSentTransactions; Uint32 theNoOfCompletedTransactions; Uint32 theNoOfAllocatedTransactions; Uint32 theRemainingStartTransactions; Uint32 theMaxNoOfTransactions; Uint32 theMinNoOfEventsToWakeUp; Loading
ndb/src/ndbapi/Ndb.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -425,12 +425,20 @@ Ndb::startTransactionLocal(Uint32 aPriority, Uint32 nodeId) DBUG_ENTER("Ndb::startTransactionLocal"); DBUG_PRINT("enter", ("nodeid: %d", nodeId)); if(unlikely(theRemainingStartTransactions == 0)) { theError.code = 4006; DBUG_RETURN(0); } NdbTransaction* tConnection; Uint64 tFirstTransId = theFirstTransId; tConnection = doConnect(nodeId); if (tConnection == NULL) { DBUG_RETURN(NULL); }//if theRemainingStartTransactions--; NdbTransaction* tConNext = theTransactionList; tConnection->init(); theTransactionList = tConnection; // into a transaction list. Loading Loading @@ -481,6 +489,7 @@ Ndb::closeTransaction(NdbTransaction* aConnection) CHECK_STATUS_MACRO_VOID; tCon = theTransactionList; theRemainingStartTransactions++; DBUG_PRINT("info",("close trans: 0x%x transid: 0x%llx", aConnection, aConnection->getTransactionId())); Loading
ndb/src/ndbapi/NdbScanOperation.cpp +5 −1 Original line number Diff line number Diff line Loading @@ -89,15 +89,18 @@ int NdbScanOperation::init(const NdbTableImpl* tab, NdbTransaction* myConnection) { m_transConnection = myConnection; //NdbTransaction* aScanConnection = theNdb->startTransaction(myConnection); //NdbConnection* aScanConnection = theNdb->startTransaction(myConnection); theNdb->theRemainingStartTransactions++; // will be checked in hupp... NdbTransaction* aScanConnection = theNdb->hupp(myConnection); if (!aScanConnection){ theNdb->theRemainingStartTransactions--; setErrorCodeAbort(theNdb->getNdbError().code); return -1; } // NOTE! The hupped trans becomes the owner of the operation if(NdbOperation::init(tab, aScanConnection) != 0){ theNdb->theRemainingStartTransactions--; return -1; } Loading Loading @@ -675,6 +678,7 @@ void NdbScanOperation::close(bool forceSend, bool releaseOp) tCon->theScanningOp = 0; theNdb->closeTransaction(tCon); theNdb->theRemainingStartTransactions--; DBUG_VOID_RETURN; } Loading