From 4d5557f70444bcb04b5f719cb7c1731ceacbad14 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 17 Jul 2004 19:31:16 +0200 Subject: [PATCH 01/10] Added new testcase for Bug #4479 testBasic -n MassiveTransaction Inserts as many records as defined in one transaction using loadTable --- ndb/test/include/HugoTransactions.hpp | 3 +- ndb/test/ndbapi/testBasic.cpp | 18 ++++++++-- ndb/test/src/HugoTransactions.cpp | 47 +++++++++++++++++---------- 3 files changed, 48 insertions(+), 20 deletions(-) diff --git a/ndb/test/include/HugoTransactions.hpp b/ndb/test/include/HugoTransactions.hpp index 5ff1fef16bc..3d373652cbc 100644 --- a/ndb/test/include/HugoTransactions.hpp +++ b/ndb/test/include/HugoTransactions.hpp @@ -34,7 +34,8 @@ public: int records, int batch = 512, bool allowConstraintViolation = true, - int doSleep = 0); + int doSleep = 0, + bool oneTrans = false); int scanReadRecords(Ndb*, int records, int abort = 0, diff --git a/ndb/test/ndbapi/testBasic.cpp b/ndb/test/ndbapi/testBasic.cpp index 64dfe492c2c..af25a36dde2 100644 --- a/ndb/test/ndbapi/testBasic.cpp +++ b/ndb/test/ndbapi/testBasic.cpp @@ -29,9 +29,18 @@ * delete should be visible to same transaction * */ +int runLoadTable2(NDBT_Context* ctx, NDBT_Step* step) +{ + int records = ctx->getNumRecords(); + HugoTransactions hugoTrans(*ctx->getTab()); + if (hugoTrans.loadTable(GETNDB(step), records, 512, false, 0, true) != 0){ + return NDBT_FAILED; + } + return NDBT_OK; +} -int runLoadTable(NDBT_Context* ctx, NDBT_Step* step){ - +int runLoadTable(NDBT_Context* ctx, NDBT_Step* step) +{ int records = ctx->getNumRecords(); HugoTransactions hugoTrans(*ctx->getTab()); if (hugoTrans.loadTable(GETNDB(step), records) != 0){ @@ -1255,6 +1264,11 @@ TESTCASE("MassiveRollback2", INITIALIZER(runMassiveRollback2); FINALIZER(runClearTable2); } +TESTCASE("MassiveTransaction", + "Test very large insert transaction"){ + INITIALIZER(runLoadTable2); + FINALIZER(runClearTable2); +} NDBT_TESTSUITE_END(testBasic); int main(int argc, const char** argv){ diff --git a/ndb/test/src/HugoTransactions.cpp b/ndb/test/src/HugoTransactions.cpp index 7f12484ddc8..994ad3284bb 100644 --- a/ndb/test/src/HugoTransactions.cpp +++ b/ndb/test/src/HugoTransactions.cpp @@ -819,12 +819,14 @@ HugoTransactions::loadTable(Ndb* pNdb, int records, int batch, bool allowConstraintViolation, - int doSleep){ + int doSleep, + bool oneTrans){ int check; int retryAttempt = 0; int retryMax = 5; NdbConnection *pTrans; NdbOperation *pOp; + bool first_batch = true; const int org = batch; const int cols = tab.getNoOfColumns(); @@ -833,7 +835,7 @@ HugoTransactions::loadTable(Ndb* pNdb, batch = (batch * 256); // -> 512 -> 65536k per commit batch = batch/bytes; // batch = batch == 0 ? 1 : batch; - + if(batch != org){ g_info << "batch = " << org << " rowsize = " << bytes << " -> rows/commit = " << batch << endl; @@ -841,7 +843,7 @@ HugoTransactions::loadTable(Ndb* pNdb, g_info << "|- Inserting records..." << endl; for (int c=0 ; c= retryMax){ g_info << "Record " << c << " could not be inserted, has retried " << retryAttempt << " times " << endl; @@ -852,19 +854,22 @@ HugoTransactions::loadTable(Ndb* pNdb, if (doSleep > 0) NdbSleep_MilliSleep(doSleep); - pTrans = pNdb->startTransaction(); + if (first_batch || !oneTrans) { + first_batch = false; + pTrans = pNdb->startTransaction(); + + if (pTrans == NULL) { + const NdbError err = pNdb->getNdbError(); - if (pTrans == NULL) { - const NdbError err = pNdb->getNdbError(); - - if (err.status == NdbError::TemporaryError){ - ERR(err); - NdbSleep_MilliSleep(50); - retryAttempt++; - continue; + if (err.status == NdbError::TemporaryError){ + ERR(err); + NdbSleep_MilliSleep(50); + retryAttempt++; + continue; + } + ERR(err); + return NDBT_FAILED; } - ERR(err); - return NDBT_FAILED; } for(int b = 0; b < batch && c+bexecute( Commit ); + if (!oneTrans || (c + batch) >= records) { + closeTrans = true; + check = pTrans->execute( Commit ); + } else { + closeTrans = false; + check = pTrans->execute( NoCommit ); + } if(check == -1 ) { const NdbError err = pTrans->getNdbError(); pNdb->closeTransaction(pTrans); @@ -937,8 +948,10 @@ HugoTransactions::loadTable(Ndb* pNdb, break; } } - else{ - pNdb->closeTransaction(pTrans); + else{ + if (closeTrans) { + pNdb->closeTransaction(pTrans); + } } // Step to next record From abfdb34830c19e45ee6b31c8a9c0534aaecf540f Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Jul 2004 00:23:49 +0200 Subject: [PATCH 02/10] Bug #4479 Ensures that the node doesn't crash by overflowing the UNDO log buffer at local checkpoints. Inserts a real-time break after 512 operations and when low on UNDO log buffer. --- ndb/src/kernel/blocks/dbacc/Dbacc.hpp | 2 + ndb/src/kernel/blocks/dbacc/DbaccMain.cpp | 106 ++++++++++++++++------ 2 files changed, 78 insertions(+), 30 deletions(-) diff --git a/ndb/src/kernel/blocks/dbacc/Dbacc.hpp b/ndb/src/kernel/blocks/dbacc/Dbacc.hpp index 6ba2d083e58..5185e91caac 100644 --- a/ndb/src/kernel/blocks/dbacc/Dbacc.hpp +++ b/ndb/src/kernel/blocks/dbacc/Dbacc.hpp @@ -218,6 +218,7 @@ ndbout << "Ptr: " << ptr.p->word32 << " \tIndex: " << tmp_string << " \tValue: " #define ZREL_FRAG 6 #define ZREL_DIR 7 #define ZREPORT_MEMORY_USAGE 8 +#define ZLCP_OP_WRITE_RT_BREAK 9 /* ------------------------------------------------------------------------- */ /* ERROR CODES */ @@ -1190,6 +1191,7 @@ private: void zpagesize_error(const char* where); void reportMemoryUsage(Signal* signal, int gth); + void lcp_write_op_to_undolog(Signal* signal); // Initialisation diff --git a/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp b/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp index 933ee2cf8e1..ccc1acdd273 100644 --- a/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp +++ b/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp @@ -46,13 +46,17 @@ Dbacc::remainingUndoPages(){ ndbrequire(HeadPage>=TailPage); Uint32 UsedPages = HeadPage - TailPage; - Uint32 Remaining = cundopagesize - UsedPages; + Int32 Remaining = cundopagesize - UsedPages; // There can not be more than cundopagesize remaining - ndbrequire(Remaining<=cundopagesize); - + if (Remaining <= 0){ + // No more undolog, crash node + progError(__LINE__, + ERR_NO_MORE_UNDOLOG, + "There are more than 1Mbyte undolog writes outstanding"); + } return Remaining; -}//Dbacc::remainingUndoPages() +} void Dbacc::updateLastUndoPageIdWritten(Signal* signal, Uint32 aNewValue){ @@ -193,6 +197,17 @@ void Dbacc::execCONTINUEB(Signal* signal) return; } + case ZLCP_OP_WRITE_RT_BREAK: + { + operationRecPtr.i= signal->theData[1]; + fragrecptr.i= signal->theData[2]; + lcpConnectptr.i= signal->theData[3]; + ptrCheckGuard(operationRecPtr, coprecsize, operationrec); + ptrCheckGuard(fragrecptr, cfragmentsize, fragmentrec); + ptrCheckGuard(lcpConnectptr, clcpConnectsize, lcpConnectrec); + lcp_write_op_to_undolog(signal); + return; + } default: ndbrequire(false); break; @@ -7697,32 +7712,70 @@ void Dbacc::execACC_LCPREQ(Signal* signal) fragrecptr.p->lcpMaxOverDirIndex = fragrecptr.p->lastOverIndex; fragrecptr.p->createLcp = ZTRUE; operationRecPtr.i = fragrecptr.p->lockOwnersList; - while (operationRecPtr.i != RNIL) { - jam(); - ptrCheckGuard(operationRecPtr, coprecsize, operationrec); + lcp_write_op_to_undolog(signal); +} - if ((operationRecPtr.p->operation == ZINSERT) || - (operationRecPtr.p->elementIsDisappeared == ZTRUE)){ +void +Dbacc::lcp_write_op_to_undolog(Signal* signal) +{ + bool delay_continueb= false; + Uint32 i, j; + for (i= 0; i < 16; i++) { + jam(); + if (remainingUndoPages() <= ZMIN_UNDO_PAGES_AT_COMMIT) { + jam(); + delay_continueb= true; + break; + } + for (j= 0; j < 32; j++) { + if (operationRecPtr.i == RNIL) { + jam(); + break; + } + jam(); + ptrCheckGuard(operationRecPtr, coprecsize, operationrec); + + if ((operationRecPtr.p->operation == ZINSERT) || + (operationRecPtr.p->elementIsDisappeared == ZTRUE)){ /******************************************************************* * Only log inserts and elements that are marked as dissapeared. * All other operations update the element header and that is handled * when pages are written to disk ********************************************************************/ - undopageptr.i = (cundoposition>>ZUNDOPAGEINDEXBITS) & (cundopagesize-1); - ptrAss(undopageptr, undopage); - theadundoindex = cundoposition & ZUNDOPAGEINDEX_MASK; - tundoindex = theadundoindex + ZUNDOHEADSIZE; + undopageptr.i = (cundoposition>>ZUNDOPAGEINDEXBITS) & (cundopagesize-1); + ptrAss(undopageptr, undopage); + theadundoindex = cundoposition & ZUNDOPAGEINDEX_MASK; + tundoindex = theadundoindex + ZUNDOHEADSIZE; - writeUndoOpInfo(signal);/* THE INFORMATION ABOUT ELEMENT HEADER, STORED*/ - /* IN OP REC, IS WRITTEN AT UNDO PAGES */ - cundoElemIndex = 0;/* DEFAULT VALUE USED BY WRITE_UNDO_HEADER SUBROTINE */ - writeUndoHeader(signal, RNIL, UndoHeader::ZOP_INFO); /* WRITE THE HEAD OF THE UNDO ELEMENT */ - checkUndoPages(signal); /* SEND UNDO PAGE TO DISK WHEN A GROUP OF */ + writeUndoOpInfo(signal);/* THE INFORMATION ABOUT ELEMENT HEADER, STORED*/ + /* IN OP REC, IS WRITTEN AT UNDO PAGES */ + cundoElemIndex = 0;/* DEFAULT VALUE USED BY WRITE_UNDO_HEADER SUBROTINE */ + writeUndoHeader(signal, RNIL, UndoHeader::ZOP_INFO); /* WRITE THE HEAD OF THE UNDO ELEMENT */ + checkUndoPages(signal); /* SEND UNDO PAGE TO DISK WHEN A GROUP OF */ /* UNDO PAGES,CURRENTLY 8, IS FILLED */ - }//if - - operationRecPtr.i = operationRecPtr.p->nextLockOwnerOp; - }//while + } + operationRecPtr.i = operationRecPtr.p->nextLockOwnerOp; + } + if (operationRecPtr.i == RNIL) { + jam(); + break; + } + } + if (operationRecPtr.i != RNIL) { + jam(); + signal->theData[0]= ZLCP_OP_WRITE_RT_BREAK; + signal->theData[1]= operationRecPtr.i; + signal->theData[2]= fragrecptr.i; + signal->theData[3]= lcpConnectptr.i; + if (delay_continueb) { + jam(); + sendSignalWithDelay(cownBlockref, GSN_CONTINUEB, signal, 10, 4); + } else { + jam(); + sendSignal(cownBlockref, GSN_CONTINUEB, signal, 4, JBB); + } + return; + } signal->theData[0] = fragrecptr.p->lcpLqhPtr; sendSignal(lcpConnectptr.p->lcpUserblockref, GSN_ACC_LCPSTARTED, @@ -7735,8 +7788,7 @@ void Dbacc::execACC_LCPREQ(Signal* signal) signal->theData[0] = lcpConnectptr.i; signal->theData[1] = fragrecptr.i; sendSignal(cownBlockref, GSN_ACC_SAVE_PAGES, signal, 2, JBB); - return; -}//Dbacc::execACC_LCPREQ() +} /* ******************--------------------------------------------------------------- */ /* ACC_SAVE_PAGES A GROUP OF PAGES IS ALLOCATED. THE PAGES AND OVERFLOW */ @@ -8595,12 +8647,6 @@ void Dbacc::checkUndoPages(Signal* signal) * RECORDS IN */ Uint16 nextUndoPageId = tundoPageId + 1; - if (nextUndoPageId > (clastUndoPageIdWritten + cundopagesize)){ - // No more undolog, crash node - progError(__LINE__, - ERR_NO_MORE_UNDOLOG, - "There are more than 1Mbyte undolog writes outstanding"); - } updateUndoPositionPage(signal, nextUndoPageId << ZUNDOPAGEINDEXBITS); if ((tundoPageId & (ZWRITE_UNDOPAGESIZE - 1)) == (ZWRITE_UNDOPAGESIZE - 1)) { From d392ff21307626e0b7605ebd3105eb45d2208863 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Jul 2004 12:46:27 +0200 Subject: [PATCH 03/10] Removed an error check from debug mode that gets executed n**2 times in closeTransaction where n is number of signals sent in transaction. n can easily become 250.000 in a large transaction. --- ndb/src/ndbapi/Ndblist.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ndb/src/ndbapi/Ndblist.cpp b/ndb/src/ndbapi/Ndblist.cpp index e557fdc0a5f..a27b911eb07 100644 --- a/ndb/src/ndbapi/Ndblist.cpp +++ b/ndb/src/ndbapi/Ndblist.cpp @@ -592,13 +592,14 @@ Ndb::releaseSignal(NdbApiSignal* aSignal) #if defined VM_TRACE // Check that signal is not null assert(aSignal != NULL); - +#if 0 // Check that signal is not already in list NdbApiSignal* tmp = theSignalIdleList; while (tmp != NULL){ assert(tmp != aSignal); tmp = tmp->next(); } +#endif #endif creleaseSignals++; aSignal->next(theSignalIdleList); From 979126224b4a04a548e7663c72e4212de6121f20 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Jul 2004 16:08:19 +0300 Subject: [PATCH 04/10] ha_innodb.cc: ha_innobase::create(): pass the query string as UTF-8 to row_table_add_foreign_constraints() (Bug #4649) sql/ha_innodb.cc: ha_innobase::create(): pass the query string as UTF-8 to row_table_add_foreign_constraints() (Bug #4649) --- sql/ha_innodb.cc | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index c06448647d5..a8309d4f32c 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -3642,11 +3642,19 @@ ha_innobase::create( } if (current_thd->query != NULL) { - - error = row_table_add_foreign_constraints(trx, - current_thd->query, norm_name); - error = convert_error_code_to_mysql(error, NULL); + LEX_STRING q; + if (thd->convert_string(&q, system_charset_info, + current_thd->query, + current_thd->query_length, + current_thd->charset())) { + error = HA_ERR_OUT_OF_MEM; + } else { + error = row_table_add_foreign_constraints(trx, + q.str, norm_name); + + error = convert_error_code_to_mysql(error, NULL); + } if (error) { innobase_commit_low(trx); From c4149d25ef0c14753f065f6eef937290c71ab628 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Jul 2004 17:04:56 +0300 Subject: [PATCH 05/10] fil0fil.c: Restore accidentally deleted comment of fil_create_directory_for_tablename() innobase/fil/fil0fil.c: Restore accidentally deleted comment of fil_create_directory_for_tablename() --- innobase/fil/fil0fil.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/innobase/fil/fil0fil.c b/innobase/fil/fil0fil.c index 59fbd6f785d..885738deae2 100644 --- a/innobase/fil/fil0fil.c +++ b/innobase/fil/fil0fil.c @@ -1513,6 +1513,8 @@ fil_decr_pending_ibuf_merges( mutex_exit(&(system->mutex)); } +/************************************************************ +Creates the database directory for a table if it does not exist yet. */ static void fil_create_directory_for_tablename( From 0ba0f4a9aa36a0872f2f9694aef605ab480d205b Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 31 Jul 2004 12:00:12 +0200 Subject: [PATCH 06/10] Bug fix for alter table and auto_increment --- mysql-test/r/ndb_alter_table.result | 2 +- mysql-test/r/ndb_basic.result | 16 ++++++++++------ mysql-test/r/ndb_lock.result | 5 +++++ mysql-test/t/ndb_alter_table.test | 2 +- mysql-test/t/ndb_basic.test | 13 +++++++------ mysql-test/t/ndb_lock.test | 7 +++++-- ndb/src/ndbapi/NdbDictionaryImpl.cpp | 2 +- 7 files changed, 30 insertions(+), 17 deletions(-) diff --git a/mysql-test/r/ndb_alter_table.result b/mysql-test/r/ndb_alter_table.result index 6cc6a89d5ad..ce3c96b6f39 100644 --- a/mysql-test/r/ndb_alter_table.result +++ b/mysql-test/r/ndb_alter_table.result @@ -15,7 +15,7 @@ col2 varchar(30) not null, col3 varchar (20) not null, col4 varchar(4) not null, col5 enum('PENDING', 'ACTIVE', 'DISABLED') not null, -col6 int not null, to_be_deleted int); +col6 int not null, to_be_deleted int) ENGINE=ndbcluster; insert into t1 values (2,4,3,5,"PENDING",1,7); alter table t1 add column col4_5 varchar(20) not null after col4, diff --git a/mysql-test/r/ndb_basic.result b/mysql-test/r/ndb_basic.result index b7479d9543d..3dc60b17754 100644 --- a/mysql-test/r/ndb_basic.result +++ b/mysql-test/r/ndb_basic.result @@ -6,20 +6,20 @@ attr2 INT, attr3 VARCHAR(10) ) ENGINE=ndbcluster; INSERT INTO t1 VALUES (9410,9412, NULL, '9412'), (9411,9413, 17, '9413'); -SELECT pk1 FROM t1; +SELECT pk1 FROM t1 ORDER BY pk1; pk1 9410 9411 -SELECT * FROM t1; +SELECT * FROM t1 ORDER BY pk1; pk1 attr1 attr2 attr3 9410 9412 NULL 9412 9411 9413 17 9413 -SELECT t1.* FROM t1; +SELECT t1.* FROM t1 ORDER BY pk1; pk1 attr1 attr2 attr3 9410 9412 NULL 9412 9411 9413 17 9413 UPDATE t1 SET attr1=1 WHERE pk1=9410; -SELECT * FROM t1; +SELECT * FROM t1 ORDER BY pk1; pk1 attr1 attr2 attr3 9410 1 NULL 9412 9411 9413 17 9413 @@ -115,13 +115,17 @@ SELECT * FROM t1; id id2 1234 7890 DELETE FROM t1; -INSERT INTO t1 values(3456, 7890), (3456, 7890), (3456, 7890); -SELECT * FROM t1; +INSERT INTO t1 values(3456, 7890), (3456, 7890), (3456, 7890), (3454, 7890); +SELECT * FROM t1 ORDER BY id; id id2 +3454 7890 3456 7890 3456 7890 3456 7890 DELETE FROM t1 WHERE id = 3456; +SELECT * FROM t1 ORDER BY id; +id id2 +3454 7890 DROP TABLE t1; CREATE TABLE t1 ( pk1 INT NOT NULL PRIMARY KEY, diff --git a/mysql-test/r/ndb_lock.result b/mysql-test/r/ndb_lock.result index 505eb054afd..56661913e22 100644 --- a/mysql-test/r/ndb_lock.result +++ b/mysql-test/r/ndb_lock.result @@ -11,6 +11,11 @@ x y 2 two start transaction; insert into t1 values (3,'three'); +select * from t1 order by x; +x y +1 one +2 two +3 three start transaction; select * from t1 order by x; x y diff --git a/mysql-test/t/ndb_alter_table.test b/mysql-test/t/ndb_alter_table.test index f95aa82b7cc..cc92843eba7 100644 --- a/mysql-test/t/ndb_alter_table.test +++ b/mysql-test/t/ndb_alter_table.test @@ -29,7 +29,7 @@ col2 varchar(30) not null, col3 varchar (20) not null, col4 varchar(4) not null, col5 enum('PENDING', 'ACTIVE', 'DISABLED') not null, -col6 int not null, to_be_deleted int); +col6 int not null, to_be_deleted int) ENGINE=ndbcluster; insert into t1 values (2,4,3,5,"PENDING",1,7); alter table t1 add column col4_5 varchar(20) not null after col4, diff --git a/mysql-test/t/ndb_basic.test b/mysql-test/t/ndb_basic.test index 08fbf913155..c3c296113c3 100644 --- a/mysql-test/t/ndb_basic.test +++ b/mysql-test/t/ndb_basic.test @@ -21,13 +21,13 @@ CREATE TABLE t1 ( INSERT INTO t1 VALUES (9410,9412, NULL, '9412'), (9411,9413, 17, '9413'); -SELECT pk1 FROM t1; -SELECT * FROM t1; -SELECT t1.* FROM t1; +SELECT pk1 FROM t1 ORDER BY pk1; +SELECT * FROM t1 ORDER BY pk1; +SELECT t1.* FROM t1 ORDER BY pk1; # Update on record by primary key UPDATE t1 SET attr1=1 WHERE pk1=9410; -SELECT * FROM t1; +SELECT * FROM t1 ORDER BY pk1; # Update primary key UPDATE t1 SET pk1=2 WHERE attr1=1; @@ -85,9 +85,10 @@ UPDATE t1 SET id=1234 WHERE id2=7890; SELECT * FROM t1; DELETE FROM t1; -INSERT INTO t1 values(3456, 7890), (3456, 7890), (3456, 7890); -SELECT * FROM t1; +INSERT INTO t1 values(3456, 7890), (3456, 7890), (3456, 7890), (3454, 7890); +SELECT * FROM t1 ORDER BY id; DELETE FROM t1 WHERE id = 3456; +SELECT * FROM t1 ORDER BY id; DROP TABLE t1; diff --git a/mysql-test/t/ndb_lock.test b/mysql-test/t/ndb_lock.test index 852d641ed54..c0389dced44 100644 --- a/mysql-test/t/ndb_lock.test +++ b/mysql-test/t/ndb_lock.test @@ -25,10 +25,13 @@ connection con2; select * from t1 order by x; connection con1; -start transaction; insert into t1 values (3,'three'); +start transaction; +insert into t1 values (3,'three'); +select * from t1 order by x; connection con2; -start transaction; select * from t1 order by x; +start transaction; +select * from t1 order by x; connection con1; commit; diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/ndb/src/ndbapi/NdbDictionaryImpl.cpp index f1091ad5fb3..004ad531b65 100644 --- a/ndb/src/ndbapi/NdbDictionaryImpl.cpp +++ b/ndb/src/ndbapi/NdbDictionaryImpl.cpp @@ -1452,7 +1452,7 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb, alterTable(&tSignal, ptr) : createTable(&tSignal, ptr); - if (haveAutoIncrement) { + if (!alter && haveAutoIncrement) { // if (!ndb.setAutoIncrementValue(impl.m_internalName.c_str(), autoIncrementValue)) { if (!ndb.setAutoIncrementValue(impl.m_externalName.c_str(), autoIncrementValue)) { m_error.code = 4336; From 7bee058b246de7fbc9827514601e6027b9e041b0 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 31 Jul 2004 15:53:27 +0200 Subject: [PATCH 07/10] Bitmask.hpp: compile fix for gcc-3.4.x ndb/include/util/Bitmask.hpp: compile fix for gcc-3.4.x --- ndb/include/util/Bitmask.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ndb/include/util/Bitmask.hpp b/ndb/include/util/Bitmask.hpp index 7435e351ddc..ee0140a2099 100644 --- a/ndb/include/util/Bitmask.hpp +++ b/ndb/include/util/Bitmask.hpp @@ -762,7 +762,7 @@ BitmaskPOD::overlaps(BitmaskPOD that) template class Bitmask : public BitmaskPOD { public: - Bitmask() { clear();} + Bitmask() { this->clear();} }; #endif From 76c6b740b9fba90b18e06ea7c53444e3f93dbad5 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 1 Aug 2004 09:07:08 +0200 Subject: [PATCH 08/10] New file missing in source distr. --- ndb/include/Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/ndb/include/Makefile.am b/ndb/include/Makefile.am index 2565a78238b..b1b7951f216 100644 --- a/ndb/include/Makefile.am +++ b/ndb/include/Makefile.am @@ -23,6 +23,7 @@ ndbapi/NdbReceiver.hpp \ ndbapi/NdbResultSet.hpp \ ndbapi/NdbScanFilter.hpp \ ndbapi/NdbScanOperation.hpp \ +ndbapi/NdbIndexScanOperation.hpp \ ndbapi/ndberror.h mgmapiinclude_HEADERS = \ From 679e388f2296264cacfea39a54075f4c253e51f9 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 1 Aug 2004 13:41:13 +0200 Subject: [PATCH 09/10] Fix uninit var. Fix error printout ndb/src/kernel/blocks/dbtc/Dbtc.hpp: Fix init scan frag record ndb/src/mgmsrv/main.cpp: Fix error printout --- ndb/src/kernel/blocks/dbtc/Dbtc.hpp | 7 ++++++- ndb/src/mgmsrv/main.cpp | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ndb/src/kernel/blocks/dbtc/Dbtc.hpp b/ndb/src/kernel/blocks/dbtc/Dbtc.hpp index e7f370e9879..095ba9b0bbe 100644 --- a/ndb/src/kernel/blocks/dbtc/Dbtc.hpp +++ b/ndb/src/kernel/blocks/dbtc/Dbtc.hpp @@ -998,7 +998,12 @@ public: * It will receive max 16 tuples in each request */ struct ScanFragRec { - ScanFragRec(){} + ScanFragRec(){ + stopFragTimer(); + lqhBlockref = 0; + scanFragState = IDLE; + scanRec = RNIL; + } /** * ScanFragState * WAIT_GET_PRIMCONF : Waiting for DIGETPRIMCONF when starting a new diff --git a/ndb/src/mgmsrv/main.cpp b/ndb/src/mgmsrv/main.cpp index c546d142810..0bbf042fbd6 100644 --- a/ndb/src/mgmsrv/main.cpp +++ b/ndb/src/mgmsrv/main.cpp @@ -187,7 +187,7 @@ NDB_MAIN(mgmsrv){ "Please check if the port is already used,\n" "(perhaps a mgmtsrvr is already running),\n" "and if you are executing on the correct computer", - glob.interface_name, glob.port); + (glob.interface_name ? glob.interface_name : "*"), glob.port); goto error_end; } free(glob.interface_name); From 2919d4426087834f1d550d7172460f42b5e76c49 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 1 Aug 2004 14:12:45 +0200 Subject: [PATCH 10/10] Fix mysql-test-run w.r.t NDB "export A=var" is bash feature instead do "A=var; export A" --- mysql-test/mysql-test-run.sh | 6 ++++-- mysql-test/ndb/ndbcluster.sh | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 853b6302f86..0c46fa17e1f 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -1450,9 +1450,11 @@ then then echo "Starting ndbcluster" ./ndb/ndbcluster --port-base=$NDBCLUSTER_PORT --small --diskless --initial --data-dir=$MYSQL_TEST_DIR/var || exit 1 - export NDB_CONNECTSTRING="host=localhost:$NDBCLUSTER_PORT" + NDB_CONNECTSTRING="host=localhost:$NDBCLUSTER_PORT" + export NDB_CONNECTSTRING else - export NDB_CONNECTSTRING="$USE_RUNNING_NDBCLUSTER" + NDB_CONNECTSTRING="$USE_RUNNING_NDBCLUSTER" + export NDB_CONNECTSTRING echo "Using ndbcluster at $NDB_CONNECTSTRING" fi fi diff --git a/mysql-test/ndb/ndbcluster.sh b/mysql-test/ndb/ndbcluster.sh index 3c5c715dde0..8b53c70fb72 100644 --- a/mysql-test/ndb/ndbcluster.sh +++ b/mysql-test/ndb/ndbcluster.sh @@ -86,7 +86,6 @@ fs_name_1=$fs_ndb/node-1-fs fs_name_2=$fs_ndb/node-2-fs NDB_HOME= -export NDB_CONNECTSTRING if [ ! -x $fsdir ]; then echo "$fsdir missing" exit 1 @@ -102,7 +101,8 @@ fi ndb_host="localhost" ndb_mgmd_port=$port_base -export NDB_CONNECTSTRING="host=$ndb_host:$ndb_mgmd_port" +NDB_CONNECTSTRING="host=$ndb_host:$ndb_mgmd_port" +export NDB_CONNECTSTRING start_default_ndbcluster() {