Commit 67eff35d authored by unknown's avatar unknown

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
parent 0a3f6a1f
...@@ -9,7 +9,6 @@ create_tab \ ...@@ -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 ...@@ -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
......
This diff is collapsed.
...@@ -335,15 +335,15 @@ int Bank::getBalanceForAccountType(const Uint32 accountType, ...@@ -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, ...@@ -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, ...@@ -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, ...@@ -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){ ...@@ -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){ ...@@ -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", ...@@ -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", ...@@ -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){ ...@@ -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){ ...@@ -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", ...@@ -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", ...@@ -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"){
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment