mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
ndb -
fix scan bugs introduced by acc modifications
add more error testcases
storage/ndb/src/kernel/blocks/dbacc/Dbacc.hpp:
remove unused state
storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp:
1) remove unused state
2) Fix abort of running lock owner
3) Fix abort of running op in parallell queue (especially scans)
storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp:
remove some printouts
add some jams
fix so that close tupscan, can not acciently start acc scan in queue
(NOTE limits #tupscans to 12 which is not really necessary...but the fix was easy)
storage/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp:
Use abort of locks when closing/blocked
as Dbacc gets annoyed when committing an op with state running
storage/ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp:
Use abort of locks when closing/blocked
as Dbacc gets annoyed when committing an op with state running
storage/ndb/test/include/HugoOperations.hpp:
new method
storage/ndb/test/ndbapi/testBasic.cpp:
add more test cases
storage/ndb/test/ndbapi/testScan.cpp:
add more testcases
storage/ndb/test/run-test/daily-basic-tests.txt:
add more testcases
storage/ndb/test/src/HugoOperations.cpp:
add more testcases
This commit is contained in:
@@ -1090,11 +1090,6 @@ runMassiveRollback4(NDBT_Context* ctx, NDBT_Step* step){
|
||||
ok = false;
|
||||
break;
|
||||
}
|
||||
if (hugoOps.execute_NoCommit(pNdb) != 0)
|
||||
{
|
||||
ok = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
hugoOps.execute_Rollback(pNdb);
|
||||
CHECK(hugoOps.closeTransaction(pNdb) == 0);
|
||||
@@ -1199,6 +1194,61 @@ runTupErrors(NDBT_Context* ctx, NDBT_Step* step){
|
||||
return NDBT_OK;
|
||||
}
|
||||
|
||||
int
|
||||
runInsertError(NDBT_Context* ctx, NDBT_Step* step){
|
||||
|
||||
int result = NDBT_OK;
|
||||
HugoOperations hugoOp1(*ctx->getTab());
|
||||
HugoOperations hugoOp2(*ctx->getTab());
|
||||
Ndb* pNdb = GETNDB(step);
|
||||
|
||||
NdbRestarter restarter;
|
||||
restarter.insertErrorInAllNodes(4017);
|
||||
const Uint32 LOOPS = 10;
|
||||
for (Uint32 i = 0; i<LOOPS; i++)
|
||||
{
|
||||
CHECK(hugoOp1.startTransaction(pNdb) == 0);
|
||||
CHECK(hugoOp1.pkInsertRecord(pNdb, 1) == 0);
|
||||
|
||||
CHECK(hugoOp2.startTransaction(pNdb) == 0);
|
||||
CHECK(hugoOp2.pkReadRecord(pNdb, 1, 1) == 0);
|
||||
|
||||
CHECK(hugoOp1.execute_async_prepare(pNdb, NdbTransaction::Commit) == 0);
|
||||
CHECK(hugoOp2.execute_async_prepare(pNdb, NdbTransaction::Commit) == 0);
|
||||
hugoOp1.wait_async(pNdb);
|
||||
hugoOp2.wait_async(pNdb);
|
||||
CHECK(hugoOp1.closeTransaction(pNdb) == 0);
|
||||
CHECK(hugoOp2.closeTransaction(pNdb) == 0);
|
||||
}
|
||||
|
||||
restarter.insertErrorInAllNodes(0);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
int
|
||||
runInsertError2(NDBT_Context* ctx, NDBT_Step* step){
|
||||
int result = NDBT_OK;
|
||||
HugoOperations hugoOp1(*ctx->getTab());
|
||||
Ndb* pNdb = GETNDB(step);
|
||||
|
||||
NdbRestarter restarter;
|
||||
restarter.insertErrorInAllNodes(4017);
|
||||
|
||||
const Uint32 LOOPS = 1;
|
||||
for (Uint32 i = 0; i<LOOPS; i++)
|
||||
{
|
||||
CHECK(hugoOp1.startTransaction(pNdb) == 0);
|
||||
CHECK(hugoOp1.pkInsertRecord(pNdb, 1) == 0);
|
||||
CHECK(hugoOp1.pkDeleteRecord(pNdb, 1) == 0);
|
||||
|
||||
CHECK(hugoOp1.execute_NoCommit(pNdb) == 0);
|
||||
CHECK(hugoOp1.closeTransaction(pNdb) == 0);
|
||||
}
|
||||
|
||||
restarter.insertErrorInAllNodes(0);
|
||||
}
|
||||
|
||||
NDBT_TESTSUITE(testBasic);
|
||||
TESTCASE("PkInsert",
|
||||
"Verify that we can insert and delete from this table using PK"
|
||||
@@ -1449,16 +1499,16 @@ TESTCASE("MassiveTransaction",
|
||||
INITIALIZER(runLoadTable2);
|
||||
FINALIZER(runClearTable2);
|
||||
}
|
||||
TESTCASE("Fill",
|
||||
"Verify what happens when we fill the db" ){
|
||||
INITIALIZER(runFillTable);
|
||||
INITIALIZER(runPkRead);
|
||||
FINALIZER(runClearTable2);
|
||||
}
|
||||
TESTCASE("TupError",
|
||||
"Verify what happens when we fill the db" ){
|
||||
INITIALIZER(runTupErrors);
|
||||
}
|
||||
TESTCASE("InsertError", "" ){
|
||||
INITIALIZER(runInsertError);
|
||||
}
|
||||
TESTCASE("InsertError2", "" ){
|
||||
INITIALIZER(runInsertError2);
|
||||
}
|
||||
NDBT_TESTSUITE_END(testBasic);
|
||||
|
||||
#if 0
|
||||
@@ -1469,6 +1519,12 @@ TESTCASE("ReadConsistency",
|
||||
STEP(runReadOne);
|
||||
FINALIZER(runClearTable2);
|
||||
}
|
||||
TESTCASE("Fill",
|
||||
"Verify what happens when we fill the db" ){
|
||||
INITIALIZER(runFillTable);
|
||||
INITIALIZER(runPkRead);
|
||||
FINALIZER(runClearTable2);
|
||||
}
|
||||
#endif
|
||||
|
||||
int main(int argc, const char** argv){
|
||||
|
||||
Reference in New Issue
Block a user