summaryrefslogtreecommitdiff
path: root/storage/ndb/test/ndbapi
diff options
context:
space:
mode:
authorunknown <jonas@perch.ndb.mysql.com>2007-10-15 11:35:30 +0200
committerunknown <jonas@perch.ndb.mysql.com>2007-10-15 11:35:30 +0200
commite8c4a6ba9f430dc4494c4869258321bebb02db04 (patch)
tree83e16ccbed21555836321df43655565e97a5582e /storage/ndb/test/ndbapi
parentffef8fc610b47428cbbd41437b7eedca69488ea3 (diff)
parent67b31b0fdbcd6c38cf4185ff50c4f735e1cd1eb7 (diff)
downloadmariadb-git-e8c4a6ba9f430dc4494c4869258321bebb02db04.tar.gz
Merge perch.ndb.mysql.com:/home/jonas/src/51-simple-read
into perch.ndb.mysql.com:/home/jonas/src/51-ndb storage/ndb/include/ndbapi/NdbOperation.hpp: Auto merged
Diffstat (limited to 'storage/ndb/test/ndbapi')
-rw-r--r--storage/ndb/test/ndbapi/testBasic.cpp35
1 files changed, 13 insertions, 22 deletions
diff --git a/storage/ndb/test/ndbapi/testBasic.cpp b/storage/ndb/test/ndbapi/testBasic.cpp
index 952b5a50dc5..ac23ceaad18 100644
--- a/storage/ndb/test/ndbapi/testBasic.cpp
+++ b/storage/ndb/test/ndbapi/testBasic.cpp
@@ -136,31 +136,13 @@ int runPkRead(NDBT_Context* ctx, NDBT_Step* step){
int loops = ctx->getNumLoops();
int records = ctx->getNumRecords();
int batchSize = ctx->getProperty("BatchSize", 1);
+ int lm = ctx->getProperty("LockMode", NdbOperation::LM_Read);
int i = 0;
HugoTransactions hugoTrans(*ctx->getTab());
while (i<loops) {
g_info << i << ": ";
- if (hugoTrans.pkReadRecords(GETNDB(step), records, batchSize) != NDBT_OK){
- g_info << endl;
- return NDBT_FAILED;
- }
- i++;
- }
- g_info << endl;
- return NDBT_OK;
-}
-
-int runPkDirtyRead(NDBT_Context* ctx, NDBT_Step* step){
- int loops = ctx->getNumLoops();
- int records = ctx->getNumRecords();
- int batchSize = ctx->getProperty("BatchSize", 1);
- int i = 0;
- bool dirty = true;
- HugoTransactions hugoTrans(*ctx->getTab());
- while (i<loops) {
- g_info << i << ": ";
- if (hugoTrans.pkReadRecords(GETNDB(step), records, batchSize,
- NdbOperation::LM_CommittedRead) != NDBT_OK){
+ if (hugoTrans.pkReadRecords(GETNDB(step), records, batchSize,
+ (NdbOperation::LockMode)lm) != NDBT_OK){
g_info << endl;
return NDBT_FAILED;
}
@@ -1552,14 +1534,23 @@ TESTCASE("PkInsert",
}
TESTCASE("PkRead",
"Verify that we can insert, read and delete from this table using PK"){
+ TC_PROPERTY("LockMode", NdbOperation::LM_Read);
INITIALIZER(runLoadTable);
STEP(runPkRead);
FINALIZER(runClearTable);
}
TESTCASE("PkDirtyRead",
"Verify that we can insert, dirty read and delete from this table using PK"){
+ TC_PROPERTY("LockMode", NdbOperation::LM_Dirty);
INITIALIZER(runLoadTable);
- STEP(runPkDirtyRead);
+ STEP(runPkRead);
+ FINALIZER(runClearTable);
+}
+TESTCASE("PkSimpleRead",
+ "Verify that we can insert, simple read and delete from this table using PK"){
+ TC_PROPERTY("LockMode", NdbOperation::LM_SimpleRead);
+ INITIALIZER(runLoadTable);
+ STEP(runPkRead);
FINALIZER(runClearTable);
}
TESTCASE("PkUpdate",