mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge
ndb/include/ndbapi/Ndb.hpp: Auto merged ndb/include/ndbapi/NdbConnection.hpp: Auto merged ndb/include/ndbapi/NdbIndexOperation.hpp: Auto merged ndb/Epilogue.mk_old: Auto merged ndb/src/common/debugger/signaldata/Makefile_old: Auto merged ndb/src/common/mgmcommon/Makefile_old: Auto merged ndb/src/common/util/Makefile_old: Auto merged ndb/src/kernel/Makefile_old: Auto merged ndb/src/kernel/ndb-main/Main.cpp: Auto merged ndb/src/kernel/ndb-main/Makefile_old: Auto merged ndb/src/kernel/vm/Makefile_old: Auto merged ndb/src/mgmapi/Makefile_old: Auto merged ndb/src/mgmclient/Makefile_old: Auto merged ndb/src/mgmsrv/Makefile_old: Auto merged ndb/src/mgmsrv/MgmtSrvr.cpp: Auto merged ndb/src/ndbapi/ClusterMgr.cpp: Auto merged ndb/src/ndbapi/Makefile_old: Auto merged ndb/src/ndbapi/Ndb.cpp: Auto merged ndb/src/ndbapi/NdbApiSignal.cpp: Auto merged ndb/src/ndbapi/NdbConnection.cpp: Auto merged ndb/src/ndbapi/NdbDictionaryImpl.cpp: Auto merged ndb/src/ndbapi/NdbEventOperationImpl.cpp: Auto merged ndb/src/ndbapi/NdbIndexOperation.cpp: Auto merged ndb/src/ndbapi/NdbOperation.cpp: Auto merged ndb/src/ndbapi/NdbOperationDefine.cpp: Auto merged ndb/src/ndbapi/NdbOperationExec.cpp: Auto merged ndb/src/ndbapi/NdbOperationInt.cpp: Auto merged ndb/src/ndbapi/Ndbinit.cpp: Auto merged ndb/src/ndbapi/TransporterFacade.cpp: Auto merged ndb/src/ndbapi/TransporterFacade.hpp: Auto merged ndb/test/ndbapi/Makefile_old: Auto merged ndb/test/ndbapi/ScanFunctions.hpp: Auto merged ndb/test/ndbapi/ScanInterpretTest.hpp: Auto merged ndb/test/ndbapi/testDataBuffers.cpp: Auto merged ndb/test/ndbapi/old_dirs/testBackup/Makefile: Auto merged ndb/test/ndbapi/old_dirs/testGrep/Makefile: Auto merged ndb/test/ndbapi/old_dirs/testGrep/verify/Makefile: Auto merged ndb/test/ndbapi/testDict.cpp: Auto merged ndb/test/ndbapi/testGrep.cpp: Auto merged ndb/test/ndbapi/testIndex.cpp: Auto merged ndb/test/ndbapi/testOIBasic.cpp: Auto merged ndb/test/ndbapi/testSystemRestart.cpp: Auto merged ndb/test/ndbapi/testTimeout.cpp: Auto merged ndb/test/src/Makefile_old: Auto merged ndb/test/src/UtilTransactions.cpp: Auto merged ndb/test/tools/create_index.cpp: Auto merged ndb/tools/select_all.cpp: Auto merged
This commit is contained in:
@ -80,7 +80,8 @@ ScanFunctions::scanReadFunctions(Ndb* pNdb,
|
||||
int sleepTime = 10;
|
||||
int check;
|
||||
NdbConnection *pTrans;
|
||||
NdbOperation *pOp;
|
||||
NdbScanOperation *pOp;
|
||||
NdbResultSet *rs;
|
||||
|
||||
while (true){
|
||||
if (retryAttempt >= retryMax){
|
||||
@ -104,69 +105,36 @@ ScanFunctions::scanReadFunctions(Ndb* pNdb,
|
||||
|
||||
// Execute the scan without defining a scan operation
|
||||
if(action != ExecuteScanWithOutOpenScan){
|
||||
|
||||
if (action == OnlyOneOpBeforeOpenScan){
|
||||
// There can only be one operation defined when calling openScan
|
||||
NdbOperation* pOp3;
|
||||
pOp3 = pTrans->getNdbOperation(tab.getName());
|
||||
if (pOp3 == NULL) {
|
||||
ERR(pTrans->getNdbError());
|
||||
pNdb->closeTransaction(pTrans);
|
||||
return NDBT_FAILED;
|
||||
}
|
||||
}
|
||||
|
||||
pOp = pTrans->getNdbOperation(tab.getName());
|
||||
pOp = pTrans->getNdbScanOperation(tab.getName());
|
||||
if (pOp == NULL) {
|
||||
ERR(pTrans->getNdbError());
|
||||
pNdb->closeTransaction(pTrans);
|
||||
return NDBT_FAILED;
|
||||
}
|
||||
|
||||
if (exclusive == true)
|
||||
check = pOp->openScanExclusive(parallelism);
|
||||
else
|
||||
check = pOp->openScanRead(parallelism);
|
||||
if( check == -1 ) {
|
||||
|
||||
rs = pOp->readTuples(exclusive ?
|
||||
NdbScanOperation::LM_Exclusive :
|
||||
NdbScanOperation::LM_Read);
|
||||
|
||||
if( rs == 0 ) {
|
||||
ERR(pTrans->getNdbError());
|
||||
pNdb->closeTransaction(pTrans);
|
||||
return NDBT_FAILED;
|
||||
}
|
||||
|
||||
|
||||
if (action == OnlyOneScanPerTrans){
|
||||
// There can only be one operation in a scan transaction
|
||||
NdbOperation* pOp4;
|
||||
pOp4 = pTrans->getNdbOperation(tab.getName());
|
||||
if (pOp4 == NULL) {
|
||||
ERR(pTrans->getNdbError());
|
||||
pNdb->closeTransaction(pTrans);
|
||||
return NDBT_FAILED;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (action == OnlyOpenScanOnce){
|
||||
// Call openScan one more time when it's already defined
|
||||
check = pOp->openScanRead(parallelism);
|
||||
if( check == -1 ) {
|
||||
NdbResultSet* rs2 = pOp->readTuples(NdbScanOperation::LM_Read);
|
||||
if( rs2 == 0 ) {
|
||||
ERR(pTrans->getNdbError());
|
||||
pNdb->closeTransaction(pTrans);
|
||||
return NDBT_FAILED;
|
||||
}
|
||||
}
|
||||
|
||||
if (action == OnlyOneOpInScanTrans){
|
||||
// Try to add another op to this scanTransaction
|
||||
NdbOperation* pOp2;
|
||||
pOp2 = pTrans->getNdbOperation(tab.getName());
|
||||
if (pOp2 == NULL) {
|
||||
ERR(pTrans->getNdbError());
|
||||
pNdb->closeTransaction(pTrans);
|
||||
return NDBT_FAILED;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (action==EqualAfterOpenScan){
|
||||
check = pOp->equal(tab.getColumn(0)->getName(), 10);
|
||||
if( check == -1 ) {
|
||||
@ -191,7 +159,7 @@ ScanFunctions::scanReadFunctions(Ndb* pNdb,
|
||||
}
|
||||
}
|
||||
}
|
||||
check = pTrans->executeScan();
|
||||
check = pTrans->execute(NoCommit);
|
||||
if( check == -1 ) {
|
||||
ERR(pTrans->getNdbError());
|
||||
pNdb->closeTransaction(pTrans);
|
||||
@ -203,7 +171,7 @@ ScanFunctions::scanReadFunctions(Ndb* pNdb,
|
||||
bool abortTrans = (action==CloseWithoutStop);
|
||||
int eof;
|
||||
int rows = 0;
|
||||
eof = pTrans->nextScanResult();
|
||||
eof = rs->nextResult();
|
||||
|
||||
while(eof == 0){
|
||||
rows++;
|
||||
@ -213,7 +181,7 @@ ScanFunctions::scanReadFunctions(Ndb* pNdb,
|
||||
|
||||
if (action != CloseWithoutStop){
|
||||
// Test that we can closeTrans without stopScan
|
||||
check = pTrans->stopScan();
|
||||
rs->close();
|
||||
if( check == -1 ) {
|
||||
ERR(pTrans->getNdbError());
|
||||
pNdb->closeTransaction(pTrans);
|
||||
@ -236,7 +204,7 @@ ScanFunctions::scanReadFunctions(Ndb* pNdb,
|
||||
}
|
||||
}
|
||||
|
||||
eof = pTrans->nextScanResult();
|
||||
eof = rs->nextResult();
|
||||
}
|
||||
if (eof == -1) {
|
||||
const NdbError err = pTrans->getNdbError();
|
||||
@ -246,7 +214,7 @@ ScanFunctions::scanReadFunctions(Ndb* pNdb,
|
||||
|
||||
// Be cruel, call nextScanResult after error
|
||||
for(int i=0; i<10; i++){
|
||||
eof =pTrans->nextScanResult();
|
||||
eof = rs->nextResult();
|
||||
if(eof == 0){
|
||||
g_err << "nextScanResult returned eof = " << eof << endl
|
||||
<< " That is an error when there are no more records" << endl;
|
||||
@ -276,7 +244,7 @@ ScanFunctions::scanReadFunctions(Ndb* pNdb,
|
||||
if (action == NextScanWhenNoMore){
|
||||
g_info << "Calling nextScanresult when there are no more records" << endl;
|
||||
for(int i=0; i<10; i++){
|
||||
eof =pTrans->nextScanResult();
|
||||
eof = rs->nextResult();
|
||||
if(eof == 0){
|
||||
g_err << "nextScanResult returned eof = " << eof << endl
|
||||
<< " That is an error when there are no more records" << endl;
|
||||
@ -285,7 +253,7 @@ ScanFunctions::scanReadFunctions(Ndb* pNdb,
|
||||
}
|
||||
|
||||
}
|
||||
if(action ==CheckInactivityBeforeClose){
|
||||
if(action == CheckInactivityBeforeClose){
|
||||
// Sleep for a long time before calling close
|
||||
g_info << "NdbSleep_SecSleep(5) before close transaction" << endl;
|
||||
NdbSleep_SecSleep(5);
|
||||
|
Reference in New Issue
Block a user