From 48cce6198863c6157b979df501293433285a6705 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 15 Sep 2004 10:46:20 +0000 Subject: [PATCH 1/5] fixed bug in bank --- ndb/test/ndbapi/bank/Bank.cpp | 51 ++++++++++++++++++++++------------- 1 file changed, 32 insertions(+), 19 deletions(-) diff --git a/ndb/test/ndbapi/bank/Bank.cpp b/ndb/test/ndbapi/bank/Bank.cpp index 7a2c5b057a1..4581d1a9842 100644 --- a/ndb/test/ndbapi/bank/Bank.cpp +++ b/ndb/test/ndbapi/bank/Bank.cpp @@ -2097,47 +2097,50 @@ int Bank::increaseSystemValue(SystemValueId sysValId, Uint64 &value){ * */ + DBUG_ENTER("Bank::increaseSystemValue"); + int check; NdbConnection* pTrans = m_ndb.startTransaction(); if (pTrans == NULL){ ERR(m_ndb.getNdbError()); - return NDBT_FAILED; + DBUG_RETURN(NDBT_FAILED); } NdbOperation* pOp = pTrans->getNdbOperation("SYSTEM_VALUES"); if (pOp == NULL) { ERR(pTrans->getNdbError()); m_ndb.closeTransaction(pTrans); - return NDBT_FAILED; + DBUG_RETURN(NDBT_FAILED); } check = pOp->readTupleExclusive(); + // check = pOp->readTuple(); if( check == -1 ) { ERR(pTrans->getNdbError()); m_ndb.closeTransaction(pTrans); - return NDBT_FAILED; + DBUG_RETURN(NDBT_FAILED); } check = pOp->equal("SYSTEM_VALUES_ID", sysValId); if( check == -1 ) { ERR(pTrans->getNdbError()); m_ndb.closeTransaction(pTrans); - return NDBT_FAILED; + DBUG_RETURN(NDBT_FAILED); } NdbRecAttr* valueRec = pOp->getValue("VALUE"); if( valueRec ==NULL ) { ERR(pTrans->getNdbError()); m_ndb.closeTransaction(pTrans); - return NDBT_FAILED; + DBUG_RETURN(NDBT_FAILED); } check = pTrans->execute(NoCommit); if( check == -1 ) { ERR(pTrans->getNdbError()); m_ndb.closeTransaction(pTrans); - return NDBT_FAILED; + DBUG_RETURN(NDBT_FAILED); } value = valueRec->u_64_value(); @@ -2147,49 +2150,56 @@ int Bank::increaseSystemValue(SystemValueId sysValId, Uint64 &value){ if (pOp2 == NULL) { ERR(pTrans->getNdbError()); m_ndb.closeTransaction(pTrans); - return NDBT_FAILED; + DBUG_RETURN(NDBT_FAILED); } check = pOp2->updateTuple(); if( check == -1 ) { ERR(pTrans->getNdbError()); m_ndb.closeTransaction(pTrans); - return NDBT_FAILED; + DBUG_RETURN(NDBT_FAILED); } check = pOp2->equal("SYSTEM_VALUES_ID", sysValId); if( check == -1 ) { ERR(pTrans->getNdbError()); m_ndb.closeTransaction(pTrans); - return NDBT_FAILED; + DBUG_RETURN(NDBT_FAILED); } check = pOp2->setValue("VALUE", value); if( check == -1 ) { ERR(pTrans->getNdbError()); m_ndb.closeTransaction(pTrans); - return NDBT_FAILED; + DBUG_RETURN(NDBT_FAILED); + } + + check = pTrans->execute(NoCommit); + if( check == -1 ) { + ERR(pTrans->getNdbError()); + m_ndb.closeTransaction(pTrans); + DBUG_RETURN(NDBT_FAILED); } NdbOperation* pOp3 = pTrans->getNdbOperation("SYSTEM_VALUES"); if (pOp3 == NULL) { ERR(pTrans->getNdbError()); m_ndb.closeTransaction(pTrans); - return NDBT_FAILED; + DBUG_RETURN(NDBT_FAILED); } check = pOp3->readTuple(); if( check == -1 ) { ERR(pTrans->getNdbError()); m_ndb.closeTransaction(pTrans); - return NDBT_FAILED; + DBUG_RETURN(NDBT_FAILED); } check = pOp3->equal("SYSTEM_VALUES_ID", sysValId); if( check == -1 ) { ERR(pTrans->getNdbError()); m_ndb.closeTransaction(pTrans); - return NDBT_FAILED; + DBUG_RETURN(NDBT_FAILED); } // Read new value @@ -2197,28 +2207,31 @@ int Bank::increaseSystemValue(SystemValueId sysValId, Uint64 &value){ if( valueNewRec ==NULL ) { ERR(pTrans->getNdbError()); m_ndb.closeTransaction(pTrans); - return NDBT_FAILED; + DBUG_RETURN(NDBT_FAILED); } check = pTrans->execute(Commit); if( check == -1 ) { ERR(pTrans->getNdbError()); m_ndb.closeTransaction(pTrans); - return NDBT_FAILED; + DBUG_RETURN(NDBT_FAILED); } // Check that value updated equals the value we read after the update if (valueNewRec->u_64_value() != value){ + + printf("value actual=%lld\n", valueNewRec->u_64_value()); + printf("value expected=%lld actual=%lld\n", value, valueNewRec->u_64_value()); + + DBUG_PRINT("info", ("value expected=%ld actual=%ld", value, valueNewRec->u_64_value())); g_err << "getNextTransactionId: value was not updated" << endl; m_ndb.closeTransaction(pTrans); - return NDBT_FAILED; + DBUG_RETURN(NDBT_FAILED); } m_ndb.closeTransaction(pTrans); - - - return 0; + DBUG_RETURN(0); } int Bank::increaseSystemValue2(SystemValueId sysValId, Uint64 &value){ From 574fcc2e5241207fdefd6921d48c9a2f17a0aa39 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 15 Sep 2004 15:17:16 +0200 Subject: [PATCH 2/5] New test prg, testLcp ndb/test/ndbapi/Makefile.am: New test prg --- ndb/test/ndbapi/Makefile.am | 3 +- ndb/test/ndbapi/testLcp.cpp | 324 ++++++++++++++++++++++++++++++++++++ 2 files changed, 326 insertions(+), 1 deletion(-) create mode 100644 ndb/test/ndbapi/testLcp.cpp diff --git a/ndb/test/ndbapi/Makefile.am b/ndb/test/ndbapi/Makefile.am index 95fcf621e89..787589dd9b6 100644 --- a/ndb/test/ndbapi/Makefile.am +++ b/ndb/test/ndbapi/Makefile.am @@ -30,7 +30,7 @@ testSystemRestart \ testTimeout \ testTransactions \ testDeadlock \ -test_event ndbapi_slow_select testReadPerf +test_event ndbapi_slow_select testReadPerf testLcp #flexTimedAsynch #testBlobs @@ -68,6 +68,7 @@ testDeadlock_SOURCES = testDeadlock.cpp test_event_SOURCES = test_event.cpp ndbapi_slow_select_SOURCES = slow_select.cpp testReadPerf_SOURCES = testReadPerf.cpp +testLcp_SOURCES = testLcp.cpp INCLUDES_LOC = -I$(top_srcdir)/ndb/include/kernel diff --git a/ndb/test/ndbapi/testLcp.cpp b/ndb/test/ndbapi/testLcp.cpp new file mode 100644 index 00000000000..493123ffa4a --- /dev/null +++ b/ndb/test/ndbapi/testLcp.cpp @@ -0,0 +1,324 @@ + +#include +#include +#include +#include +#include +#include + +struct CASE +{ + bool start_row; + bool end_row; + bool curr_row; + const char * op1; + const char * op2; + int val; +}; + +static CASE g_ops[] = +{ + { false, true, false, "INSERT", 0, 0 }, + { false, true, false, "INSERT", "UPDATE", 0 }, + { false, false, false, "INSERT", "DELETE", 0 }, + { true, true, false, "UPDATE", 0, 0 }, + { true, true, false, "UPDATE", "UPDATE", 0 }, + { true, false, false, "UPDATE", "DELETE", 0 }, + { true, false, false, "DELETE", 0, 0 }, + { true, true, false, "DELETE", "INSERT", 0 } +}; +const size_t OP_COUNT = (sizeof(g_ops)/sizeof(g_ops[0])); + +static Ndb* g_ndb = 0; +static CASE* g_cases; +static HugoOperations* g_hugo_ops; + +static int g_rows = 1000; +static int g_setup_tables = 1; +static const char * g_tablename = "T1"; +static const NdbDictionary::Table* g_table = 0; +static NdbRestarter g_restarter; + +static int init_ndb(int argc, char** argv); +static int parse_args(int argc, char** argv); +static int connect_ndb(); +static int drop_all_tables(); +static int load_table(); +static int pause_lcp(); +static int do_op(int row); +static int continue_lcp(int error); +static int commit(); +static int restart(); +static int validate(); + +#define require(x) { bool b = x; if(!b){g_err << __LINE__ << endl; abort();}} + +int +main(int argc, char ** argv){ + + require(!init_ndb(argc, argv)); + require(!parse_args(argc, argv)); + require(!connect_ndb()); + + if(g_setup_tables){ + require(!drop_all_tables()); + + if(NDBT_Tables::createTable(g_ndb, g_tablename) != 0){ + exit(-1); + } + } + + g_table = g_ndb->getDictionary()->getTable(g_tablename); + if(g_table == 0){ + g_err << "Failed to retreive table: " << g_tablename << endl; + exit(-1); + } + require(g_hugo_ops = new HugoOperations(* g_table)); + require(!g_hugo_ops->startTransaction(g_ndb)); + + g_cases= new CASE[g_rows]; + require(!load_table()); + + g_info << "Performing all ops wo/ inteference of LCP" << endl; + + g_info << "Testing pre LCP operations, ZLCP_OP_WRITE_RT_BREAK" << endl; + g_info << " where ZLCP_OP_WRITE_RT_BREAK is finished before SAVE_PAGES" + << endl; + require(!pause_lcp()); + for(size_t j = 0; jinit(); + if(g_ndb->waitUntilReady(30) == 0){ + int args[] = { DumpStateOrd::DihMaxTimeBetweenLCP }; + return g_restarter.dumpStateAllNodes(args, 1); + } + return -1; +} + +static int disconnect_ndb() +{ + delete g_ndb; + g_ndb = 0; + g_table = 0; + return 0; +} + +static int drop_all_tables() +{ + NdbDictionary::Dictionary * dict = g_ndb->getDictionary(); + require(dict); + + BaseString db = g_ndb->getDatabaseName(); + BaseString schema = g_ndb->getSchemaName(); + + NdbDictionary::Dictionary::List list; + if (dict->listObjects(list, NdbDictionary::Object::TypeUndefined) == -1){ + g_err << "Failed to list tables: " << endl + << dict->getNdbError() << endl; + return -1; + } + for (unsigned i = 0; i < list.count; i++) { + NdbDictionary::Dictionary::List::Element& elt = list.elements[i]; + switch (elt.type) { + case NdbDictionary::Object::SystemTable: + case NdbDictionary::Object::UserTable: + g_ndb->setDatabaseName(elt.database); + g_ndb->setSchemaName(elt.schema); + if(dict->dropTable(elt.name) != 0){ + g_err << "Failed to drop table: " + << elt.database << "/" << elt.schema << "/" << elt.name <getNdbError() << endl; + return -1; + } + break; + case NdbDictionary::Object::UniqueHashIndex: + case NdbDictionary::Object::OrderedIndex: + case NdbDictionary::Object::HashIndexTrigger: + case NdbDictionary::Object::IndexTrigger: + case NdbDictionary::Object::SubscriptionTrigger: + case NdbDictionary::Object::ReadOnlyConstraint: + case NdbDictionary::Object::Tablespace: + case NdbDictionary::Object::LogfileGroup: + case NdbDictionary::Object::Datafile: + case NdbDictionary::Object::Undofile: + default: + break; + } + } + + g_ndb->setDatabaseName(db.c_str()); + g_ndb->setSchemaName(schema.c_str()); + + return 0; +} + +static int load_table() +{ + UtilTransactions clear(* g_table); + require(!clear.clearTable(g_ndb)); + + HugoOperations ops(* g_table); + require(!ops.startTransaction(g_ndb)); + for(size_t i = 0; irestart()); + } + } + if((g_rows+1) % 100 != 0) + require(!ops.execute_Commit(g_ndb)); + return 0; +} + +static int pause_lcp() +{ + return 0; +} + +static int do_op(int row) +{ + HugoOperations & ops = * g_hugo_ops; + if(strcmp(g_cases[row].op1, "INSERT") == 0){ + require(!g_cases[row].curr_row); + g_cases[row].curr_row = true; + g_cases[row].val = rand(); + require(!ops.pkInsertRecord(g_ndb, row, 1, g_cases[row].val)); + } else if(strcmp(g_cases[row].op1, "UPDATE") == 0){ + require(g_cases[row].curr_row); + g_cases[row].val = rand(); + require(!ops.pkUpdateRecord(g_ndb, row, 1, g_cases[row].val)); + } else if(strcmp(g_cases[row].op1, "DELETE") == 0){ + require(g_cases[row].curr_row); + g_cases[row].curr_row = false; + require(!ops.pkDeleteRecord(g_ndb, row, 1)); + } + + require(!ops.execute_NoCommit(g_ndb)); + + if(g_cases[row].op2 == 0){ + } else if(strcmp(g_cases[row].op2, "INSERT") == 0){ + require(!g_cases[row].curr_row); + g_cases[row].curr_row = true; + g_cases[row].val = rand(); + require(!ops.pkInsertRecord(g_ndb, row, 1, g_cases[row].val)); + } else if(strcmp(g_cases[row].op2, "UPDATE") == 0){ + require(g_cases[row].curr_row); + g_cases[row].val = rand(); + require(!ops.pkUpdateRecord(g_ndb, row, 1, g_cases[row].val)); + } else if(strcmp(g_cases[row].op2, "DELETE") == 0){ + require(g_cases[row].curr_row); + g_cases[row].curr_row = false; + require(!ops.pkDeleteRecord(g_ndb, row, 1)); + } + + if(g_cases[row].op2 != 0) + require(!ops.execute_NoCommit(g_ndb)); + return 0; +} + +static int continue_lcp(int error) +{ + error = 0; + if(g_restarter.insertErrorInAllNodes(error) == 0){ + int args[] = { DumpStateOrd::DihStartLcpImmediately }; + return g_restarter.dumpStateAllNodes(args, 1); + } + return -1; +} + +static int commit() +{ + HugoOperations & ops = * g_hugo_ops; + int res = ops.execute_Commit(g_ndb); + if(res == 0){ + return ops.getTransaction()->restart(); + } + return res; +} + +static int restart() +{ + g_info << "Restarting cluster" << endl; + disconnect_ndb(); + delete g_hugo_ops; + + require(!g_restarter.restartAll()); + require(!g_restarter.waitClusterStarted(30)); + require(!connect_ndb()); + + g_table = g_ndb->getDictionary()->getTable(g_tablename); + require(g_table); + require(g_hugo_ops = new HugoOperations(* g_table)); + require(!g_hugo_ops->startTransaction(g_ndb)); + return 0; +} + +static int validate() +{ + HugoOperations ops(* g_table); + for(size_t i = 0; i Date: Wed, 15 Sep 2004 15:57:12 +0200 Subject: [PATCH 3/5] drop table after test (if created & success) ndb/test/ndbapi/testLcp.cpp: Remove diskdata stuff --- ndb/test/ndbapi/testLcp.cpp | 4 ---- ndb/test/src/NDBT_Test.cpp | 5 +++++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ndb/test/ndbapi/testLcp.cpp b/ndb/test/ndbapi/testLcp.cpp index 493123ffa4a..c92be091a97 100644 --- a/ndb/test/ndbapi/testLcp.cpp +++ b/ndb/test/ndbapi/testLcp.cpp @@ -182,10 +182,6 @@ static int drop_all_tables() case NdbDictionary::Object::IndexTrigger: case NdbDictionary::Object::SubscriptionTrigger: case NdbDictionary::Object::ReadOnlyConstraint: - case NdbDictionary::Object::Tablespace: - case NdbDictionary::Object::LogfileGroup: - case NdbDictionary::Object::Datafile: - case NdbDictionary::Object::Undofile: default: break; } diff --git a/ndb/test/src/NDBT_Test.cpp b/ndb/test/src/NDBT_Test.cpp index 7ccc9e5588f..ba316bac01b 100644 --- a/ndb/test/src/NDBT_Test.cpp +++ b/ndb/test/src/NDBT_Test.cpp @@ -859,6 +859,11 @@ void NDBT_TestSuite::execute(Ndb* ndb, const NdbDictionary::Table* pTab, else numTestsOk++; numTestsExecuted++; + + if (result == NDBT_OK && createTable == true){ + pDict->dropTable(pTab->getName()); + } + delete ctx; } } From 7c4eee90f0c06390a4fde6b4395655255bd42c4a Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 20 Sep 2004 12:21:08 +0200 Subject: [PATCH 4/5] bug#5659 uninit variable ndb/src/kernel/vm/Configuration.cpp: init variable --- ndb/src/kernel/vm/Configuration.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/ndb/src/kernel/vm/Configuration.cpp b/ndb/src/kernel/vm/Configuration.cpp index 8907cb9f640..3099c71b792 100644 --- a/ndb/src/kernel/vm/Configuration.cpp +++ b/ndb/src/kernel/vm/Configuration.cpp @@ -159,6 +159,7 @@ Configuration::Configuration() _initialStart = false; _daemonMode = false; m_config_retriever= 0; + m_clusterConfig= 0; } Configuration::~Configuration(){ From 5a53ee4fc91bc8ef55fa6247d15d867e1866a8ad Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 20 Sep 2004 13:10:47 +0200 Subject: [PATCH 5/5] These modifications were part of WL#1856 Conversion of client_test.c tests cases to mysqltest if possible They are separated from the other WL#1856 stuff, because they improve the behaviour of the current tests. Make the result sets (order of rows) more predictable by using ORDER BY. mysql-test/include/ps_modify.inc: Make the result sets more predictable by using ORDER BY mysql-test/include/ps_modify1.inc: Make the result sets more predictable by using ORDER BY mysql-test/r/ps_2myisam.result: updated results mysql-test/r/ps_3innodb.result: updated results mysql-test/r/ps_4heap.result: updated results mysql-test/r/ps_5merge.result: updated results mysql-test/r/ps_6bdb.result: updated results BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- BitKeeper/etc/logging_ok | 1 + mysql-test/include/ps_modify.inc | 14 +++---- mysql-test/include/ps_modify1.inc | 10 ++--- mysql-test/r/ps_2myisam.result | 62 ++++++++++++++-------------- mysql-test/r/ps_3innodb.result | 24 +++++------ mysql-test/r/ps_4heap.result | 64 ++++++++++++++--------------- mysql-test/r/ps_5merge.result | 68 +++++++++++++++---------------- mysql-test/r/ps_6bdb.result | 24 +++++------ 8 files changed, 134 insertions(+), 133 deletions(-) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index c3ca14ab929..f72b47da651 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -102,6 +102,7 @@ miguel@light.local miguel@sartre.local mikron@c-fb0ae253.1238-1-64736c10.cust.bredbandsbolaget.se mikron@mikael-ronstr-ms-dator.local +mleich@mysql.com mmatthew@markslaptop. monty@bitch.mysql.fi monty@butch. diff --git a/mysql-test/include/ps_modify.inc b/mysql-test/include/ps_modify.inc index 04c5cbaad6b..ba7ccefdd98 100644 --- a/mysql-test/include/ps_modify.inc +++ b/mysql-test/include/ps_modify.inc @@ -110,10 +110,10 @@ select a,b from t1 where a=@arg00; set @arg00=NULL; set @arg01=2; execute stmt1 using @arg00, @arg01; -select a,b from t1; +select a,b from t1 order by a; set @arg00=0; execute stmt1 using @arg01, @arg00; -select a,b from t1; +select a,b from t1 order by a; ## update with subquery and several parameters set @arg00=23; @@ -134,7 +134,7 @@ prepare stmt1 from 'update t1 set a=? where b=? and a not in (select ? from t2 where b = ? or a = ?)'; execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; -select a,b from t1 ; +select a,b from t1 order by a; drop table t2 ; ## update with parameters in limit @@ -202,7 +202,7 @@ set @arg01=1 ; prepare stmt1 from 'insert into t1 set a=?, b=''sechs'' on duplicate key update a=a + ?, b=concat(b,''modified'') '; execute stmt1 using @arg00, @arg01; -select * from t1; +select * from t1 order by a; set @arg00=81 ; set @arg01=1 ; --error 1062 @@ -221,17 +221,17 @@ set @updated="updated" ; insert into t1 values(1000,'x1000_1') ; insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3) on duplicate key update a = a + @100, b = concat(b,@updated) ; -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; delete from t1 where a >= 1000 ; insert into t1 values(1000,'x1000_1') ; prepare stmt1 from ' insert into t1 values(?,?),(?,?) on duplicate key update a = a + ?, b = concat(b,?) '; execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; delete from t1 where a >= 1000 ; insert into t1 values(1000,'x1000_1') ; execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; delete from t1 where a >= 1000 ; ## replace diff --git a/mysql-test/include/ps_modify1.inc b/mysql-test/include/ps_modify1.inc index 0b192a52625..da3bea80669 100644 --- a/mysql-test/include/ps_modify1.inc +++ b/mysql-test/include/ps_modify1.inc @@ -45,19 +45,19 @@ set @duplicate='duplicate ' ; set @1000=1000 ; set @5=5 ; -select a,b from t1 where a < 5 ; +select a,b from t1 where a < 5 order by a ; --enable_info insert into t1 select a + @1000, concat(@duplicate,b) from t1 where a < @5 ; --disable_info -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; delete from t1 where a >= 1000 ; prepare stmt1 from ' insert into t1 select a + ?, concat(?,b) from t1 where a < ? ' ; --enable_info execute stmt1 using @1000, @duplicate, @5; --disable_info -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; delete from t1 where a >= 1000 ; set @float=1.00; @@ -78,7 +78,7 @@ select b, a + @100 from t1 where (a,b) in ( select sqrt(a+@1)+CAST(@float AS signed),b from t1); --disable_info -select a,b from t2; +select a,b from t2 order by a ; delete from t2 ; prepare stmt1 from ' insert into t2 (b,a) select ?, sum(first.a) @@ -93,5 +93,5 @@ select b, a + ? from t1 --enable_info execute stmt1 using @duplicate, @5, @five, @2, @100, @1, @float ; --disable_info -select a,b from t2; +select a,b from t2 order by a ; drop table t2; diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result index 7e183118e61..13b54973b8d 100644 --- a/mysql-test/r/ps_2myisam.result +++ b/mysql-test/r/ps_2myisam.result @@ -1016,15 +1016,15 @@ set @arg01=2; execute stmt1 using @arg00, @arg01; Warnings: Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1 -select a,b from t1; +select a,b from t1 order by a; a b -1 one 0 two +1 one 3 three 4 four set @arg00=0; execute stmt1 using @arg01, @arg00; -select a,b from t1; +select a,b from t1 order by a; a b 1 one 2 two @@ -1048,7 +1048,7 @@ prepare stmt1 from 'update t1 set a=? where b=? and a not in (select ? from t2 where b = ? or a = ?)'; execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; -select a,b from t1 ; +select a,b from t1 order by a; a b 1 one 2 two @@ -1142,19 +1142,19 @@ set @arg01=1 ; prepare stmt1 from 'insert into t1 set a=?, b=''sechs'' on duplicate key update a=a + ?, b=concat(b,''modified'') '; execute stmt1 using @arg00, @arg01; -select * from t1; +select * from t1 order by a; a b +0 NULL 1 one 2 two 3 three 4 four 5 five 7 sixmodified -0 NULL 8 eight +9 nine 81 8-1 82 8-2 -9 nine set @arg00=81 ; set @arg01=1 ; execute stmt1 using @arg00, @arg01; @@ -1170,7 +1170,7 @@ set @updated="updated" ; insert into t1 values(1000,'x1000_1') ; insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3) on duplicate key update a = a + @100, b = concat(b,@updated) ; -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; a b 1000 x1000_3 1100 x1000_1updated @@ -1179,14 +1179,14 @@ insert into t1 values(1000,'x1000_1') ; prepare stmt1 from ' insert into t1 values(?,?),(?,?) on duplicate key update a = a + ?, b = concat(b,?) '; execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; a b 1000 x1000_3 1100 x1000_1updated delete from t1 where a >= 1000 ; insert into t1 values(1000,'x1000_1') ; execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; a b 1200 x1000_1updatedupdated delete from t1 where a >= 1000 ; @@ -1195,37 +1195,37 @@ ERROR HY000: This command is not supported in the prepared statement protocol ye set @duplicate='duplicate ' ; set @1000=1000 ; set @5=5 ; -select a,b from t1 where a < 5 ; +select a,b from t1 where a < 5 order by a ; a b +0 NULL 1 one 2 two 3 three 4 four -0 NULL insert into t1 select a + @1000, concat(@duplicate,b) from t1 where a < @5 ; affected rows: 5 info: Records: 5 Duplicates: 0 Warnings: 0 -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; a b +1000 NULL 1001 duplicate one 1002 duplicate two 1003 duplicate three 1004 duplicate four -1000 NULL delete from t1 where a >= 1000 ; prepare stmt1 from ' insert into t1 select a + ?, concat(?,b) from t1 where a < ? ' ; execute stmt1 using @1000, @duplicate, @5; affected rows: 5 info: Records: 5 Duplicates: 0 Warnings: 0 -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; a b -1004 duplicate four -1003 duplicate three -1002 duplicate two -1001 duplicate one 1000 NULL +1001 duplicate one +1002 duplicate two +1003 duplicate three +1004 duplicate four delete from t1 where a >= 1000 ; set @float=1.00; set @five='five' ; @@ -1243,15 +1243,15 @@ where (a,b) in ( select sqrt(a+@1)+CAST(@float AS signed),b from t1); affected rows: 8 info: Records: 8 Duplicates: 0 Warnings: 0 -select a,b from t2; +select a,b from t2 order by a ; a b +3 duplicate +4 duplicate +7 duplicate +8 duplicate +9 duplicate 81 duplicate 82 duplicate -8 duplicate -4 duplicate -9 duplicate -7 duplicate -3 duplicate 103 three delete from t2 ; prepare stmt1 from ' insert into t2 (b,a) @@ -1267,15 +1267,15 @@ select b, a + ? from t1 execute stmt1 using @duplicate, @5, @five, @2, @100, @1, @float ; affected rows: 8 info: Records: 8 Duplicates: 0 Warnings: 0 -select a,b from t2; +select a,b from t2 order by a ; a b +3 duplicate +4 duplicate +7 duplicate +8 duplicate +9 duplicate 81 duplicate 82 duplicate -8 duplicate -4 duplicate -9 duplicate -7 duplicate -3 duplicate 103 three drop table t2; drop table t1, t_many_col_types; diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result index d33e3c610c0..17e56b8e001 100644 --- a/mysql-test/r/ps_3innodb.result +++ b/mysql-test/r/ps_3innodb.result @@ -1016,7 +1016,7 @@ set @arg01=2; execute stmt1 using @arg00, @arg01; Warnings: Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1 -select a,b from t1; +select a,b from t1 order by a; a b 0 two 1 one @@ -1024,7 +1024,7 @@ a b 4 four set @arg00=0; execute stmt1 using @arg01, @arg00; -select a,b from t1; +select a,b from t1 order by a; a b 1 one 2 two @@ -1048,7 +1048,7 @@ prepare stmt1 from 'update t1 set a=? where b=? and a not in (select ? from t2 where b = ? or a = ?)'; execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; -select a,b from t1 ; +select a,b from t1 order by a; a b 1 one 2 two @@ -1142,7 +1142,7 @@ set @arg01=1 ; prepare stmt1 from 'insert into t1 set a=?, b=''sechs'' on duplicate key update a=a + ?, b=concat(b,''modified'') '; execute stmt1 using @arg00, @arg01; -select * from t1; +select * from t1 order by a; a b 0 NULL 1 one @@ -1170,7 +1170,7 @@ set @updated="updated" ; insert into t1 values(1000,'x1000_1') ; insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3) on duplicate key update a = a + @100, b = concat(b,@updated) ; -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; a b 1000 x1000_3 1100 x1000_1updated @@ -1179,14 +1179,14 @@ insert into t1 values(1000,'x1000_1') ; prepare stmt1 from ' insert into t1 values(?,?),(?,?) on duplicate key update a = a + ?, b = concat(b,?) '; execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; a b 1000 x1000_3 1100 x1000_1updated delete from t1 where a >= 1000 ; insert into t1 values(1000,'x1000_1') ; execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; a b 1200 x1000_1updatedupdated delete from t1 where a >= 1000 ; @@ -1195,7 +1195,7 @@ ERROR HY000: This command is not supported in the prepared statement protocol ye set @duplicate='duplicate ' ; set @1000=1000 ; set @5=5 ; -select a,b from t1 where a < 5 ; +select a,b from t1 where a < 5 order by a ; a b 0 NULL 1 one @@ -1206,7 +1206,7 @@ insert into t1 select a + @1000, concat(@duplicate,b) from t1 where a < @5 ; affected rows: 5 info: Records: 5 Duplicates: 0 Warnings: 0 -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; a b 1000 NULL 1001 duplicate one @@ -1219,7 +1219,7 @@ where a < ? ' ; execute stmt1 using @1000, @duplicate, @5; affected rows: 5 info: Records: 5 Duplicates: 0 Warnings: 0 -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; a b 1000 NULL 1001 duplicate one @@ -1243,7 +1243,7 @@ where (a,b) in ( select sqrt(a+@1)+CAST(@float AS signed),b from t1); affected rows: 8 info: Records: 8 Duplicates: 0 Warnings: 0 -select a,b from t2; +select a,b from t2 order by a ; a b 3 duplicate 4 duplicate @@ -1267,7 +1267,7 @@ select b, a + ? from t1 execute stmt1 using @duplicate, @5, @five, @2, @100, @1, @float ; affected rows: 8 info: Records: 8 Duplicates: 0 Warnings: 0 -select a,b from t2; +select a,b from t2 order by a ; a b 3 duplicate 4 duplicate diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result index b5888795666..afca7c9f143 100644 --- a/mysql-test/r/ps_4heap.result +++ b/mysql-test/r/ps_4heap.result @@ -1017,15 +1017,15 @@ set @arg01=2; execute stmt1 using @arg00, @arg01; Warnings: Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1 -select a,b from t1; +select a,b from t1 order by a; a b -1 one 0 two +1 one 3 three 4 four set @arg00=0; execute stmt1 using @arg01, @arg00; -select a,b from t1; +select a,b from t1 order by a; a b 1 one 2 two @@ -1049,7 +1049,7 @@ prepare stmt1 from 'update t1 set a=? where b=? and a not in (select ? from t2 where b = ? or a = ?)'; execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; -select a,b from t1 ; +select a,b from t1 order by a; a b 1 one 2 two @@ -1143,19 +1143,19 @@ set @arg01=1 ; prepare stmt1 from 'insert into t1 set a=?, b=''sechs'' on duplicate key update a=a + ?, b=concat(b,''modified'') '; execute stmt1 using @arg00, @arg01; -select * from t1; +select * from t1 order by a; a b +0 NULL 1 one 2 two 3 three 4 four 5 five 7 sixmodified -0 NULL 8 eight +9 nine 81 8-1 82 8-2 -9 nine set @arg00=81 ; set @arg01=1 ; execute stmt1 using @arg00, @arg01; @@ -1171,23 +1171,23 @@ set @updated="updated" ; insert into t1 values(1000,'x1000_1') ; insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3) on duplicate key update a = a + @100, b = concat(b,@updated) ; -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; a b -1100 x1000_1updated 1000 x1000_3 +1100 x1000_1updated delete from t1 where a >= 1000 ; insert into t1 values(1000,'x1000_1') ; prepare stmt1 from ' insert into t1 values(?,?),(?,?) on duplicate key update a = a + ?, b = concat(b,?) '; execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; a b 1000 x1000_3 1100 x1000_1updated delete from t1 where a >= 1000 ; insert into t1 values(1000,'x1000_1') ; execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; a b 1200 x1000_1updatedupdated delete from t1 where a >= 1000 ; @@ -1196,37 +1196,37 @@ ERROR HY000: This command is not supported in the prepared statement protocol ye set @duplicate='duplicate ' ; set @1000=1000 ; set @5=5 ; -select a,b from t1 where a < 5 ; +select a,b from t1 where a < 5 order by a ; a b +0 NULL 1 one 2 two 3 three 4 four -0 NULL insert into t1 select a + @1000, concat(@duplicate,b) from t1 where a < @5 ; affected rows: 5 info: Records: 5 Duplicates: 0 Warnings: 0 -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; a b -1002 duplicate two +1000 NULL 1001 duplicate one +1002 duplicate two 1003 duplicate three 1004 duplicate four -1000 NULL delete from t1 where a >= 1000 ; prepare stmt1 from ' insert into t1 select a + ?, concat(?,b) from t1 where a < ? ' ; execute stmt1 using @1000, @duplicate, @5; affected rows: 5 info: Records: 5 Duplicates: 0 Warnings: 0 -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; a b 1000 NULL -1004 duplicate four -1003 duplicate three -1002 duplicate two 1001 duplicate one +1002 duplicate two +1003 duplicate three +1004 duplicate four delete from t1 where a >= 1000 ; set @float=1.00; set @five='five' ; @@ -1244,15 +1244,15 @@ where (a,b) in ( select sqrt(a+@1)+CAST(@float AS signed),b from t1); affected rows: 8 info: Records: 8 Duplicates: 0 Warnings: 0 -select a,b from t2; +select a,b from t2 order by a ; a b +3 duplicate +4 duplicate +7 duplicate +8 duplicate +9 duplicate 81 duplicate 82 duplicate -8 duplicate -4 duplicate -9 duplicate -7 duplicate -3 duplicate 103 three delete from t2 ; prepare stmt1 from ' insert into t2 (b,a) @@ -1268,15 +1268,15 @@ select b, a + ? from t1 execute stmt1 using @duplicate, @5, @five, @2, @100, @1, @float ; affected rows: 8 info: Records: 8 Duplicates: 0 Warnings: 0 -select a,b from t2; +select a,b from t2 order by a ; a b +3 duplicate +4 duplicate +7 duplicate +8 duplicate +9 duplicate 81 duplicate 82 duplicate -8 duplicate -4 duplicate -9 duplicate -7 duplicate -3 duplicate 103 three drop table t2; drop table t1, t_many_col_types; diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result index 7d78f4b9e1c..cb894df53d2 100644 --- a/mysql-test/r/ps_5merge.result +++ b/mysql-test/r/ps_5merge.result @@ -1059,19 +1059,19 @@ set @arg01=2; execute stmt1 using @arg00, @arg01; Warnings: Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1 -select a,b from t1; +select a,b from t1 order by a; a b -3 three 0 two 1 one +3 three 4 four set @arg00=0; execute stmt1 using @arg01, @arg00; -select a,b from t1; +select a,b from t1 order by a; a b -3 three -2 two 1 one +2 two +3 three 4 four set @arg00=23; set @arg01='two'; @@ -1091,11 +1091,11 @@ prepare stmt1 from 'update t1 set a=? where b=? and a not in (select ? from t2 where b = ? or a = ?)'; execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; -select a,b from t1 ; +select a,b from t1 order by a; a b -3 three -2 two 1 one +2 two +3 three 4 four drop table t2 ; set @arg00=1; @@ -1185,19 +1185,19 @@ set @arg01=1 ; prepare stmt1 from 'insert into t1 set a=?, b=''sechs'' on duplicate key update a=a + ?, b=concat(b,''modified'') '; execute stmt1 using @arg00, @arg01; -select * from t1; +select * from t1 order by a; a b -4 four -3 three -2 two +0 NULL 1 one +2 two +3 three +4 four 5 five 7 sixmodified -0 NULL 8 eight +9 nine 81 8-1 82 8-2 -9 nine set @arg00=81 ; set @arg01=1 ; execute stmt1 using @arg00, @arg01; @@ -1213,7 +1213,7 @@ set @updated="updated" ; insert into t1 values(1000,'x1000_1') ; insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3) on duplicate key update a = a + @100, b = concat(b,@updated) ; -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; a b 1000 x1000_3 1100 x1000_1updated @@ -1222,14 +1222,14 @@ insert into t1 values(1000,'x1000_1') ; prepare stmt1 from ' insert into t1 values(?,?),(?,?) on duplicate key update a = a + ?, b = concat(b,?) '; execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; a b 1000 x1000_3 1100 x1000_1updated delete from t1 where a >= 1000 ; insert into t1 values(1000,'x1000_1') ; execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; a b 1200 x1000_1updatedupdated delete from t1 where a >= 1000 ; @@ -2254,19 +2254,19 @@ set @arg01=2; execute stmt1 using @arg00, @arg01; Warnings: Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1 -select a,b from t1; +select a,b from t1 order by a; a b -3 three 0 two 1 one +3 three 4 four set @arg00=0; execute stmt1 using @arg01, @arg00; -select a,b from t1; +select a,b from t1 order by a; a b -3 three -2 two 1 one +2 two +3 three 4 four set @arg00=23; set @arg01='two'; @@ -2286,11 +2286,11 @@ prepare stmt1 from 'update t1 set a=? where b=? and a not in (select ? from t2 where b = ? or a = ?)'; execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; -select a,b from t1 ; +select a,b from t1 order by a; a b -3 three -2 two 1 one +2 two +3 three 4 four drop table t2 ; set @arg00=1; @@ -2380,19 +2380,19 @@ set @arg01=1 ; prepare stmt1 from 'insert into t1 set a=?, b=''sechs'' on duplicate key update a=a + ?, b=concat(b,''modified'') '; execute stmt1 using @arg00, @arg01; -select * from t1; +select * from t1 order by a; a b -4 four -3 three -2 two +0 NULL 1 one +2 two +3 three +4 four 5 five 7 sixmodified -0 NULL 8 eight +9 nine 81 8-1 82 8-2 -9 nine set @arg00=81 ; set @arg01=1 ; execute stmt1 using @arg00, @arg01; @@ -2408,7 +2408,7 @@ set @updated="updated" ; insert into t1 values(1000,'x1000_1') ; insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3) on duplicate key update a = a + @100, b = concat(b,@updated) ; -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; a b 1000 x1000_3 1100 x1000_1updated @@ -2417,14 +2417,14 @@ insert into t1 values(1000,'x1000_1') ; prepare stmt1 from ' insert into t1 values(?,?),(?,?) on duplicate key update a = a + ?, b = concat(b,?) '; execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; a b 1000 x1000_3 1100 x1000_1updated delete from t1 where a >= 1000 ; insert into t1 values(1000,'x1000_1') ; execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; a b 1200 x1000_1updatedupdated delete from t1 where a >= 1000 ; diff --git a/mysql-test/r/ps_6bdb.result b/mysql-test/r/ps_6bdb.result index c5cde1b755a..0ff2025ee2a 100644 --- a/mysql-test/r/ps_6bdb.result +++ b/mysql-test/r/ps_6bdb.result @@ -1016,7 +1016,7 @@ set @arg01=2; execute stmt1 using @arg00, @arg01; Warnings: Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1 -select a,b from t1; +select a,b from t1 order by a; a b 0 two 1 one @@ -1024,7 +1024,7 @@ a b 4 four set @arg00=0; execute stmt1 using @arg01, @arg00; -select a,b from t1; +select a,b from t1 order by a; a b 1 one 2 two @@ -1048,7 +1048,7 @@ prepare stmt1 from 'update t1 set a=? where b=? and a not in (select ? from t2 where b = ? or a = ?)'; execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; -select a,b from t1 ; +select a,b from t1 order by a; a b 1 one 2 two @@ -1142,7 +1142,7 @@ set @arg01=1 ; prepare stmt1 from 'insert into t1 set a=?, b=''sechs'' on duplicate key update a=a + ?, b=concat(b,''modified'') '; execute stmt1 using @arg00, @arg01; -select * from t1; +select * from t1 order by a; a b 0 NULL 1 one @@ -1170,7 +1170,7 @@ set @updated="updated" ; insert into t1 values(1000,'x1000_1') ; insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3) on duplicate key update a = a + @100, b = concat(b,@updated) ; -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; a b 1000 x1000_3 1100 x1000_1updated @@ -1179,14 +1179,14 @@ insert into t1 values(1000,'x1000_1') ; prepare stmt1 from ' insert into t1 values(?,?),(?,?) on duplicate key update a = a + ?, b = concat(b,?) '; execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; a b 1000 x1000_3 1100 x1000_1updated delete from t1 where a >= 1000 ; insert into t1 values(1000,'x1000_1') ; execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; a b 1200 x1000_1updatedupdated delete from t1 where a >= 1000 ; @@ -1195,7 +1195,7 @@ ERROR HY000: This command is not supported in the prepared statement protocol ye set @duplicate='duplicate ' ; set @1000=1000 ; set @5=5 ; -select a,b from t1 where a < 5 ; +select a,b from t1 where a < 5 order by a ; a b 0 NULL 1 one @@ -1206,7 +1206,7 @@ insert into t1 select a + @1000, concat(@duplicate,b) from t1 where a < @5 ; affected rows: 5 info: Records: 5 Duplicates: 0 Warnings: 0 -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; a b 1000 NULL 1001 duplicate one @@ -1219,7 +1219,7 @@ where a < ? ' ; execute stmt1 using @1000, @duplicate, @5; affected rows: 5 info: Records: 5 Duplicates: 0 Warnings: 0 -select a,b from t1 where a >= 1000 ; +select a,b from t1 where a >= 1000 order by a ; a b 1000 NULL 1001 duplicate one @@ -1243,7 +1243,7 @@ where (a,b) in ( select sqrt(a+@1)+CAST(@float AS signed),b from t1); affected rows: 8 info: Records: 8 Duplicates: 0 Warnings: 0 -select a,b from t2; +select a,b from t2 order by a ; a b 3 duplicate 4 duplicate @@ -1267,7 +1267,7 @@ select b, a + ? from t1 execute stmt1 using @duplicate, @5, @five, @2, @100, @1, @float ; affected rows: 8 info: Records: 8 Duplicates: 0 Warnings: 0 -select a,b from t2; +select a,b from t2 order by a ; a b 3 duplicate 4 duplicate