mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Fix bank
ndb/test/ndbapi/Makefile.am: Removed flexScan (-noscan) ndb/test/ndbapi/bank/Bank.cpp: Fixed no scan api ndb/test/ndbapi/bank/BankLoad.cpp: Fixed no scan api ndb/test/ndbapi/testBackup.cpp: Reenable bank ndb/test/ndbapi/testGrep.cpp: Reenable bank
This commit is contained in:
@ -9,7 +9,6 @@ create_tab \
|
|||||||
flexAsynch \
|
flexAsynch \
|
||||||
flexBench \
|
flexBench \
|
||||||
flexHammer \
|
flexHammer \
|
||||||
flexScan \
|
|
||||||
flexTT \
|
flexTT \
|
||||||
testBackup \
|
testBackup \
|
||||||
testBasic \
|
testBasic \
|
||||||
@ -40,7 +39,6 @@ drop_all_tabs_SOURCES = drop_all_tabs.cpp
|
|||||||
flexAsynch_SOURCES = flexAsynch.cpp
|
flexAsynch_SOURCES = flexAsynch.cpp
|
||||||
flexBench_SOURCES = flexBench.cpp
|
flexBench_SOURCES = flexBench.cpp
|
||||||
flexHammer_SOURCES = flexHammer.cpp
|
flexHammer_SOURCES = flexHammer.cpp
|
||||||
flexScan_SOURCES = flexScan.cpp
|
|
||||||
flexTT_SOURCES = flexTT.cpp
|
flexTT_SOURCES = flexTT.cpp
|
||||||
#flexTimedAsynch_SOURCES = flexTimedAsynch.cpp
|
#flexTimedAsynch_SOURCES = flexTimedAsynch.cpp
|
||||||
#flex_bench_mysql_SOURCES = flex_bench_mysql.cpp
|
#flex_bench_mysql_SOURCES = flex_bench_mysql.cpp
|
||||||
|
@ -670,15 +670,15 @@ int Bank::findLastGL(Uint64 &lastTime){
|
|||||||
return NDBT_FAILED;
|
return NDBT_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
NdbOperation* pOp = pScanTrans->getNdbOperation("GL");
|
NdbScanOperation* pOp = pScanTrans->getNdbScanOperation("GL");
|
||||||
if (pOp == NULL) {
|
if (pOp == NULL) {
|
||||||
ERR(pScanTrans->getNdbError());
|
ERR(pScanTrans->getNdbError());
|
||||||
m_ndb.closeTransaction(pScanTrans);
|
m_ndb.closeTransaction(pScanTrans);
|
||||||
return NDBT_FAILED;
|
return NDBT_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
check = pOp->openScanRead(64);
|
NdbResultSet * rs = pOp->readTuples();
|
||||||
if( check == -1 ) {
|
if( rs == 0 ) {
|
||||||
ERR(pScanTrans->getNdbError());
|
ERR(pScanTrans->getNdbError());
|
||||||
m_ndb.closeTransaction(pScanTrans);
|
m_ndb.closeTransaction(pScanTrans);
|
||||||
return NDBT_FAILED;
|
return NDBT_FAILED;
|
||||||
@ -698,7 +698,7 @@ int Bank::findLastGL(Uint64 &lastTime){
|
|||||||
return NDBT_FAILED;
|
return NDBT_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
check = pScanTrans->executeScan();
|
check = pScanTrans->execute(NoCommit);
|
||||||
if( check == -1 ) {
|
if( check == -1 ) {
|
||||||
ERR(pScanTrans->getNdbError());
|
ERR(pScanTrans->getNdbError());
|
||||||
m_ndb.closeTransaction(pScanTrans);
|
m_ndb.closeTransaction(pScanTrans);
|
||||||
@ -707,7 +707,7 @@ int Bank::findLastGL(Uint64 &lastTime){
|
|||||||
|
|
||||||
int eof;
|
int eof;
|
||||||
int rows = 0;
|
int rows = 0;
|
||||||
eof = pScanTrans->nextScanResult();
|
eof = rs->nextResult();
|
||||||
lastTime = 0;
|
lastTime = 0;
|
||||||
|
|
||||||
while(eof == 0){
|
while(eof == 0){
|
||||||
@ -717,7 +717,7 @@ int Bank::findLastGL(Uint64 &lastTime){
|
|||||||
if (t > lastTime)
|
if (t > lastTime)
|
||||||
lastTime = t;
|
lastTime = t;
|
||||||
|
|
||||||
eof = pScanTrans->nextScanResult();
|
eof = rs->nextResult();
|
||||||
}
|
}
|
||||||
if (eof == -1) {
|
if (eof == -1) {
|
||||||
ERR(pScanTrans->getNdbError());
|
ERR(pScanTrans->getNdbError());
|
||||||
@ -1002,15 +1002,15 @@ int Bank::sumTransactionsForGL(const Uint64 glTime,
|
|||||||
return NDBT_FAILED;
|
return NDBT_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
NdbOperation* pOp = pScanTrans->getNdbOperation("TRANSACTION");
|
NdbScanOperation* pOp = pScanTrans->getNdbScanOperation("TRANSACTION");
|
||||||
if (pOp == NULL) {
|
if (pOp == NULL) {
|
||||||
ERR(pScanTrans->getNdbError());
|
ERR(pScanTrans->getNdbError());
|
||||||
m_ndb.closeTransaction(pScanTrans);
|
m_ndb.closeTransaction(pScanTrans);
|
||||||
return NDBT_FAILED;
|
return NDBT_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
check = pOp->openScanExclusive(64);
|
NdbResultSet * rs = pOp->readTuplesExclusive();
|
||||||
if( check == -1 ) {
|
if( rs == 0 ) {
|
||||||
ERR(pScanTrans->getNdbError());
|
ERR(pScanTrans->getNdbError());
|
||||||
m_ndb.closeTransaction(pScanTrans);
|
m_ndb.closeTransaction(pScanTrans);
|
||||||
return NDBT_FAILED;
|
return NDBT_FAILED;
|
||||||
@ -1051,7 +1051,7 @@ int Bank::sumTransactionsForGL(const Uint64 glTime,
|
|||||||
return NDBT_FAILED;
|
return NDBT_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
check = pScanTrans->executeScan();
|
check = pScanTrans->execute(NoCommit);
|
||||||
if( check == -1 ) {
|
if( check == -1 ) {
|
||||||
ERR(pScanTrans->getNdbError());
|
ERR(pScanTrans->getNdbError());
|
||||||
m_ndb.closeTransaction(pScanTrans);
|
m_ndb.closeTransaction(pScanTrans);
|
||||||
@ -1061,7 +1061,7 @@ int Bank::sumTransactionsForGL(const Uint64 glTime,
|
|||||||
int eof;
|
int eof;
|
||||||
int rows = 0;
|
int rows = 0;
|
||||||
int rowsFound = 0;
|
int rowsFound = 0;
|
||||||
eof = pScanTrans->nextScanResult();
|
eof = rs->nextResult();
|
||||||
|
|
||||||
while(eof == 0){
|
while(eof == 0){
|
||||||
rows++;
|
rows++;
|
||||||
@ -1085,7 +1085,7 @@ int Bank::sumTransactionsForGL(const Uint64 glTime,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
eof = pScanTrans->nextScanResult();
|
eof = rs->nextResult();
|
||||||
|
|
||||||
if ((rows % 100) == 0){
|
if ((rows % 100) == 0){
|
||||||
// "refresh" ownner transaction every 100th row
|
// "refresh" ownner transaction every 100th row
|
||||||
@ -1162,15 +1162,15 @@ int Bank::performValidateGL(Uint64 glTime){
|
|||||||
return NDBT_FAILED;
|
return NDBT_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
NdbOperation* pOp = pScanTrans->getNdbOperation("GL");
|
NdbScanOperation* pOp = pScanTrans->getNdbScanOperation("GL");
|
||||||
if (pOp == NULL) {
|
if (pOp == NULL) {
|
||||||
ERR(pScanTrans->getNdbError());
|
ERR(pScanTrans->getNdbError());
|
||||||
m_ndb.closeTransaction(pScanTrans);
|
m_ndb.closeTransaction(pScanTrans);
|
||||||
return NDBT_FAILED;
|
return NDBT_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
check = pOp->openScanRead(64);
|
NdbResultSet * rs = pOp->readTuples();
|
||||||
if( check == -1 ) {
|
if( rs == 0 ) {
|
||||||
ERR(pScanTrans->getNdbError());
|
ERR(pScanTrans->getNdbError());
|
||||||
m_ndb.closeTransaction(pScanTrans);
|
m_ndb.closeTransaction(pScanTrans);
|
||||||
return NDBT_FAILED;
|
return NDBT_FAILED;
|
||||||
@ -1238,7 +1238,7 @@ int Bank::performValidateGL(Uint64 glTime){
|
|||||||
return NDBT_FAILED;
|
return NDBT_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
check = pScanTrans->executeScan();
|
check = pScanTrans->execute(NoCommit);
|
||||||
if( check == -1 ) {
|
if( check == -1 ) {
|
||||||
ERR(pScanTrans->getNdbError());
|
ERR(pScanTrans->getNdbError());
|
||||||
m_ndb.closeTransaction(pScanTrans);
|
m_ndb.closeTransaction(pScanTrans);
|
||||||
@ -1249,7 +1249,7 @@ int Bank::performValidateGL(Uint64 glTime){
|
|||||||
int rows = 0;
|
int rows = 0;
|
||||||
int countGlRecords = 0;
|
int countGlRecords = 0;
|
||||||
int result = NDBT_OK;
|
int result = NDBT_OK;
|
||||||
eof = pScanTrans->nextScanResult();
|
eof = rs->nextResult();
|
||||||
|
|
||||||
while(eof == 0){
|
while(eof == 0){
|
||||||
rows++;
|
rows++;
|
||||||
@ -1336,7 +1336,7 @@ int Bank::performValidateGL(Uint64 glTime){
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
eof = pScanTrans->nextScanResult();
|
eof = rs->nextResult();
|
||||||
}
|
}
|
||||||
if (eof == -1) {
|
if (eof == -1) {
|
||||||
ERR(pScanTrans->getNdbError());
|
ERR(pScanTrans->getNdbError());
|
||||||
@ -1426,15 +1426,15 @@ int Bank::getOldestPurgedGL(const Uint32 accountType,
|
|||||||
return NDBT_FAILED;
|
return NDBT_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
NdbOperation* pOp = pScanTrans->getNdbOperation("GL");
|
NdbScanOperation* pOp = pScanTrans->getNdbScanOperation("GL");
|
||||||
if (pOp == NULL) {
|
if (pOp == NULL) {
|
||||||
ERR(pScanTrans->getNdbError());
|
ERR(pScanTrans->getNdbError());
|
||||||
m_ndb.closeTransaction(pScanTrans);
|
m_ndb.closeTransaction(pScanTrans);
|
||||||
return NDBT_FAILED;
|
return NDBT_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
check = pOp->openScanRead(64);
|
NdbResultSet * rs = pOp->readTuples();
|
||||||
if( check == -1 ) {
|
if( rs == 0 ) {
|
||||||
ERR(pScanTrans->getNdbError());
|
ERR(pScanTrans->getNdbError());
|
||||||
m_ndb.closeTransaction(pScanTrans);
|
m_ndb.closeTransaction(pScanTrans);
|
||||||
return NDBT_FAILED;
|
return NDBT_FAILED;
|
||||||
@ -1468,7 +1468,7 @@ int Bank::getOldestPurgedGL(const Uint32 accountType,
|
|||||||
return NDBT_FAILED;
|
return NDBT_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
check = pScanTrans->executeScan();
|
check = pScanTrans->execute(NoCommit);
|
||||||
if( check == -1 ) {
|
if( check == -1 ) {
|
||||||
ERR(pScanTrans->getNdbError());
|
ERR(pScanTrans->getNdbError());
|
||||||
m_ndb.closeTransaction(pScanTrans);
|
m_ndb.closeTransaction(pScanTrans);
|
||||||
@ -1477,7 +1477,7 @@ int Bank::getOldestPurgedGL(const Uint32 accountType,
|
|||||||
|
|
||||||
int eof;
|
int eof;
|
||||||
int rows = 0;
|
int rows = 0;
|
||||||
eof = pScanTrans->nextScanResult();
|
eof = rs->nextResult();
|
||||||
oldest = 0;
|
oldest = 0;
|
||||||
|
|
||||||
while(eof == 0){
|
while(eof == 0){
|
||||||
@ -1491,7 +1491,7 @@ int Bank::getOldestPurgedGL(const Uint32 accountType,
|
|||||||
if (t > oldest)
|
if (t > oldest)
|
||||||
oldest = t;
|
oldest = t;
|
||||||
}
|
}
|
||||||
eof = pScanTrans->nextScanResult();
|
eof = rs->nextResult();
|
||||||
}
|
}
|
||||||
if (eof == -1) {
|
if (eof == -1) {
|
||||||
ERR(pScanTrans->getNdbError());
|
ERR(pScanTrans->getNdbError());
|
||||||
@ -1518,15 +1518,15 @@ int Bank::getOldestNotPurgedGL(Uint64 &oldest,
|
|||||||
return NDBT_FAILED;
|
return NDBT_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
NdbOperation* pOp = pScanTrans->getNdbOperation("GL");
|
NdbScanOperation* pOp = pScanTrans->getNdbScanOperation("GL");
|
||||||
if (pOp == NULL) {
|
if (pOp == NULL) {
|
||||||
ERR(pScanTrans->getNdbError());
|
ERR(pScanTrans->getNdbError());
|
||||||
m_ndb.closeTransaction(pScanTrans);
|
m_ndb.closeTransaction(pScanTrans);
|
||||||
return NDBT_FAILED;
|
return NDBT_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
check = pOp->openScanRead(64);
|
NdbResultSet * rs = pOp->readTuples();
|
||||||
if( check == -1 ) {
|
if( rs == 0 ) {
|
||||||
ERR(pScanTrans->getNdbError());
|
ERR(pScanTrans->getNdbError());
|
||||||
m_ndb.closeTransaction(pScanTrans);
|
m_ndb.closeTransaction(pScanTrans);
|
||||||
return NDBT_FAILED;
|
return NDBT_FAILED;
|
||||||
@ -1560,7 +1560,7 @@ int Bank::getOldestNotPurgedGL(Uint64 &oldest,
|
|||||||
return NDBT_FAILED;
|
return NDBT_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
check = pScanTrans->executeScan();
|
check = pScanTrans->execute(NoCommit);
|
||||||
if( check == -1 ) {
|
if( check == -1 ) {
|
||||||
ERR(pScanTrans->getNdbError());
|
ERR(pScanTrans->getNdbError());
|
||||||
m_ndb.closeTransaction(pScanTrans);
|
m_ndb.closeTransaction(pScanTrans);
|
||||||
@ -1569,7 +1569,7 @@ int Bank::getOldestNotPurgedGL(Uint64 &oldest,
|
|||||||
|
|
||||||
int eof;
|
int eof;
|
||||||
int rows = 0;
|
int rows = 0;
|
||||||
eof = pScanTrans->nextScanResult();
|
eof = rs->nextResult();
|
||||||
oldest = (Uint64)-1;
|
oldest = (Uint64)-1;
|
||||||
found = false;
|
found = false;
|
||||||
|
|
||||||
@ -1586,7 +1586,7 @@ int Bank::getOldestNotPurgedGL(Uint64 &oldest,
|
|||||||
accountTypeId = a;
|
accountTypeId = a;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
eof = pScanTrans->nextScanResult();
|
eof = rs->nextResult();
|
||||||
}
|
}
|
||||||
if (eof == -1) {
|
if (eof == -1) {
|
||||||
ERR(pScanTrans->getNdbError());
|
ERR(pScanTrans->getNdbError());
|
||||||
@ -1615,15 +1615,15 @@ int Bank::checkNoTransactionsOlderThan(const Uint32 accountType,
|
|||||||
return NDBT_FAILED;
|
return NDBT_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
NdbOperation* pOp = pScanTrans->getNdbOperation("TRANSACTION");
|
NdbScanOperation* pOp = pScanTrans->getNdbScanOperation("TRANSACTION");
|
||||||
if (pOp == NULL) {
|
if (pOp == NULL) {
|
||||||
ERR(pScanTrans->getNdbError());
|
ERR(pScanTrans->getNdbError());
|
||||||
m_ndb.closeTransaction(pScanTrans);
|
m_ndb.closeTransaction(pScanTrans);
|
||||||
return NDBT_FAILED;
|
return NDBT_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
check = pOp->openScanRead(64);
|
NdbResultSet * rs = pOp->readTuples();
|
||||||
if( check == -1 ) {
|
if( rs == 0 ) {
|
||||||
ERR(pScanTrans->getNdbError());
|
ERR(pScanTrans->getNdbError());
|
||||||
m_ndb.closeTransaction(pScanTrans);
|
m_ndb.closeTransaction(pScanTrans);
|
||||||
return NDBT_FAILED;
|
return NDBT_FAILED;
|
||||||
@ -1657,7 +1657,7 @@ int Bank::checkNoTransactionsOlderThan(const Uint32 accountType,
|
|||||||
return NDBT_FAILED;
|
return NDBT_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
check = pScanTrans->executeScan();
|
check = pScanTrans->execute(NoCommit);
|
||||||
if( check == -1 ) {
|
if( check == -1 ) {
|
||||||
ERR(pScanTrans->getNdbError());
|
ERR(pScanTrans->getNdbError());
|
||||||
m_ndb.closeTransaction(pScanTrans);
|
m_ndb.closeTransaction(pScanTrans);
|
||||||
@ -1667,7 +1667,7 @@ int Bank::checkNoTransactionsOlderThan(const Uint32 accountType,
|
|||||||
int eof;
|
int eof;
|
||||||
int rows = 0;
|
int rows = 0;
|
||||||
int found = 0;
|
int found = 0;
|
||||||
eof = pScanTrans->nextScanResult();
|
eof = rs->nextResult();
|
||||||
|
|
||||||
while(eof == 0){
|
while(eof == 0){
|
||||||
rows++;
|
rows++;
|
||||||
@ -1683,7 +1683,7 @@ int Bank::checkNoTransactionsOlderThan(const Uint32 accountType,
|
|||||||
<< " ti = " << ti << endl;
|
<< " ti = " << ti << endl;
|
||||||
found++;
|
found++;
|
||||||
}
|
}
|
||||||
eof = pScanTrans->nextScanResult();
|
eof = rs->nextResult();
|
||||||
}
|
}
|
||||||
if (eof == -1) {
|
if (eof == -1) {
|
||||||
ERR(pScanTrans->getNdbError());
|
ERR(pScanTrans->getNdbError());
|
||||||
@ -1859,15 +1859,15 @@ int Bank::findTransactionsToPurge(const Uint64 glTime,
|
|||||||
return NDBT_FAILED;
|
return NDBT_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
NdbOperation* pOp = pScanTrans->getNdbOperation("TRANSACTION");
|
NdbScanOperation* pOp = pScanTrans->getNdbScanOperation("TRANSACTION");
|
||||||
if (pOp == NULL) {
|
if (pOp == NULL) {
|
||||||
ERR(pScanTrans->getNdbError());
|
ERR(pScanTrans->getNdbError());
|
||||||
m_ndb.closeTransaction(pScanTrans);
|
m_ndb.closeTransaction(pScanTrans);
|
||||||
return NDBT_FAILED;
|
return NDBT_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
check = pOp->openScanExclusive(64);
|
NdbResultSet * rs = pOp->readTuplesExclusive();
|
||||||
if( check == -1 ) {
|
if( rs == 0 ) {
|
||||||
ERR(pScanTrans->getNdbError());
|
ERR(pScanTrans->getNdbError());
|
||||||
m_ndb.closeTransaction(pScanTrans);
|
m_ndb.closeTransaction(pScanTrans);
|
||||||
return NDBT_FAILED;
|
return NDBT_FAILED;
|
||||||
@ -1894,7 +1894,7 @@ int Bank::findTransactionsToPurge(const Uint64 glTime,
|
|||||||
return NDBT_FAILED;
|
return NDBT_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
check = pScanTrans->executeScan();
|
check = pScanTrans->execute(NoCommit);
|
||||||
if( check == -1 ) {
|
if( check == -1 ) {
|
||||||
ERR(pScanTrans->getNdbError());
|
ERR(pScanTrans->getNdbError());
|
||||||
m_ndb.closeTransaction(pScanTrans);
|
m_ndb.closeTransaction(pScanTrans);
|
||||||
@ -1904,7 +1904,7 @@ int Bank::findTransactionsToPurge(const Uint64 glTime,
|
|||||||
int eof;
|
int eof;
|
||||||
int rows = 0;
|
int rows = 0;
|
||||||
int rowsFound = 0;
|
int rowsFound = 0;
|
||||||
eof = pScanTrans->nextScanResult();
|
eof = rs->nextResult();
|
||||||
|
|
||||||
while(eof == 0){
|
while(eof == 0){
|
||||||
rows++;
|
rows++;
|
||||||
@ -1914,8 +1914,8 @@ int Bank::findTransactionsToPurge(const Uint64 glTime,
|
|||||||
if (a == accountType && t == glTime){
|
if (a == accountType && t == glTime){
|
||||||
rowsFound++;
|
rowsFound++;
|
||||||
// One record found
|
// One record found
|
||||||
NdbOperation* pDelOp = pOp->takeOverForDelete(pTrans);
|
check = rs->deleteTuple(pTrans);
|
||||||
if (pDelOp == NULL){
|
if (check == -1){
|
||||||
ERR(m_ndb.getNdbError());
|
ERR(m_ndb.getNdbError());
|
||||||
m_ndb.closeTransaction(pScanTrans);
|
m_ndb.closeTransaction(pScanTrans);
|
||||||
return NDBT_FAILED;
|
return NDBT_FAILED;
|
||||||
@ -1929,7 +1929,7 @@ int Bank::findTransactionsToPurge(const Uint64 glTime,
|
|||||||
return NDBT_FAILED;
|
return NDBT_FAILED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
eof = pScanTrans->nextScanResult();
|
eof = rs->nextResult();
|
||||||
}
|
}
|
||||||
if (eof == -1) {
|
if (eof == -1) {
|
||||||
ERR(pScanTrans->getNdbError());
|
ERR(pScanTrans->getNdbError());
|
||||||
@ -2348,15 +2348,15 @@ int Bank::getSumAccounts(Uint32 &sumAccounts,
|
|||||||
return NDBT_FAILED;
|
return NDBT_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
NdbOperation* pOp = pScanTrans->getNdbOperation("ACCOUNT");
|
NdbScanOperation* pOp = pScanTrans->getNdbScanOperation("ACCOUNT");
|
||||||
if (pOp == NULL) {
|
if (pOp == NULL) {
|
||||||
ERR(pScanTrans->getNdbError());
|
ERR(pScanTrans->getNdbError());
|
||||||
m_ndb.closeTransaction(pScanTrans);
|
m_ndb.closeTransaction(pScanTrans);
|
||||||
return NDBT_FAILED;
|
return NDBT_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
check = pOp->openScanExclusive(64);
|
NdbResultSet * rs = pOp->readTuplesExclusive();
|
||||||
if( check == -1 ) {
|
if( rs == 0 ) {
|
||||||
ERR(pScanTrans->getNdbError());
|
ERR(pScanTrans->getNdbError());
|
||||||
m_ndb.closeTransaction(pScanTrans);
|
m_ndb.closeTransaction(pScanTrans);
|
||||||
return NDBT_FAILED;
|
return NDBT_FAILED;
|
||||||
@ -2376,7 +2376,7 @@ int Bank::getSumAccounts(Uint32 &sumAccounts,
|
|||||||
return NDBT_FAILED;
|
return NDBT_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
check = pScanTrans->executeScan();
|
check = pScanTrans->execute(NoCommit);
|
||||||
if( check == -1 ) {
|
if( check == -1 ) {
|
||||||
ERR(pScanTrans->getNdbError());
|
ERR(pScanTrans->getNdbError());
|
||||||
m_ndb.closeTransaction(pScanTrans);
|
m_ndb.closeTransaction(pScanTrans);
|
||||||
@ -2391,7 +2391,7 @@ int Bank::getSumAccounts(Uint32 &sumAccounts,
|
|||||||
}
|
}
|
||||||
|
|
||||||
int eof;
|
int eof;
|
||||||
eof = pScanTrans->nextScanResult();
|
eof = rs->nextResult();
|
||||||
|
|
||||||
while(eof == 0){
|
while(eof == 0){
|
||||||
Uint32 b = balanceRec->u_32_value();
|
Uint32 b = balanceRec->u_32_value();
|
||||||
@ -2403,7 +2403,7 @@ int Bank::getSumAccounts(Uint32 &sumAccounts,
|
|||||||
// << ", sum="<< sumAccounts << endl;
|
// << ", sum="<< sumAccounts << endl;
|
||||||
|
|
||||||
// Take over the operation so that the lock is kept in db
|
// Take over the operation so that the lock is kept in db
|
||||||
NdbOperation* pLockOp = pOp->takeOverForUpdate(pTrans);
|
NdbOperation* pLockOp = rs->updateTuple(pTrans);
|
||||||
if (pLockOp == NULL){
|
if (pLockOp == NULL){
|
||||||
ERR(m_ndb.getNdbError());
|
ERR(m_ndb.getNdbError());
|
||||||
m_ndb.closeTransaction(pScanTrans);
|
m_ndb.closeTransaction(pScanTrans);
|
||||||
@ -2429,7 +2429,7 @@ int Bank::getSumAccounts(Uint32 &sumAccounts,
|
|||||||
return NDBT_FAILED;
|
return NDBT_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
eof = pScanTrans->nextScanResult();
|
eof = rs->nextResult();
|
||||||
}
|
}
|
||||||
if (eof == -1) {
|
if (eof == -1) {
|
||||||
ERR(pScanTrans->getNdbError());
|
ERR(pScanTrans->getNdbError());
|
||||||
|
@ -335,15 +335,15 @@ int Bank::getBalanceForAccountType(const Uint32 accountType,
|
|||||||
return NDBT_FAILED;
|
return NDBT_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
NdbOperation* pOp = pScanTrans->getNdbOperation("ACCOUNT");
|
NdbScanOperation* pOp = pScanTrans->getNdbScanOperation("ACCOUNT");
|
||||||
if (pOp == NULL) {
|
if (pOp == NULL) {
|
||||||
ERR(pScanTrans->getNdbError());
|
ERR(pScanTrans->getNdbError());
|
||||||
m_ndb.closeTransaction(pScanTrans);
|
m_ndb.closeTransaction(pScanTrans);
|
||||||
return NDBT_FAILED;
|
return NDBT_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
check = pOp->openScanRead(64);
|
NdbResultSet* rs = pOp->readTuples();
|
||||||
if( check == -1 ) {
|
if( rs == 0 ) {
|
||||||
ERR(pScanTrans->getNdbError());
|
ERR(pScanTrans->getNdbError());
|
||||||
m_ndb.closeTransaction(pScanTrans);
|
m_ndb.closeTransaction(pScanTrans);
|
||||||
return NDBT_FAILED;
|
return NDBT_FAILED;
|
||||||
@ -370,7 +370,7 @@ int Bank::getBalanceForAccountType(const Uint32 accountType,
|
|||||||
return NDBT_FAILED;
|
return NDBT_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
check = pScanTrans->executeScan();
|
check = pScanTrans->execute(NoCommit);
|
||||||
if( check == -1 ) {
|
if( check == -1 ) {
|
||||||
ERR(pScanTrans->getNdbError());
|
ERR(pScanTrans->getNdbError());
|
||||||
m_ndb.closeTransaction(pScanTrans);
|
m_ndb.closeTransaction(pScanTrans);
|
||||||
@ -379,7 +379,7 @@ int Bank::getBalanceForAccountType(const Uint32 accountType,
|
|||||||
|
|
||||||
int eof;
|
int eof;
|
||||||
int rows = 0;
|
int rows = 0;
|
||||||
eof = pScanTrans->nextScanResult();
|
eof = rs->nextResult();
|
||||||
|
|
||||||
while(eof == 0){
|
while(eof == 0){
|
||||||
rows++;
|
rows++;
|
||||||
@ -391,7 +391,7 @@ int Bank::getBalanceForAccountType(const Uint32 accountType,
|
|||||||
balance += b;
|
balance += b;
|
||||||
}
|
}
|
||||||
|
|
||||||
eof = pScanTrans->nextScanResult();
|
eof = rs->nextResult();
|
||||||
}
|
}
|
||||||
if (eof == -1) {
|
if (eof == -1) {
|
||||||
ERR(pScanTrans->getNdbError());
|
ERR(pScanTrans->getNdbError());
|
||||||
|
@ -205,8 +205,6 @@ int runClearTable(NDBT_Context* ctx, NDBT_Step* step){
|
|||||||
return NDBT_OK;
|
return NDBT_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
|
|
||||||
#include "bank/Bank.hpp"
|
#include "bank/Bank.hpp"
|
||||||
|
|
||||||
int runCreateBank(NDBT_Context* ctx, NDBT_Step* step){
|
int runCreateBank(NDBT_Context* ctx, NDBT_Step* step){
|
||||||
@ -395,7 +393,6 @@ int runRestoreBankAndVerify(NDBT_Context* ctx, NDBT_Step* step){
|
|||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
NDBT_TESTSUITE(testBackup);
|
NDBT_TESTSUITE(testBackup);
|
||||||
TESTCASE("BackupOne",
|
TESTCASE("BackupOne",
|
||||||
@ -413,7 +410,6 @@ TESTCASE("BackupOne",
|
|||||||
FINALIZER(runClearTable);
|
FINALIZER(runClearTable);
|
||||||
|
|
||||||
}
|
}
|
||||||
#if 0
|
|
||||||
TESTCASE("BackupBank",
|
TESTCASE("BackupBank",
|
||||||
"Test that backup and restore works during transaction load\n"
|
"Test that backup and restore works during transaction load\n"
|
||||||
" by backing up the bank"
|
" by backing up the bank"
|
||||||
@ -433,7 +429,6 @@ TESTCASE("BackupBank",
|
|||||||
VERIFIER(runRestoreBankAndVerify);
|
VERIFIER(runRestoreBankAndVerify);
|
||||||
// FINALIZER(runDropBank);
|
// FINALIZER(runDropBank);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
TESTCASE("NFMaster",
|
TESTCASE("NFMaster",
|
||||||
"Test that backup behaves during node failiure\n"){
|
"Test that backup behaves during node failiure\n"){
|
||||||
INITIALIZER(setMaster);
|
INITIALIZER(setMaster);
|
||||||
|
@ -254,9 +254,7 @@ int runClearTable(NDBT_Context* ctx, NDBT_Step* step){
|
|||||||
return NDBT_OK;
|
return NDBT_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#include "bank/Bank.hpp"
|
||||||
|
|
||||||
#include "../bank/Bank.hpp"
|
|
||||||
|
|
||||||
int runCreateBank(NDBT_Context* ctx, NDBT_Step* step){
|
int runCreateBank(NDBT_Context* ctx, NDBT_Step* step){
|
||||||
Bank bank;
|
Bank bank;
|
||||||
@ -445,7 +443,6 @@ int runRestoreBankAndVerify(NDBT_Context* ctx, NDBT_Step* step){
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
#endif
|
|
||||||
|
|
||||||
NDBT_TESTSUITE(testGrep);
|
NDBT_TESTSUITE(testGrep);
|
||||||
TESTCASE("GrepBasic",
|
TESTCASE("GrepBasic",
|
||||||
@ -476,8 +473,6 @@ TESTCASE("GrepNodeRestart",
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
|
|
||||||
TESTCASE("GrepBank",
|
TESTCASE("GrepBank",
|
||||||
"Test that grep and restore works during transaction load\n"
|
"Test that grep and restore works during transaction load\n"
|
||||||
" by backing up the bank"
|
" by backing up the bank"
|
||||||
@ -498,7 +493,6 @@ TESTCASE("GrepBank",
|
|||||||
// FINALIZER(runDropBank);
|
// FINALIZER(runDropBank);
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
TESTCASE("NFMaster",
|
TESTCASE("NFMaster",
|
||||||
"Test that grep behaves during node failiure\n"){
|
"Test that grep behaves during node failiure\n"){
|
||||||
|
Reference in New Issue
Block a user