summaryrefslogtreecommitdiff
path: root/ndb/test/ndbapi/testPartitioning.cpp
diff options
context:
space:
mode:
authorunknown <joreland@mysql.com>2005-01-12 17:29:46 +0100
committerunknown <joreland@mysql.com>2005-01-12 17:29:46 +0100
commitc992cc49624c27b82feea474f561e0fa5f132f79 (patch)
treed7fe8efe9081638a08d6929b685b83a9ab201fd8 /ndb/test/ndbapi/testPartitioning.cpp
parent6f041af11b39be4772e9245a910a334bc404a83a (diff)
downloadmariadb-git-c992cc49624c27b82feea474f561e0fa5f132f79.tar.gz
ndb - more test of partitioning wrt scans & lock modes
ndb/src/kernel/blocks/dbtc/DbtcMain.cpp: Handle "fragment scan" (scan with distribution key) wrt committed read ndb/test/ndbapi/testPartitioning.cpp: Extend test prg to try differnt lock modes / parallelism parameters
Diffstat (limited to 'ndb/test/ndbapi/testPartitioning.cpp')
-rw-r--r--ndb/test/ndbapi/testPartitioning.cpp64
1 files changed, 49 insertions, 15 deletions
diff --git a/ndb/test/ndbapi/testPartitioning.cpp b/ndb/test/ndbapi/testPartitioning.cpp
index f9d2925a602..c50921b85fc 100644
--- a/ndb/test/ndbapi/testPartitioning.cpp
+++ b/ndb/test/ndbapi/testPartitioning.cpp
@@ -22,17 +22,6 @@
#define GETNDB(ps) ((NDBT_NdbApiStep*)ps)->getNdb()
-static
-int runLoadTable(NDBT_Context* ctx, NDBT_Step* step)
-{
- int records = ctx->getNumRecords();
- HugoTransactions hugoTrans(*ctx->getTab());
- if (hugoTrans.loadTable(GETNDB(step), records) != 0){
- return NDBT_FAILED;
- }
- return NDBT_OK;
-}
-
static Uint32 max_dks = 0;
static
@@ -238,11 +227,27 @@ run_tests(Ndb* p_ndb, HugoTransactions& hugoTrans, int records)
return NDBT_FAILED;
}
- if(hugoTrans.scanReadRecords(p_ndb, records) != 0)
- {
- return NDBT_FAILED;
+ Uint32 abort = 23;
+ for(Uint32 j = 0; j<5; j++){
+ Uint32 parallelism = (j == 1 ? 1 : j * 3);
+ ndbout_c("parallelism: %d", parallelism);
+ if (hugoTrans.scanReadRecords(p_ndb, records, abort, parallelism,
+ NdbOperation::LM_Read) != 0)
+ {
+ return NDBT_FAILED;
+ }
+ if (hugoTrans.scanReadRecords(p_ndb, records, abort, parallelism,
+ NdbOperation::LM_Exclusive) != 0)
+ {
+ return NDBT_FAILED;
+ }
+ if (hugoTrans.scanReadRecords(p_ndb, records, abort, parallelism,
+ NdbOperation::LM_CommittedRead) != 0)
+ {
+ return NDBT_FAILED;
+ }
}
-
+
if(hugoTrans.clearTable(p_ndb, records) != 0)
{
return NDBT_FAILED;
@@ -297,6 +302,26 @@ run_index_dk(NDBT_Context* ctx, NDBT_Step* step)
return run_tests(p_ndb, hugoTrans, records);
}
+static int
+run_startHint(NDBT_Context* ctx, NDBT_Step* step)
+{
+ Ndb* p_ndb = GETNDB(step);
+ int records = ctx->getNumRecords();
+ const NdbDictionary::Table *tab =
+ p_ndb->getDictionary()->getTable(ctx->getTab()->getName());
+
+ if(!tab)
+ return NDBT_OK;
+
+ HugoTransactions hugoTrans(*tab);
+ if (hugoTrans.loadTable(p_ndb, records) != 0)
+ {
+ return NDBT_FAILED;
+ }
+
+ return NDBT_OK;
+}
+
NDBT_TESTSUITE(testPartitioning);
TESTCASE("pk_dk",
@@ -332,6 +357,15 @@ TESTCASE("ordered_index_dk",
INITIALIZER(run_create_pk_index_drop);
INITIALIZER(run_drop_table);
}
+TESTCASE("startTransactionHint",
+ "Test startTransactionHint")
+{
+ TC_PROPERTY("distributionkey", ~0);
+ INITIALIZER(run_drop_table);
+ INITIALIZER(run_create_table);
+ INITIALIZER(run_startHint);
+ INITIALIZER(run_drop_table);
+}
NDBT_TESTSUITE_END(testPartitioning);
int main(int argc, const char** argv){