diff options
author | unknown <jonas@eel.(none)> | 2005-09-09 12:39:06 +0200 |
---|---|---|
committer | unknown <jonas@eel.(none)> | 2005-09-09 12:39:06 +0200 |
commit | b1fab24ce22695221f022fd825391b2475ff0908 (patch) | |
tree | 680db86a2ac3b15e7744443acf08877d249ce8b6 /ndb/test/src/UtilTransactions.cpp | |
parent | 43fb5cd358aa61e1bbd7a4e1a84e46f8dfcfb626 (diff) | |
download | mariadb-git-b1fab24ce22695221f022fd825391b2475ff0908.tar.gz |
ndb
new testprogram testSRBank
BitKeeper/etc/ignore:
Added ndb/test/ndbapi/testSRBank to the ignore list
ndb/test/include/NDBT_Test.hpp:
incProperty
ndb/test/ndbapi/Makefile.am:
new test program
ndb/test/ndbapi/bank/Bank.cpp:
remove endless wait until ready loop
fix lots of retry loops to better handle error
ndb/test/ndbapi/bank/Bank.hpp:
remove endless wait until ready loop
fix lots of retry loops to better handle error
ndb/test/src/NDBT_Test.cpp:
incProperty
ndb/test/src/UtilTransactions.cpp:
close transaction if failed
ndb/test/ndbapi/testSRBank.cpp:
New BitKeeper file ``ndb/test/ndbapi/testSRBank.cpp''
Diffstat (limited to 'ndb/test/src/UtilTransactions.cpp')
-rw-r--r-- | ndb/test/src/UtilTransactions.cpp | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/ndb/test/src/UtilTransactions.cpp b/ndb/test/src/UtilTransactions.cpp index 869f7fc76cb..92073143d34 100644 --- a/ndb/test/src/UtilTransactions.cpp +++ b/ndb/test/src/UtilTransactions.cpp @@ -766,19 +766,29 @@ UtilTransactions::selectCount(Ndb* pNdb, int check; NdbScanOperation *pOp; - if(!pTrans) - pTrans = pNdb->startTransaction(); while (true){ - if (retryAttempt >= retryMax){ g_info << "ERROR: has retried this operation " << retryAttempt << " times, failing!" << endl; return NDBT_FAILED; } + if(!pTrans) + pTrans = pNdb->startTransaction(); + + if(!pTrans) + { + const NdbError err = pNdb->getNdbError(); + + if (err.status == NdbError::TemporaryError) + continue; + return NDBT_FAILED; + } + pOp = pTrans->getNdbScanOperation(tab.getName()); if (pOp == NULL) { ERR(pTrans->getNdbError()); pNdb->closeTransaction(pTrans); + pTrans = 0; return NDBT_FAILED; } @@ -786,6 +796,7 @@ UtilTransactions::selectCount(Ndb* pNdb, if( rs == 0) { ERR(pTrans->getNdbError()); pNdb->closeTransaction(pTrans); + pTrans = 0; return NDBT_FAILED; } @@ -799,6 +810,7 @@ UtilTransactions::selectCount(Ndb* pNdb, if( check == -1 ) { ERR(pTrans->getNdbError()); pNdb->closeTransaction(pTrans); + pTrans = 0; return NDBT_FAILED; } } @@ -808,6 +820,7 @@ UtilTransactions::selectCount(Ndb* pNdb, if( check == -1 ) { ERR(pTrans->getNdbError()); pNdb->closeTransaction(pTrans); + pTrans = 0; return NDBT_FAILED; } @@ -823,16 +836,19 @@ UtilTransactions::selectCount(Ndb* pNdb, if (err.status == NdbError::TemporaryError){ pNdb->closeTransaction(pTrans); + pTrans = 0; NdbSleep_MilliSleep(50); retryAttempt++; continue; } ERR(err); pNdb->closeTransaction(pTrans); + pTrans = 0; return NDBT_FAILED; } pNdb->closeTransaction(pTrans); + pTrans = 0; if (count_rows != NULL){ *count_rows = rows; |