Below is the list of changes that have just been committed into a local
4.1 repository of jonas. When jonas does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.2269 05/05/26 07:21:05 joreland@stripped +5 -0
ndb - Testcase for bug#10669
--database option to hugo tools
ndb/test/tools/hugoScanUpdate.cpp
1.7 05/05/26 07:21:03 joreland@stripped +5 -3
Add --database=<name> to hugo tools
ndb/test/tools/hugoScanRead.cpp
1.7 05/05/26 07:21:03 joreland@stripped +4 -3
Add --database=<name> to hugo tools
ndb/test/tools/hugoPkUpdate.cpp
1.7 05/05/26 07:21:03 joreland@stripped +4 -3
Add --database=<name> to hugo tools
ndb/test/tools/hugoLoad.cpp
1.4 05/05/26 07:21:03 joreland@stripped +4 -2
Add --database=<name> to hugo tools
ndb/test/ndbapi/testNdbApi.cpp
1.10 05/05/26 07:21:03 joreland@stripped +81 -0
Testcase for bug#10669
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: joreland
# Host: eel.ndb.mysql.com.ndb.mysql.com
# Root: /home/jonas/src/mysql-4.1
--- 1.9/ndb/test/ndbapi/testNdbApi.cpp Mon Dec 20 12:36:03 2004
+++ 1.10/ndb/test/ndbapi/testNdbApi.cpp Thu May 26 07:21:03 2005
@@ -877,6 +877,81 @@
return result;
}
+
+int runReadWithoutGetValue(NDBT_Context* ctx, NDBT_Step* step){
+ int result = NDBT_OK;
+ const NdbDictionary::Table* pTab = ctx->getTab();
+
+ HugoOperations hugoOps(*pTab);
+
+ Ndb* pNdb = new Ndb(&ctx->m_cluster_connection, "TEST_DB");
+ if (pNdb == NULL){
+ ndbout << "pNdb == NULL" << endl;
+ return NDBT_FAILED;
+ }
+ if (pNdb->init()){
+ ERR(pNdb->getNdbError());
+ delete pNdb;
+ return NDBT_FAILED;
+ }
+
+ for(Uint32 cm= 0; cm < 2; cm++)
+ {
+ for(Uint32 lm= 0; lm <= NdbOperation::LM_CommittedRead; lm++)
+ {
+ NdbConnection* pCon = pNdb->startTransaction();
+ if (pCon == NULL){
+ pNdb->closeTransaction(pCon);
+ delete pNdb;
+ return NDBT_FAILED;
+ }
+
+ NdbOperation* pOp = pCon->getNdbOperation(pTab->getName());
+ if (pOp == NULL){
+ ERR(pCon->getNdbError());
+ pNdb->closeTransaction(pCon);
+ delete pNdb;
+ return NDBT_FAILED;
+ }
+
+ if (pOp->readTuple((NdbOperation::LockMode)lm) != 0){
+ pNdb->closeTransaction(pCon);
+ ERR(pOp->getNdbError());
+ delete pNdb;
+ return NDBT_FAILED;
+ }
+
+ for(int a = 0; a<pTab->getNoOfColumns(); a++){
+ if (pTab->getColumn(a)->getPrimaryKey() == true){
+ if(hugoOps.equalForAttr(pOp, a, 1) != 0){
+ ERR(pCon->getNdbError());
+ pNdb->closeTransaction(pCon);
+ delete pNdb;
+ return NDBT_FAILED;
+ }
+ }
+ }
+
+ // Dont' call any getValues
+
+ // Execute should work
+ int check = pCon->execute(cm == 0 ? NoCommit : Commit);
+ if (check == 0){
+ ndbout << "execute worked" << endl;
+ } else {
+ ERR(pCon->getNdbError());
+ result = NDBT_FAILED;
+ }
+
+ pNdb->closeTransaction(pCon);
+ }
+ }
+ delete pNdb;
+
+ return result;
+}
+
+
int runCheckGetNdbErrorOperation(NDBT_Context* ctx, NDBT_Step* step){
int result = NDBT_OK;
const NdbDictionary::Table* pTab = ctx->getTab();
@@ -1010,6 +1085,12 @@
TESTCASE("NdbErrorOperation",
"Test that NdbErrorOperation is properly set"){
INITIALIZER(runCheckGetNdbErrorOperation);
+}
+TESTCASE("ReadWithoutGetValue",
+ "Test that it's possible to perform read wo/ getvalue's\n"){
+ INITIALIZER(runLoadTable);
+ INITIALIZER(runReadWithoutGetValue);
+ FINALIZER(runClearTable);
}
NDBT_TESTSUITE_END(testNdbApi);
--- 1.3/ndb/test/tools/hugoLoad.cpp Wed Sep 15 11:43:35 2004
+++ 1.4/ndb/test/tools/hugoLoad.cpp Thu May 26 07:21:03 2005
@@ -30,10 +30,12 @@
const char* _tabname = NULL;
int _help = 0;
int _batch = 512;
-
+ const char* db = 0;
+
struct getargs args[] = {
{ "records", 'r', arg_integer, &_records, "Number of records", "recs" },
{ "batch", 'b', arg_integer, &_batch, "Number of operations in each transaction", "batch" },
+ { "database", 'd', arg_string, &db, "Database", "" },
{ "usage", '?', arg_flag, &_help, "Print help", "" }
};
int num_args = sizeof(args) / sizeof(args[0]);
@@ -54,7 +56,7 @@
_tabname = argv[optind];
// Connect to Ndb
- Ndb MyNdb( "TEST_DB" );
+ Ndb MyNdb( db ? db : "TEST_DB" );
if(MyNdb.init() != 0){
ERR(MyNdb.getNdbError());
--- 1.6/ndb/test/tools/hugoPkUpdate.cpp Wed Sep 15 11:43:36 2004
+++ 1.7/ndb/test/tools/hugoPkUpdate.cpp Thu May 26 07:21:03 2005
@@ -33,7 +33,7 @@
int _loops = 1;
int _abort = 0;
int _batch = 0;
- const char* _tabname = NULL;
+ const char* _tabname = NULL, *db = 0;
int _help = 0;
struct getargs args[] = {
@@ -41,7 +41,8 @@
{ "loops", 'l', arg_integer, &_loops, "number of times to run this program(0=infinite loop)", "loops" },
// { "batch", 'b', arg_integer, &_batch, "batch value", "batch" },
{ "records", 'r', arg_integer, &_records, "Number of records", "records" },
- { "usage", '?', arg_flag, &_help, "Print help", "" }
+ { "usage", '?', arg_flag, &_help, "Print help", "" },
+ { "database", 'd', arg_string, &db, "Database", "" }
};
int num_args = sizeof(args) / sizeof(args[0]);
int optind = 0;
@@ -57,7 +58,7 @@
_tabname = argv[optind];
// Connect to Ndb
- Ndb MyNdb( "TEST_DB" );
+ Ndb MyNdb( db ? db : "TEST_DB" );
if(MyNdb.init() != 0){
ERR(MyNdb.getNdbError());
--- 1.6/ndb/test/tools/hugoScanRead.cpp Thu Nov 18 20:54:05 2004
+++ 1.7/ndb/test/tools/hugoScanRead.cpp Thu May 26 07:21:03 2005
@@ -33,7 +33,7 @@
int _loops = 1;
int _abort = 0;
int _parallelism = 1;
- const char* _tabname = NULL;
+ const char* _tabname = NULL, *db = 0;
int _help = 0;
int lock = NdbOperation::LM_Read;
int sorted = 0;
@@ -45,7 +45,8 @@
{ "records", 'r', arg_integer, &_records, "Number of records", "recs" },
{ "usage", '?', arg_flag, &_help, "Print help", "" },
{ "lock", 'm', arg_integer, &lock, "lock mode", "" },
- { "sorted", 's', arg_flag, &sorted, "sorted", "" }
+ { "sorted", 's', arg_flag, &sorted, "sorted", "" },
+ { "database", 'd', arg_string, &db, "Database", "" }
};
int num_args = sizeof(args) / sizeof(args[0]);
int optind = 0;
@@ -61,7 +62,7 @@
_tabname = argv[optind];
// Connect to Ndb
- Ndb MyNdb( "TEST_DB" );
+ Ndb MyNdb( db ? db : "TEST_DB" );
if(MyNdb.init() != 0){
ERR(MyNdb.getNdbError());
--- 1.6/ndb/test/tools/hugoScanUpdate.cpp Wed Sep 15 11:43:36 2004
+++ 1.7/ndb/test/tools/hugoScanUpdate.cpp Thu May 26 07:21:03 2005
@@ -33,7 +33,7 @@
int _loops = 1;
int _parallelism = 1;
int _ver2 = 0;
- const char* _tabname = NULL;
+ const char* _tabname = NULL, *db = 0;
int _help = 0;
struct getargs args[] = {
@@ -42,7 +42,8 @@
{ "records", 'r', arg_integer, &_records, "Number of records", "recs" },
{ "ver2", '2', arg_flag, &_ver2, "Use version 2 of scanUpdateRecords", "" },
{ "ver2", '1', arg_negative_flag, &_ver2, "Use version 1 of scanUpdateRecords (default)", "" },
- { "usage", '?', arg_flag, &_help, "Print help", "" }
+ { "usage", '?', arg_flag, &_help, "Print help", "" },
+ { "database", 'd', arg_string, &db, "Database", "" }
};
int num_args = sizeof(args) / sizeof(args[0]);
int optind = 0;
@@ -58,7 +59,7 @@
_tabname = argv[optind];
// Connect to Ndb
- Ndb MyNdb( "TEST_DB" );
+ Ndb MyNdb( db ? db : "TEST_DB" );
if(MyNdb.init() != 0){
ERR(MyNdb.getNdbError());
@@ -95,6 +96,7 @@
return NDBT_ProgramExit(NDBT_FAILED);
}
i++;
+ //NdbSleep_MilliSleep(300);
}
return NDBT_ProgramExit(NDBT_OK);
| Thread |
|---|
| • bk commit into 4.1 tree (joreland:1.2269) BUG#10669 | jonas.oreland | 26 May |