From b35e697ec4d1d11a82984d5a8687a1775a281e30 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Jul 2007 07:42:12 -0500 Subject: [PATCH 01/49] ndb api test case for bug 29501 storage/ndb/test/ndbapi/testDict.cpp: Added test for Bug#29501. Tested on both code without patch and code with patch. DN fails on code w/o and passed for code w/. Also includes new helper functions runWaitStarted and DropDDObjects. Along with these helper function I have included a test for DropDDObjects. I did find a case where lgman fails on the restarting DN with corrupt fs error. I will file a new bug report and test case for that. storage/ndb/test/run-test/daily-basic-tests.txt: Added new tests for bug29501 --- storage/ndb/test/ndbapi/testDict.cpp | 255 ++++++++++++++++++ .../ndb/test/run-test/daily-basic-tests.txt | 8 + 2 files changed, 263 insertions(+) diff --git a/storage/ndb/test/ndbapi/testDict.cpp b/storage/ndb/test/ndbapi/testDict.cpp index 13c071f968e..b17cc4d159f 100644 --- a/storage/ndb/test/ndbapi/testDict.cpp +++ b/storage/ndb/test/ndbapi/testDict.cpp @@ -2706,7 +2706,262 @@ runDictRestart(NDBT_Context* ctx, NDBT_Step* step) return NDBT_OK; } +int +runBug29501(NDBT_Context* ctx, NDBT_Step* step) { + NdbRestarter res; + NdbDictionary::LogfileGroup lg; + lg.setName("DEFAULT-LG"); + lg.setUndoBufferSize(8*1024*1024); + + if (res.getNumDbNodes() < 2) + return NDBT_OK; + + Ndb* pNdb = GETNDB(step); + NdbDictionary::Dictionary* pDict = pNdb->getDictionary(); + + int node = res.getRandomNotMasterNodeId(rand()); + res.restartOneDbNode(node, true, true, false); + + if(pDict->createLogfileGroup(lg) != 0){ + g_err << "Failed to create logfilegroup:" + << endl << pDict->getNdbError() << endl; + return NDBT_FAILED; + } + + NdbDictionary::Undofile uf; + uf.setPath("undofile01.dat"); + uf.setSize(5*1024*1024); + uf.setLogfileGroup("DEFAULT-LG"); + + if(pDict->createUndofile(uf) != 0){ + g_err << "Failed to create undofile:" + << endl << pDict->getNdbError() << endl; + return NDBT_FAILED; + } + + res.waitNodesNoStart(&node, 1); + res.startNodes(&node, 1); + + if (res.waitClusterStarted()){ + g_err << "Node restart failed" + << endl << pDict->getNdbError() << endl; + return NDBT_FAILED; + } + + if (pDict->dropLogfileGroup(pDict->getLogfileGroup(lg.getName())) != 0){ + g_err << "Drop of LFG Failed" + << endl << pDict->getNdbError() << endl; + return NDBT_FAILED; + } + + return NDBT_OK; +} + +int +runDropDDObjects(NDBT_Context* ctx, NDBT_Step* step){ + //Purpose is to drop all tables, data files, Table spaces and LFG's + Uint32 i = 0; + + Ndb* pNdb = GETNDB(step); + NdbDictionary::Dictionary* pDict = pNdb->getDictionary(); + + NdbDictionary::Dictionary::List list; + if (pDict->listObjects(list) == -1) + return NDBT_FAILED; + + //Search the list and drop all tables found + const char * tableFound = 0; + for (i = 0; i < list.count; i++){ + switch(list.elements[i].type){ + case NdbDictionary::Object::UserTable: + tableFound = list.elements[i].name; + if(tableFound != 0){ + if(pDict->dropTable(tableFound) != 0){ + g_err << "Failed to drop table: " << pDict->getNdbError() << endl; + return NDBT_FAILED; + } + } + tableFound = 0; + break; + default: + break; + } + } + + //Search the list and drop all data file found + const char * dfFound = 0; + for (i = 0; i < list.count; i++){ + switch(list.elements[i].type){ + case NdbDictionary::Object::Datafile: + dfFound = list.elements[i].name; + if(dfFound != 0){ + if(pDict->dropDatafile(pDict->getDatafile(0, dfFound)) != 0){ + g_err << "Failed to drop datafile: " << pDict->getNdbError() << endl; + return NDBT_FAILED; + } + } + dfFound = 0; + break; + default: + break; + } + } + + //Search the list and drop all Table Spaces Found + const char * tsFound = 0; + for (i = 0; i dropTablespace(pDict->getTablespace(tsFound)) != 0){ + g_err << "Failed to drop tablespace: " << pDict->getNdbError() << endl; + return NDBT_FAILED; + } + } + tsFound = 0; + break; + default: + break; + } + } + + //Search the list and drop all LFG Found + //Currently only 1 LGF is supported, but written for future + //when more then one is supported. + const char * lgFound = 0; + for (i = 0; i < list.count; i++){ + switch(list.elements[i].type){ + case NdbDictionary::Object::LogfileGroup: + lgFound = list.elements[i].name; + if(lgFound != 0){ + if (pDict->dropLogfileGroup(pDict->getLogfileGroup(lgFound)) != 0){ + g_err << "Failed to drop tablespace: " << pDict->getNdbError() << endl; + return NDBT_FAILED; + } + } + lgFound = 0; + break; + default: + break; + } + } + + return NDBT_OK; +} + +int +runWaitStarted(NDBT_Context* ctx, NDBT_Step* step){ + + NdbRestarter restarter; + restarter.waitClusterStarted(300); + + NdbSleep_SecSleep(3); + return NDBT_OK; +} + +int +testDropDDObjectsSetup(NDBT_Context* ctx, NDBT_Step* step){ + //Purpose is to setup to test DropDDObjects + char tsname[256]; + char dfname[256]; + + Ndb* pNdb = GETNDB(step); + NdbDictionary::Dictionary* pDict = pNdb->getDictionary(); + + NdbDictionary::LogfileGroup lg; + lg.setName("DEFAULT-LG"); + lg.setUndoBufferSize(8*1024*1024); + + + if(pDict->createLogfileGroup(lg) != 0){ + g_err << "Failed to create logfilegroup:" + << endl << pDict->getNdbError() << endl; + return NDBT_FAILED; + } + + NdbDictionary::Undofile uf; + uf.setPath("undofile01.dat"); + uf.setSize(5*1024*1024); + uf.setLogfileGroup("DEFAULT-LG"); + + if(pDict->createUndofile(uf) != 0){ + g_err << "Failed to create undofile:" + << endl << pDict->getNdbError() << endl; + return NDBT_FAILED; + } + + BaseString::snprintf(tsname, sizeof(tsname), "TS-%u", rand()); + BaseString::snprintf(dfname, sizeof(dfname), "%s-%u.dat", tsname, rand()); + + if (create_tablespace(pDict, lg.getName(), tsname, dfname)){ + g_err << "Failed to create undofile:" + << endl << pDict->getNdbError() << endl; + return NDBT_FAILED; + } + + return NDBT_OK; +} + +int +DropDDObjectsVerify(NDBT_Context* ctx, NDBT_Step* step){ + //Purpose is to verify test DropDDObjects worked + Uint32 i = 0; + + Ndb* pNdb = GETNDB(step); + NdbDictionary::Dictionary* pDict = pNdb->getDictionary(); + + NdbDictionary::Dictionary::List list; + if (pDict->listObjects(list) == -1) + return NDBT_FAILED; + + bool ddFound = false; + for (i = 0; i Date: Fri, 14 Sep 2007 00:10:47 +0200 Subject: [PATCH 02/49] BUG#30996: Committed too early when autocommit and lock table Moved out a lot of code into functions from external_lock and start_stmt Fixed a crashing bug at memory alloc failure Merged the stmt and all variables into one trans variable Always register start of statement as according to the interface of the handlers. Also register for start of transaction when not statement commit == not autocommit AND no begin - commit ongoing Now that we registered in a proper manner we also needed to handle the commit call when end of statement and transaction is ongoing Added start_stmt_count to know when we have start of statement for first table mysql-test/suite/ndb/r/ndb_lock_table.result: Added a new test case for bug30996 mysql-test/suite/ndb/t/ndb_lock_table.test: Added a new test case for bug30996 sql/ha_ndbcluster.cc: Moved out a lot of code into functions from external_lock and start_stmt Fixed a crashing bug at memory alloc failure Merged the stmt and all variables into one trans variable Always register start of statement as according to the interface of the handlers. Also register for start of transaction when not statement commit == not autocommit AND no begin - commit ongoing Now that we registered in a proper manner we also needed to handle the commit call when end of statement and transaction is ongoing Added start_stmt_count to know when we have start of statement for first table sql/ha_ndbcluster.h: New functions and merged variables --- mysql-test/suite/ndb/r/ndb_lock_table.result | 11 + mysql-test/suite/ndb/t/ndb_lock_table.test | 15 + sql/ha_ndbcluster.cc | 329 ++++++++++--------- sql/ha_ndbcluster.h | 8 +- 4 files changed, 198 insertions(+), 165 deletions(-) create mode 100644 mysql-test/suite/ndb/r/ndb_lock_table.result create mode 100644 mysql-test/suite/ndb/t/ndb_lock_table.test diff --git a/mysql-test/suite/ndb/r/ndb_lock_table.result b/mysql-test/suite/ndb/r/ndb_lock_table.result new file mode 100644 index 00000000000..a0550273e1a --- /dev/null +++ b/mysql-test/suite/ndb/r/ndb_lock_table.result @@ -0,0 +1,11 @@ +drop table if exists t1; +create table t1 (a int) engine ndb; +set autocommit=1; +lock table t1 write; +set autocommit=0; +insert into t1 values (0); +rollback; +select * from t1; +a +unlock tables; +drop table t1; diff --git a/mysql-test/suite/ndb/t/ndb_lock_table.test b/mysql-test/suite/ndb/t/ndb_lock_table.test new file mode 100644 index 00000000000..6c21e8e8232 --- /dev/null +++ b/mysql-test/suite/ndb/t/ndb_lock_table.test @@ -0,0 +1,15 @@ +-- source include/have_ndb.inc + +# BUG 30996 +--disable_warnings +drop table if exists t1; +--enable_warnings +create table t1 (a int) engine ndb; +set autocommit=1; +lock table t1 write; +set autocommit=0; +insert into t1 values (0); +rollback; +select * from t1; +unlock tables; +drop table t1; diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 1ec6898078f..c090f2a4cde 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -325,9 +325,9 @@ Thd_ndb::Thd_ndb() { ndb= new Ndb(g_ndb_cluster_connection, ""); lock_count= 0; + start_stmt_count= 0; count= 0; - all= NULL; - stmt= NULL; + trans= NULL; m_error= FALSE; m_error_code= 0; query_state&= NDB_QUERY_NORMAL; @@ -382,6 +382,11 @@ Thd_ndb::get_open_table(THD *thd, const void *key) { thd_ndb_share= (THD_NDB_SHARE *) alloc_root(&thd->transaction.mem_root, sizeof(THD_NDB_SHARE)); + if (!thd_ndb_share) + { + mem_alloc_error(sizeof(THD_NDB_SHARE)); + DBUG_RETURN(NULL); + } thd_ndb_share->key= key; thd_ndb_share->stat.last_count= count; thd_ndb_share->stat.no_uncommitted_rows_count= 0; @@ -4327,7 +4332,7 @@ static int ndbcluster_update_apply_status(THD *thd, int do_update) Ndb *ndb= thd_ndb->ndb; NDBDICT *dict= ndb->getDictionary(); const NDBTAB *ndbtab; - NdbTransaction *trans= thd_ndb->all ? thd_ndb->all : thd_ndb->stmt; + NdbTransaction *trans= thd_ndb->trans; ndb->setDatabaseName(NDB_REP_DB); Ndb_table_guard ndbtab_g(dict, NDB_APPLY_TABLE); if (!(ndbtab= ndbtab_g.get_table())) @@ -4371,10 +4376,110 @@ static int ndbcluster_update_apply_status(THD *thd, int do_update) } #endif /* HAVE_NDB_BINLOG */ +void ha_ndbcluster::transaction_checks(THD *thd) +{ + if (thd->lex->sql_command == SQLCOM_LOAD) + { + m_transaction_on= FALSE; + /* Would be simpler if has_transactions() didn't always say "yes" */ + thd->transaction.all.modified_non_trans_table= + thd->transaction.stmt.modified_non_trans_table= TRUE; + } + else if (!thd->transaction.on) + m_transaction_on= FALSE; + else + m_transaction_on= thd->variables.ndb_use_transactions; +} + +int ha_ndbcluster::start_statement(THD *thd, + Thd_ndb *thd_ndb, + Ndb *ndb) +{ + DBUG_ENTER("ha_ndbcluster::start_statement"); + PRINT_OPTION_FLAGS(thd); + + trans_register_ha(thd, FALSE, ndbcluster_hton); + if (!thd_ndb->trans) + { + if (thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) + trans_register_ha(thd, TRUE, ndbcluster_hton); + DBUG_PRINT("trans",("Starting transaction")); + thd_ndb->trans= ndb->startTransaction(); + if (thd_ndb->trans == NULL) + ERR_RETURN(ndb->getNdbError()); + thd_ndb->init_open_tables(); + thd_ndb->query_state&= NDB_QUERY_NORMAL; + thd_ndb->trans_options= 0; + thd_ndb->m_slow_path= FALSE; + if (!(thd->options & OPTION_BIN_LOG) || + thd->variables.binlog_format == BINLOG_FORMAT_STMT) + { + thd_ndb->trans_options|= TNTO_NO_LOGGING; + thd_ndb->m_slow_path= TRUE; + } + else if (thd->slave_thread) + thd_ndb->m_slow_path= TRUE; + } + /* + If this is the start of a LOCK TABLE, a table look + should be taken on the table in NDB + + Check if it should be read or write lock + */ + if (thd->options & (OPTION_TABLE_LOCK)) + { + //lockThisTable(); + DBUG_PRINT("info", ("Locking the table..." )); + } + DBUG_RETURN(0); +} + +int ha_ndbcluster::init_handler_for_statement(THD *thd, Thd_ndb *thd_ndb) +{ + /* + This is the place to make sure this handler instance + has a started transaction. + + The transaction is started by the first handler on which + MySQL Server calls external lock + + Other handlers in the same stmt or transaction should use + the same NDB transaction. This is done by setting up the m_active_trans + pointer to point to the NDB transaction. + */ + + DBUG_ENTER("ha_ndbcluster::init_handler_for_statement"); + // store thread specific data first to set the right context + m_force_send= thd->variables.ndb_force_send; + m_ha_not_exact_count= !thd->variables.ndb_use_exact_count; + m_autoincrement_prefetch= + (ha_rows) thd->variables.ndb_autoincrement_prefetch_sz; + + m_active_trans= thd_ndb->trans; + DBUG_ASSERT(m_active_trans); + // Start of transaction + m_rows_changed= 0; + m_ops_pending= 0; + m_slow_path= thd_ndb->m_slow_path; +#ifdef HAVE_NDB_BINLOG + if (unlikely(m_slow_path)) + { + if (m_share == ndb_apply_status_share && thd->slave_thread) + thd_ndb->trans_options|= TNTO_INJECTED_APPLY_STATUS; + } +#endif + // TODO remove double pointers... + if (!(m_thd_ndb_share= thd_ndb->get_open_table(thd, m_table))) + { + DBUG_RETURN(1); + } + m_table_info= &m_thd_ndb_share->stat; + DBUG_RETURN(0); +} + int ha_ndbcluster::external_lock(THD *thd, int lock_type) { int error=0; - NdbTransaction* trans= NULL; DBUG_ENTER("external_lock"); /* @@ -4395,124 +4500,15 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type) if (lock_type != F_UNLCK) { DBUG_PRINT("info", ("lock_type != F_UNLCK")); - if (thd->lex->sql_command == SQLCOM_LOAD) - { - m_transaction_on= FALSE; - /* Would be simpler if has_transactions() didn't always say "yes" */ - thd->transaction.all.modified_non_trans_table= thd->transaction.stmt.modified_non_trans_table= TRUE; - } - else if (!thd->transaction.on) - m_transaction_on= FALSE; - else - m_transaction_on= thd->variables.ndb_use_transactions; + transaction_checks(thd); if (!thd_ndb->lock_count++) { - PRINT_OPTION_FLAGS(thd); - if (!(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))) - { - // Autocommit transaction - DBUG_ASSERT(!thd_ndb->stmt); - DBUG_PRINT("trans",("Starting transaction stmt")); - - trans= ndb->startTransaction(); - if (trans == NULL) - { - thd_ndb->lock_count= 0; - ERR_RETURN(ndb->getNdbError()); - } - thd_ndb->init_open_tables(); - thd_ndb->stmt= trans; - thd_ndb->query_state&= NDB_QUERY_NORMAL; - thd_ndb->trans_options= 0; - thd_ndb->m_slow_path= FALSE; - if (!(thd->options & OPTION_BIN_LOG) || - thd->variables.binlog_format == BINLOG_FORMAT_STMT) - { - thd_ndb->trans_options|= TNTO_NO_LOGGING; - thd_ndb->m_slow_path= TRUE; - } - else if (thd->slave_thread) - thd_ndb->m_slow_path= TRUE; - trans_register_ha(thd, FALSE, ndbcluster_hton); - } - else - { - if (!thd_ndb->all) - { - // Not autocommit transaction - // A "master" transaction ha not been started yet - DBUG_PRINT("trans",("starting transaction, all")); - - trans= ndb->startTransaction(); - if (trans == NULL) - { - thd_ndb->lock_count= 0; - ERR_RETURN(ndb->getNdbError()); - } - thd_ndb->init_open_tables(); - thd_ndb->all= trans; - thd_ndb->query_state&= NDB_QUERY_NORMAL; - thd_ndb->trans_options= 0; - thd_ndb->m_slow_path= FALSE; - if (!(thd->options & OPTION_BIN_LOG) || - thd->variables.binlog_format == BINLOG_FORMAT_STMT) - { - thd_ndb->trans_options|= TNTO_NO_LOGGING; - thd_ndb->m_slow_path= TRUE; - } - else if (thd->slave_thread) - thd_ndb->m_slow_path= TRUE; - trans_register_ha(thd, TRUE, ndbcluster_hton); - - /* - If this is the start of a LOCK TABLE, a table look - should be taken on the table in NDB - - Check if it should be read or write lock - */ - if (thd->options & (OPTION_TABLE_LOCK)) - { - //lockThisTable(); - DBUG_PRINT("info", ("Locking the table..." )); - } - - } - } + if ((error= start_statement(thd, thd_ndb, ndb))) + goto error; } - /* - This is the place to make sure this handler instance - has a started transaction. - - The transaction is started by the first handler on which - MySQL Server calls external lock - - Other handlers in the same stmt or transaction should use - the same NDB transaction. This is done by setting up the m_active_trans - pointer to point to the NDB transaction. - */ - - // store thread specific data first to set the right context - m_force_send= thd->variables.ndb_force_send; - m_ha_not_exact_count= !thd->variables.ndb_use_exact_count; - m_autoincrement_prefetch= - (ha_rows) thd->variables.ndb_autoincrement_prefetch_sz; - - m_active_trans= thd_ndb->all ? thd_ndb->all : thd_ndb->stmt; - DBUG_ASSERT(m_active_trans); - // Start of transaction - m_rows_changed= 0; - m_ops_pending= 0; - m_slow_path= thd_ndb->m_slow_path; -#ifdef HAVE_NDB_BINLOG - if (unlikely(m_slow_path)) - { - if (m_share == ndb_apply_status_share && thd->slave_thread) - thd_ndb->trans_options|= TNTO_INJECTED_APPLY_STATUS; - } -#endif - // TODO remove double pointers... - m_thd_ndb_share= thd_ndb->get_open_table(thd, m_table); - m_table_info= &m_thd_ndb_share->stat; + if ((error= init_handler_for_statement(thd, thd_ndb))) + goto error; + DBUG_RETURN(0); } else { @@ -4540,16 +4536,19 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type) DBUG_PRINT("trans", ("Last external_lock")); PRINT_OPTION_FLAGS(thd); - if (thd_ndb->stmt) + if (!(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))) { - /* - Unlock is done without a transaction commit / rollback. - This happens if the thread didn't update any rows - We must in this case close the transaction to release resources - */ - DBUG_PRINT("trans",("ending non-updating transaction")); - ndb->closeTransaction(m_active_trans); - thd_ndb->stmt= NULL; + if (thd_ndb->trans) + { + /* + Unlock is done without a transaction commit / rollback. + This happens if the thread didn't update any rows + We must in this case close the transaction to release resources + */ + DBUG_PRINT("trans",("ending non-updating transaction")); + ndb->closeTransaction(thd_ndb->trans); + thd_ndb->trans= NULL; + } } } m_table_info= NULL; @@ -4578,7 +4577,10 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type) if (m_ops_pending) DBUG_PRINT("warning", ("ops_pending != 0L")); m_ops_pending= 0; + DBUG_RETURN(0); } +error: + thd_ndb->lock_count--; DBUG_RETURN(error); } @@ -4610,25 +4612,20 @@ int ha_ndbcluster::start_stmt(THD *thd, thr_lock_type lock_type) { int error=0; DBUG_ENTER("start_stmt"); - PRINT_OPTION_FLAGS(thd); Thd_ndb *thd_ndb= get_thd_ndb(thd); - NdbTransaction *trans= (thd_ndb->stmt)?thd_ndb->stmt:thd_ndb->all; - if (!trans){ + transaction_checks(thd); + if (!thd_ndb->start_stmt_count++) + { Ndb *ndb= thd_ndb->ndb; - DBUG_PRINT("trans",("Starting transaction stmt")); - trans= ndb->startTransaction(); - if (trans == NULL) - ERR_RETURN(ndb->getNdbError()); - no_uncommitted_rows_reset(thd); - thd_ndb->stmt= trans; - thd_ndb->query_state&= NDB_QUERY_NORMAL; - trans_register_ha(thd, FALSE, ndbcluster_hton); + if ((error= start_statement(thd, thd_ndb, ndb))) + goto error; } - m_active_trans= trans; - // Start of statement - m_ops_pending= 0; - + if ((error= init_handler_for_statement(thd, thd_ndb))) + goto error; + DBUG_RETURN(0); +error: + thd_ndb->start_stmt_count--; DBUG_RETURN(error); } @@ -4642,15 +4639,27 @@ static int ndbcluster_commit(handlerton *hton, THD *thd, bool all) int res= 0; Thd_ndb *thd_ndb= get_thd_ndb(thd); Ndb *ndb= thd_ndb->ndb; - NdbTransaction *trans= all ? thd_ndb->all : thd_ndb->stmt; + NdbTransaction *trans= thd_ndb->trans; DBUG_ENTER("ndbcluster_commit"); - DBUG_PRINT("transaction",("%s", - trans == thd_ndb->stmt ? - "stmt" : "all")); DBUG_ASSERT(ndb); - if (trans == NULL) + thd_ndb->start_stmt_count= 0; + if (trans == NULL || (!all && + thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))) + { + /* + An odditity in the handler interface is that commit on handlerton + is called to indicate end of statement only in cases where + autocommit isn't used and the all flag isn't set. + + We also leave quickly when a transaction haven't even been started, + in this case we are safe that no clean up is needed. In this case + the MySQL Server could handle the query without contacting the + NDB kernel. + */ + DBUG_PRINT("info", ("Commit before start or end-of-statement only")); DBUG_RETURN(0); + } #ifdef HAVE_NDB_BINLOG if (unlikely(thd_ndb->m_slow_path)) @@ -4671,11 +4680,7 @@ static int ndbcluster_commit(handlerton *hton, THD *thd, bool all) ndbcluster_print_error(res, error_op); } ndb->closeTransaction(trans); - - if (all) - thd_ndb->all= NULL; - else - thd_ndb->stmt= NULL; + thd_ndb->trans= NULL; /* Clear commit_count for tables changed by transaction */ NDB_SHARE* share; @@ -4704,13 +4709,15 @@ static int ndbcluster_rollback(handlerton *hton, THD *thd, bool all) int res= 0; Thd_ndb *thd_ndb= get_thd_ndb(thd); Ndb *ndb= thd_ndb->ndb; - NdbTransaction *trans= all ? thd_ndb->all : thd_ndb->stmt; + NdbTransaction *trans= thd_ndb->trans; DBUG_ENTER("ndbcluster_rollback"); - DBUG_PRINT("transaction",("%s", - trans == thd_ndb->stmt ? - "stmt" : "all")); - DBUG_ASSERT(ndb && trans); + DBUG_ASSERT(ndb); + thd_ndb->start_stmt_count= 0; + if (!trans) + { + DBUG_RETURN(0); + } if (trans->execute(NdbTransaction::Rollback) != 0) { @@ -4722,11 +4729,7 @@ static int ndbcluster_rollback(handlerton *hton, THD *thd, bool all) ndbcluster_print_error(res, error_op); } ndb->closeTransaction(trans); - - if (all) - thd_ndb->all= NULL; - else - thd_ndb->stmt= NULL; + thd_ndb->trans= NULL; /* Clear list of tables changed by transaction */ thd_ndb->changed_tables.empty(); diff --git a/sql/ha_ndbcluster.h b/sql/ha_ndbcluster.h index a6f992226c2..808ffe20f3e 100644 --- a/sql/ha_ndbcluster.h +++ b/sql/ha_ndbcluster.h @@ -204,8 +204,8 @@ class Thd_ndb Ndb *ndb; ulong count; uint lock_count; - NdbTransaction *all; - NdbTransaction *stmt; + uint start_stmt_count; + NdbTransaction *trans; bool m_error; bool m_slow_path; int m_error_code; @@ -496,6 +496,10 @@ private: friend int execute_no_commit(ha_ndbcluster*, NdbTransaction*, bool); friend int execute_no_commit_ie(ha_ndbcluster*, NdbTransaction*, bool); + void transaction_checks(THD *thd); + int start_statement(THD *thd, Thd_ndb *thd_ndb, Ndb* ndb); + int init_handler_for_statement(THD *thd, Thd_ndb *thd_ndb); + NdbTransaction *m_active_trans; NdbScanOperation *m_active_cursor; const NdbDictionary::Table *m_table; From 75b153f2404035476288df95d6101da305bb969d Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 15 Sep 2007 23:33:04 +0200 Subject: [PATCH 03/49] Fixed ndbcluster_rollback --- sql/ha_ndbcluster.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index c090f2a4cde..239b0fa13ec 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -4643,6 +4643,8 @@ static int ndbcluster_commit(handlerton *hton, THD *thd, bool all) DBUG_ENTER("ndbcluster_commit"); DBUG_ASSERT(ndb); + PRINT_OPTION_FLAGS(thd); + DBUG_PRINT("enter", ("Commit %s", (all ? "all" : "stmt"))); thd_ndb->start_stmt_count= 0; if (trans == NULL || (!all && thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))) @@ -4714,8 +4716,11 @@ static int ndbcluster_rollback(handlerton *hton, THD *thd, bool all) DBUG_ENTER("ndbcluster_rollback"); DBUG_ASSERT(ndb); thd_ndb->start_stmt_count= 0; - if (!trans) + if (trans == NULL || (!all && + thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))) { + /* Ignore end-of-statement until real rollback or commit is called */ + DBUG_PRINT("info", ("Rollback before start or end-of-statement only")); DBUG_RETURN(0); } From bb7b00c91fbedca505337692f44bc504d77e712b Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 19 Sep 2007 11:20:30 +0200 Subject: [PATCH 04/49] NDBT_Thread.cpp: Removed semicolon causing build syntax issues per pekka storage/ndb/test/src/NDBT_Thread.cpp: Removed semicolon causing build syntax issues per pekka --- storage/ndb/test/src/NDBT_Thread.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/ndb/test/src/NDBT_Thread.cpp b/storage/ndb/test/src/NDBT_Thread.cpp index 56cf2f6815b..ff6785724ba 100644 --- a/storage/ndb/test/src/NDBT_Thread.cpp +++ b/storage/ndb/test/src/NDBT_Thread.cpp @@ -131,7 +131,7 @@ NDBT_Thread::exit() m_state = Exit; signal(); unlock(); -}; +} void NDBT_Thread::join() From f7886540120d6c9d564053ee25709f07fd49a784 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 25 Sep 2007 12:01:23 +0200 Subject: [PATCH 05/49] [PATCH] BUG#30379 Better randomise time before retry in timeout check (DBTC) timoOutLoopStartLab() checks if any transactions have been delayed for so long that we are forced to perform some action (e.g. abort, resend etc). It is *MEANT* to (according to the comment): > To avoid aborting both transactions in a deadlock detected by time-out > we insert a random extra time-out of upto 630 ms by using the lowest > six bits of the api connect reference. > We spread it out from 0 to 630 ms if base time-out is larger than 3 sec, > we spread it out from 0 to 70 ms if base time-out is smaller than 300 msec, > and otherwise we spread it out 310 ms. The comment (as all do) lies. the API connect reference is not very random, producing incredibly predictable "random" numbers. This could lead to both txns being aborted instead of just one. Before: timeout value: 123 3 timeout value: 122 2 timeout value: 122 2 timeout value: 122 2 timeout value: 123 3 After: timeout value: 127 7 timeout value: 126 6 timeout value: 129 9 timeout value: 139 19 timeout value: 137 17 timeout value: 151 31 timeout value: 130 10 timeout value: 132 12 Index: ndb-work/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp =================================================================== ndb/src/common/util/Makefile.am: BUG#30379 Better randomise time before retry in timeout check (DBTC) ndb/include/util/ndb_rand.h: BUG#30379 Better randomise time before retry in timeout check (DBTC) ndb/src/common/util/ndb_rand.c: BUG#30379 Better randomise time before retry in timeout check (DBTC) ndb/src/kernel/blocks/dbtc/DbtcMain.cpp: BUG#30379 Better randomise time before retry in timeout check (DBTC) --- ndb/include/util/ndb_rand.h | 33 ++++++++++++++++++++ ndb/src/common/util/Makefile.am | 3 +- ndb/src/common/util/ndb_rand.c | 40 +++++++++++++++++++++++++ ndb/src/kernel/blocks/dbtc/DbtcMain.cpp | 4 ++- 4 files changed, 78 insertions(+), 2 deletions(-) create mode 100644 ndb/include/util/ndb_rand.h create mode 100644 ndb/src/common/util/ndb_rand.c diff --git a/ndb/include/util/ndb_rand.h b/ndb/include/util/ndb_rand.h new file mode 100644 index 00000000000..1521ca9c4ff --- /dev/null +++ b/ndb/include/util/ndb_rand.h @@ -0,0 +1,33 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef NDB_RAND_H +#define NDB_RAND_H + +#define NDB_RAND_MAX 32767 + +#ifdef __cplusplus +extern "C" { +#endif + +int ndb_rand(void); + +void ndb_srand(unsigned seed); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/ndb/src/common/util/Makefile.am b/ndb/src/common/util/Makefile.am index 4cc2e49f9ec..dc83a70990f 100644 --- a/ndb/src/common/util/Makefile.am +++ b/ndb/src/common/util/Makefile.am @@ -24,7 +24,8 @@ libgeneral_la_SOURCES = \ uucode.c random.c version.c \ strdup.c \ ConfigValues.cpp ndb_init.c basestring_vsnprintf.c \ - Bitmask.cpp + Bitmask.cpp \ + ndb_rand.c EXTRA_PROGRAMS = testBitmask testBitmask_SOURCES = testBitmask.cpp diff --git a/ndb/src/common/util/ndb_rand.c b/ndb/src/common/util/ndb_rand.c new file mode 100644 index 00000000000..4fcc483cd49 --- /dev/null +++ b/ndb/src/common/util/ndb_rand.c @@ -0,0 +1,40 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include + +static unsigned long next= 1; + +/** + * ndb_rand + * + * constant time, cheap, pseudo-random number generator. + * + * NDB_RAND_MAX assumed to be 32767 + * + * This is the POSIX example for "generating the same sequence on + * different machines". Although that is not one of our requirements. + */ +int ndb_rand(void) +{ + next= next * 1103515245 + 12345; + return((unsigned)(next/65536) % 32768); +} + +void ndb_srand(unsigned seed) +{ + next= seed; +} + diff --git a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp index 60024e82978..9697594d7d2 100644 --- a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp +++ b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -6278,7 +6279,8 @@ void Dbtc::timeOutLoopStartLab(Signal* signal, Uint32 api_con_ptr) jam(); if (api_timer != 0) { Uint32 error= ZTIME_OUT_ERROR; - time_out_value= time_out_param + (api_con_ptr & mask_value); + time_out_value= time_out_param + (ndb_rand() & mask_value); + ndbout_c("timeout value: %u %u",time_out_value, time_out_value-time_out_param); if (unlikely(old_mask_value)) // abort during single user mode { apiConnectptr.i = api_con_ptr; From 10fbce08c0ad1742e24af4a0d551ea4a7b84d946 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 25 Sep 2007 12:16:39 +0200 Subject: [PATCH 06/49] ndb_rand.c: Rename: ndb/src/common/util/ndb_rand.c -> storage/ndb/src/common/util/ndb_rand.c ndb_rand.h: Rename: ndb/include/util/ndb_rand.h -> storage/ndb/include/util/ndb_rand.h storage/ndb/include/util/ndb_rand.h: Rename: ndb/include/util/ndb_rand.h -> storage/ndb/include/util/ndb_rand.h storage/ndb/src/common/util/ndb_rand.c: Rename: ndb/src/common/util/ndb_rand.c -> storage/ndb/src/common/util/ndb_rand.c --- {ndb => storage/ndb}/include/util/ndb_rand.h | 0 {ndb => storage/ndb}/src/common/util/ndb_rand.c | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename {ndb => storage/ndb}/include/util/ndb_rand.h (100%) rename {ndb => storage/ndb}/src/common/util/ndb_rand.c (100%) diff --git a/ndb/include/util/ndb_rand.h b/storage/ndb/include/util/ndb_rand.h similarity index 100% rename from ndb/include/util/ndb_rand.h rename to storage/ndb/include/util/ndb_rand.h diff --git a/ndb/src/common/util/ndb_rand.c b/storage/ndb/src/common/util/ndb_rand.c similarity index 100% rename from ndb/src/common/util/ndb_rand.c rename to storage/ndb/src/common/util/ndb_rand.c From 9e54eeee2e4ae2e0dd64b1eda30dcc38abf1580c Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 28 Sep 2007 09:58:56 +0200 Subject: [PATCH 07/49] ndb - add new testcases/error insert bug#30975 (recommit for correct merge order) storage/ndb/src/kernel/blocks/ERROR_codes.txt: new error code storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp: add error inserts storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp: add error insert storage/ndb/src/kernel/blocks/pgman.cpp: add error inserts storage/ndb/test/include/HugoTransactions.hpp: add - loadTableStartFrom - scanUpdate with scanflags - fillTableStartFrom storage/ndb/test/include/UtilTransactions.hpp: add - clearTable with scan flags storage/ndb/test/ndbapi/testSystemRestart.cpp: add new testcases storage/ndb/test/run-test/daily-basic-tests.txt: add new testcases storage/ndb/test/src/HugoTransactions.cpp: add new functions storage/ndb/test/src/UtilTransactions.cpp: add new functions --- storage/ndb/src/kernel/blocks/ERROR_codes.txt | 4 +- storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp | 32 ++++ .../ndb/src/kernel/blocks/dbtc/DbtcMain.cpp | 1 + storage/ndb/src/kernel/blocks/pgman.cpp | 26 ++- storage/ndb/test/include/HugoTransactions.hpp | 18 ++ storage/ndb/test/include/UtilTransactions.hpp | 5 + storage/ndb/test/ndbapi/testSystemRestart.cpp | 180 ++++++++++++++++++ .../ndb/test/run-test/daily-basic-tests.txt | 32 ++++ storage/ndb/test/src/HugoTransactions.cpp | 131 ++++++++----- storage/ndb/test/src/UtilTransactions.cpp | 74 +++---- 10 files changed, 419 insertions(+), 84 deletions(-) diff --git a/storage/ndb/src/kernel/blocks/ERROR_codes.txt b/storage/ndb/src/kernel/blocks/ERROR_codes.txt index 58479dfe7b6..abb1d858082 100644 --- a/storage/ndb/src/kernel/blocks/ERROR_codes.txt +++ b/storage/ndb/src/kernel/blocks/ERROR_codes.txt @@ -6,7 +6,7 @@ Next DBTUP 4029 Next DBLQH 5045 Next DBDICT 6007 Next DBDIH 7186 -Next DBTC 8040 +Next DBTC 8054 Next CMVMI 9000 Next BACKUP 10038 Next DBUTIL 11002 @@ -246,6 +246,8 @@ Delay execution of ABORTCONF signal 2 seconds to generate time-out. 8050: Send ZABORT_TIMEOUT_BREAK delayed +8053: Crash in timeOutFoundLab, state CS_WAIT_COMMIT_CONF + ERROR CODES FOR TESTING TIME-OUT HANDLING IN DBTC ------------------------------------------------- diff --git a/storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp b/storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp index 15e5f908460..f324f62a041 100644 --- a/storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp +++ b/storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp @@ -1300,6 +1300,38 @@ Cmvmi::execDUMP_STATE_ORD(Signal* signal) } #endif #endif + + if (arg == 9999) + { + Uint32 delay = 1000; + switch(signal->getLength()){ + case 1: + break; + case 2: + delay = signal->theData[1]; + break; + default:{ + Uint32 dmin = signal->theData[1]; + Uint32 dmax = signal->theData[2]; + delay = dmin + (rand() % (dmax - dmin)); + break; + } + } + + signal->theData[0] = 9999; + if (delay == 0) + { + execNDB_TAMPER(signal); + } + else if (delay < 10) + { + sendSignal(reference(), GSN_NDB_TAMPER, signal, 1, JBB); + } + else + { + sendSignalWithDelay(reference(), GSN_NDB_TAMPER, signal, delay, 1); + } + } }//Cmvmi::execDUMP_STATE_ORD() void diff --git a/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp b/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp index 5c52e145ae9..e8244ce0c66 100644 --- a/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp +++ b/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp @@ -6373,6 +6373,7 @@ void Dbtc::timeOutFoundLab(Signal* signal, Uint32 TapiConPtr, Uint32 errCode) return; case CS_WAIT_COMMIT_CONF: jam(); + CRASH_INSERTION(8053); tcConnectptr.i = apiConnectptr.p->currentTcConnect; ptrCheckGuard(tcConnectptr, ctcConnectFilesize, tcConnectRecord); arrGuard(apiConnectptr.p->currentReplicaNo, MAX_REPLICAS); diff --git a/storage/ndb/src/kernel/blocks/pgman.cpp b/storage/ndb/src/kernel/blocks/pgman.cpp index edc3eac699e..a5558aa320d 100644 --- a/storage/ndb/src/kernel/blocks/pgman.cpp +++ b/storage/ndb/src/kernel/blocks/pgman.cpp @@ -238,6 +238,13 @@ Pgman::execCONTINUEB(Signal* signal) } else { + if (ERROR_INSERTED(11007)) + { + ndbout << "No more writes..." << endl; + SET_ERROR_INSERT_VALUE(11008); + signal->theData[0] = 9999; + sendSignalWithDelay(CMVMI_REF, GSN_NDB_TAMPER, signal, 10000, 1); + } signal->theData[0] = m_end_lcp_req.senderData; sendSignal(m_end_lcp_req.senderRef, GSN_END_LCP_CONF, signal, 1, JBB); } @@ -1303,6 +1310,13 @@ Pgman::process_lcp(Signal* signal) } else { + if (ERROR_INSERTED(11007)) + { + ndbout << "No more writes..." << endl; + signal->theData[0] = 9999; + sendSignalWithDelay(CMVMI_REF, GSN_NDB_TAMPER, signal, 10000, 1); + SET_ERROR_INSERT_VALUE(11008); + } signal->theData[0] = m_end_lcp_req.senderData; sendSignal(m_end_lcp_req.senderRef, GSN_END_LCP_CONF, signal, 1, JBB); } @@ -1590,8 +1604,11 @@ Pgman::fswritereq(Signal* signal, Ptr ptr) } #endif - sendSignal(NDBFS_REF, GSN_FSWRITEREQ, signal, - FsReadWriteReq::FixedLength + 1, JBA); + if (!ERROR_INSERTED(11008)) + { + sendSignal(NDBFS_REF, GSN_FSWRITEREQ, signal, + FsReadWriteReq::FixedLength + 1, JBA); + } } void @@ -2454,6 +2471,11 @@ Pgman::execDUMP_STATE_ORD(Signal* signal) { SET_ERROR_INSERT_VALUE(11006); } + + if (signal->theData[0] == 11007) + { + SET_ERROR_INSERT_VALUE(11007); + } } // page cache client diff --git a/storage/ndb/test/include/HugoTransactions.hpp b/storage/ndb/test/include/HugoTransactions.hpp index e2b12f261a8..e8f7b33e0ed 100644 --- a/storage/ndb/test/include/HugoTransactions.hpp +++ b/storage/ndb/test/include/HugoTransactions.hpp @@ -36,6 +36,16 @@ public: int updateValue = 0, bool abort = false); + int loadTableStartFrom(Ndb*, + int startFrom, + int records, + int batch = 512, + bool allowConstraintViolation = true, + int doSleep = 0, + bool oneTrans = false, + int updateValue = 0, + bool abort = false); + int scanReadRecords(Ndb*, int records, int abort = 0, @@ -56,6 +66,11 @@ public: int batchsize = 1, NdbOperation::LockMode = NdbOperation::LM_Read); + int scanUpdateRecords(Ndb*, NdbScanOperation::ScanFlag, + int records, + int abort = 0, + int parallelism = 0); + int scanUpdateRecords(Ndb*, int records, int abort = 0, @@ -90,9 +105,12 @@ public: int records, int percentToLock = 1, int lockTime = 1000); + int fillTable(Ndb*, int batch=512); + int fillTableStartFrom(Ndb*, int startFrom, int batch=512); + /** * Reading using UniqHashIndex with key = pk */ diff --git a/storage/ndb/test/include/UtilTransactions.hpp b/storage/ndb/test/include/UtilTransactions.hpp index 75bbcd9c776..193398c3da2 100644 --- a/storage/ndb/test/include/UtilTransactions.hpp +++ b/storage/ndb/test/include/UtilTransactions.hpp @@ -29,6 +29,11 @@ public: int closeTransaction(Ndb*); + int clearTable(Ndb*, + NdbScanOperation::ScanFlag, + int records = 0, + int parallelism = 0); + int clearTable(Ndb*, int records = 0, int parallelism = 0); diff --git a/storage/ndb/test/ndbapi/testSystemRestart.cpp b/storage/ndb/test/ndbapi/testSystemRestart.cpp index bd5cd3dd3c8..e4f9c627f4c 100644 --- a/storage/ndb/test/ndbapi/testSystemRestart.cpp +++ b/storage/ndb/test/ndbapi/testSystemRestart.cpp @@ -20,6 +20,7 @@ #include #include #include +#include int runLoadTable(NDBT_Context* ctx, NDBT_Step* step){ @@ -1219,6 +1220,159 @@ runBug24664(NDBT_Context* ctx, NDBT_Step* step) return result; } +int runSR_DD_1(NDBT_Context* ctx, NDBT_Step* step) +{ + Ndb* pNdb = GETNDB(step); + int result = NDBT_OK; + Uint32 loops = ctx->getNumLoops(); + int count; + NdbRestarter restarter; + NdbBackup backup(GETNDB(step)->getNodeId()+1); + bool lcploop = ctx->getProperty("LCP", (unsigned)0); + + Uint32 i = 1; + Uint32 backupId; + + int val[] = { DumpStateOrd::CmvmiSetRestartOnErrorInsert, 1 }; + int lcp = DumpStateOrd::DihMinTimeBetweenLCP; + + int startFrom = 0; + + HugoTransactions hugoTrans(*ctx->getTab()); + while(i<=loops && result != NDBT_FAILED) + { + + if (lcploop) + { + CHECK(restarter.dumpStateAllNodes(&lcp, 1) == 0); + } + + int nodeId = restarter.getDbNodeId(rand() % restarter.getNumDbNodes()); + //CHECK(restarter.dumpStateAllNodes(&val, 1) == 0); + + ndbout << "Loop " << i << "/"<< loops <<" started" << endl; + ndbout << "Loading records..." << startFrom << endl; + CHECK(hugoTrans.loadTable(pNdb, startFrom) == 0); + + ndbout << "Making " << nodeId << " crash" << endl; + int kill[] = { 9999, 1000, 3000 }; + CHECK(restarter.dumpStateOneNode(nodeId, val, 2) == 0); + CHECK(restarter.dumpStateOneNode(nodeId, kill, 3) == 0); + + Uint64 end = NdbTick_CurrentMillisecond() + 4000; + Uint32 row = startFrom; + do { + ndbout << "Loading from " << row << " to " << row + 1000 << endl; + if (hugoTrans.loadTableStartFrom(pNdb, row, 1000) != 0) + break; + row += 1000; + } while (NdbTick_CurrentMillisecond() < end); + + ndbout << "Waiting for " << nodeId << " to restart" << endl; + CHECK(restarter.waitNodesNoStart(&nodeId, 1) == 0); + + ndbout << "Restarting cluster" << endl; + CHECK(restarter.restartAll(false, true, true) == 0); + CHECK(restarter.waitClusterNoStart() == 0); + CHECK(restarter.startAll() == 0); + CHECK(restarter.waitClusterStarted() == 0); + + ndbout << "Starting backup..." << flush; + CHECK(backup.start(backupId) == 0); + ndbout << "done" << endl; + + int cnt = 0; + CHECK(hugoTrans.selectCount(pNdb, 0, &cnt) == 0); + ndbout << "Found " << cnt << " records..." << endl; + ndbout << "Clearing..." << endl; + CHECK(hugoTrans.clearTable(pNdb, + NdbScanOperation::SF_TupScan, cnt) == 0); + + if (cnt > startFrom) + { + startFrom = cnt; + } + startFrom += 1000; + i++; + } + + ndbout << "runSR_DD_1 finished" << endl; + + return result; +} + +int runSR_DD_2(NDBT_Context* ctx, NDBT_Step* step) +{ + Ndb* pNdb = GETNDB(step); + int result = NDBT_OK; + Uint32 loops = ctx->getNumLoops(); + Uint32 rows = ctx->getNumRecords(); + int count; + NdbRestarter restarter; + NdbBackup backup(GETNDB(step)->getNodeId()+1); + bool lcploop = ctx->getProperty("LCP", (unsigned)0); + + Uint32 i = 1; + Uint32 backupId; + + int val[] = { DumpStateOrd::CmvmiSetRestartOnErrorInsert, 1 }; + int lcp = DumpStateOrd::DihMinTimeBetweenLCP; + + int startFrom = 0; + + HugoTransactions hugoTrans(*ctx->getTab()); + while(i<=loops && result != NDBT_FAILED) + { + + if (lcploop) + { + CHECK(restarter.dumpStateAllNodes(&lcp, 1) == 0); + } + + int nodeId = restarter.getDbNodeId(rand() % restarter.getNumDbNodes()); + + ndbout << "Making " << nodeId << " crash" << endl; + int kill[] = { 9999, 3000, 10000 }; + CHECK(restarter.dumpStateOneNode(nodeId, val, 2) == 0); + CHECK(restarter.dumpStateOneNode(nodeId, kill, 3) == 0); + + Uint64 end = NdbTick_CurrentMillisecond() + 11000; + Uint32 row = startFrom; + do { + if (hugoTrans.loadTable(pNdb, rows) != 0) + break; + + if (hugoTrans.clearTable(pNdb, NdbScanOperation::SF_TupScan, rows) != 0) + break; + } while (NdbTick_CurrentMillisecond() < end); + + ndbout << "Waiting for " << nodeId << " to restart" << endl; + CHECK(restarter.waitNodesNoStart(&nodeId, 1) == 0); + + ndbout << "Restarting cluster" << endl; + CHECK(restarter.restartAll(false, true, true) == 0); + CHECK(restarter.waitClusterNoStart() == 0); + CHECK(restarter.startAll() == 0); + CHECK(restarter.waitClusterStarted() == 0); + + ndbout << "Starting backup..." << flush; + CHECK(backup.start(backupId) == 0); + ndbout << "done" << endl; + + int cnt = 0; + CHECK(hugoTrans.selectCount(pNdb, 0, &cnt) == 0); + ndbout << "Found " << cnt << " records..." << endl; + ndbout << "Clearing..." << endl; + CHECK(hugoTrans.clearTable(pNdb, + NdbScanOperation::SF_TupScan, cnt) == 0); + i++; + } + + ndbout << "runSR_DD_2 finished" << endl; + + return result; +} + NDBT_TESTSUITE(testSystemRestart); TESTCASE("SR1", "Basic system restart test. Focus on testing restart from REDO log.\n" @@ -1399,6 +1553,32 @@ TESTCASE("Bug24664", STEP(runBug24664); FINALIZER(runClearTable); } +TESTCASE("SR_DD_1", "") +{ + INITIALIZER(runWaitStarted); + STEP(runSR_DD_1); + FINALIZER(runClearTable); +} +TESTCASE("SR_DD_1_LCP", "") +{ + TC_PROPERTY("LCP", 1); + INITIALIZER(runWaitStarted); + STEP(runSR_DD_1); + FINALIZER(runClearTable); +} +TESTCASE("SR_DD_2", "") +{ + INITIALIZER(runWaitStarted); + STEP(runSR_DD_2); + FINALIZER(runClearTable); +} +TESTCASE("SR_DD_2_LCP", "") +{ + TC_PROPERTY("LCP", 1); + INITIALIZER(runWaitStarted); + STEP(runSR_DD_2); + FINALIZER(runClearTable); +} NDBT_TESTSUITE_END(testSystemRestart); int main(int argc, const char** argv){ diff --git a/storage/ndb/test/run-test/daily-basic-tests.txt b/storage/ndb/test/run-test/daily-basic-tests.txt index 74c8ea39c97..200b258280a 100644 --- a/storage/ndb/test/run-test/daily-basic-tests.txt +++ b/storage/ndb/test/run-test/daily-basic-tests.txt @@ -870,3 +870,35 @@ cmd: DbAsyncGenerator args: -time 60 -p 1 -proc 25 type: bench +max-time: 1500 +cmd: testSystemRestart +args: -n SR_DD_1 D1 + +max-time: 1500 +cmd: testSystemRestart +args: -n SR_DD_1 D2 + +max-time: 1500 +cmd: testSystemRestart +args: -n SR_DD_1_LCP D1 + +max-time: 1500 +cmd: testSystemRestart +args: -n SR_DD_1_LCP D2 + +max-time: 1500 +cmd: testSystemRestart +args: -n SR_DD_2 D1 + +max-time: 1500 +cmd: testSystemRestart +args: -n SR_DD_2 D2 + +max-time: 1500 +cmd: testSystemRestart +args: -n SR_DD_2_LCP D1 + +max-time: 1500 +cmd: testSystemRestart +args: -n SR_DD_2_LCP D2 + diff --git a/storage/ndb/test/src/HugoTransactions.cpp b/storage/ndb/test/src/HugoTransactions.cpp index 920d2a1dc70..d4d5652bf1f 100644 --- a/storage/ndb/test/src/HugoTransactions.cpp +++ b/storage/ndb/test/src/HugoTransactions.cpp @@ -341,50 +341,14 @@ HugoTransactions::scanReadRecords(Ndb* pNdb, int HugoTransactions::scanUpdateRecords(Ndb* pNdb, - int records, - int abortPercent, - int parallelism){ - if(m_defaultScanUpdateMethod == 1){ - return scanUpdateRecords1(pNdb, records, abortPercent, parallelism); - } else if(m_defaultScanUpdateMethod == 2){ - return scanUpdateRecords2(pNdb, records, abortPercent, parallelism); - } else { - return scanUpdateRecords3(pNdb, records, abortPercent, parallelism); - } -} - -// Scan all records exclusive and update -// them one by one -int -HugoTransactions::scanUpdateRecords1(Ndb* pNdb, - int records, - int abortPercent, - int parallelism){ - return scanUpdateRecords3(pNdb, records, abortPercent, 1); -} - -// Scan all records exclusive and update -// them batched by asking nextScanResult to -// give us all cached records before fetching new -// records from db -int -HugoTransactions::scanUpdateRecords2(Ndb* pNdb, - int records, - int abortPercent, - int parallelism){ - return scanUpdateRecords3(pNdb, records, abortPercent, parallelism); -} - -int -HugoTransactions::scanUpdateRecords3(Ndb* pNdb, - int records, - int abortPercent, - int parallelism){ - int retryAttempt = 0; + NdbScanOperation::ScanFlag flags, + int records, + int abortPercent, + int parallelism){ + int retryAttempt = 0; int check, a; NdbScanOperation *pOp; - while (true){ restart: if (retryAttempt++ >= m_retryMax){ @@ -411,8 +375,9 @@ restart: return NDBT_FAILED; } - if( pOp->readTuplesExclusive(parallelism) ) { - ERR(pTrans->getNdbError()); + if( pOp->readTuples(NdbOperation::LM_Exclusive, flags, + parallelism)) + { closeTransaction(pNdb); return NDBT_FAILED; } @@ -516,6 +481,52 @@ restart: return NDBT_FAILED; } +int +HugoTransactions::scanUpdateRecords(Ndb* pNdb, + int records, + int abortPercent, + int parallelism){ + + return scanUpdateRecords(pNdb, + (NdbScanOperation::ScanFlag)0, + records, abortPercent, parallelism); +} + +// Scan all records exclusive and update +// them one by one +int +HugoTransactions::scanUpdateRecords1(Ndb* pNdb, + int records, + int abortPercent, + int parallelism){ + return scanUpdateRecords(pNdb, + (NdbScanOperation::ScanFlag)0, + records, abortPercent, 1); +} + +// Scan all records exclusive and update +// them batched by asking nextScanResult to +// give us all cached records before fetching new +// records from db +int +HugoTransactions::scanUpdateRecords2(Ndb* pNdb, + int records, + int abortPercent, + int parallelism){ + return scanUpdateRecords(pNdb, (NdbScanOperation::ScanFlag)0, + records, abortPercent, parallelism); +} + +int +HugoTransactions::scanUpdateRecords3(Ndb* pNdb, + int records, + int abortPercent, + int parallelism) +{ + return scanUpdateRecords(pNdb, (NdbScanOperation::ScanFlag)0, + records, abortPercent, parallelism); +} + int HugoTransactions::loadTable(Ndb* pNdb, int records, @@ -524,7 +535,22 @@ HugoTransactions::loadTable(Ndb* pNdb, int doSleep, bool oneTrans, int value, - bool abort){ + bool abort) +{ + return loadTableStartFrom(pNdb, 0, records, batch, allowConstraintViolation, + doSleep, oneTrans, value, abort); +} + +int +HugoTransactions::loadTableStartFrom(Ndb* pNdb, + int startFrom, + int records, + int batch, + bool allowConstraintViolation, + int doSleep, + bool oneTrans, + int value, + bool abort){ int check; int retryAttempt = 0; int retryMax = 5; @@ -543,8 +569,9 @@ HugoTransactions::loadTable(Ndb* pNdb, << " -> rows/commit = " << batch << endl; } + Uint32 orgbatch = batch; g_info << "|- Inserting records..." << endl; - for (int c=0 ; c records) @@ -578,7 +605,7 @@ HugoTransactions::loadTable(Ndb* pNdb, } } - if(pkInsertRecord(pNdb, c, batch, value) != NDBT_OK) + if(pkInsertRecord(pNdb, c + startFrom, batch, value) != NDBT_OK) { ERR(pTrans->getNdbError()); closeTransaction(pNdb); @@ -625,6 +652,7 @@ HugoTransactions::loadTable(Ndb* pNdb, ERR(err); NdbSleep_MilliSleep(50); retryAttempt++; + batch = 1; continue; break; @@ -670,7 +698,14 @@ HugoTransactions::loadTable(Ndb* pNdb, int HugoTransactions::fillTable(Ndb* pNdb, - int batch){ + int batch){ + return fillTableStartFrom(pNdb, 0, batch); +} + +int +HugoTransactions::fillTableStartFrom(Ndb* pNdb, + int startFrom, + int batch){ int check; int retryAttempt = 0; int retryMax = 5; @@ -688,7 +723,7 @@ HugoTransactions::fillTable(Ndb* pNdb, << " -> rows/commit = " << batch << endl; } - for (int c=0 ; ; ){ + for (int c=startFrom ; ; ){ if (retryAttempt >= retryMax){ g_info << "Record " << c << " could not be inserted, has retried " diff --git a/storage/ndb/test/src/UtilTransactions.cpp b/storage/ndb/test/src/UtilTransactions.cpp index f5638a368c7..41c3d2f1d83 100644 --- a/storage/ndb/test/src/UtilTransactions.cpp +++ b/storage/ndb/test/src/UtilTransactions.cpp @@ -42,38 +42,9 @@ UtilTransactions::UtilTransactions(Ndb* ndb, int UtilTransactions::clearTable(Ndb* pNdb, - int records, - int parallelism){ - if(m_defaultClearMethod == 1){ - return clearTable1(pNdb, records, parallelism); - } else if(m_defaultClearMethod == 2){ - return clearTable2(pNdb, records, parallelism); - } else { - return clearTable3(pNdb, records, parallelism); - } -} - - -int -UtilTransactions::clearTable1(Ndb* pNdb, - int records, - int parallelism) -{ - return clearTable3(pNdb, records, 1); -} - -int -UtilTransactions::clearTable2(Ndb* pNdb, - int records, - int parallelism) -{ - return clearTable3(pNdb, records, parallelism); -} - -int -UtilTransactions::clearTable3(Ndb* pNdb, - int records, - int parallelism){ + NdbScanOperation::ScanFlag flags, + int records, + int parallelism){ // Scan all records exclusive and delete // them one by one int retryAttempt = 0; @@ -116,7 +87,7 @@ UtilTransactions::clearTable3(Ndb* pNdb, goto failed; } - if( pOp->readTuplesExclusive(par) ) { + if( pOp->readTuples(NdbOperation::LM_Exclusive, flags, par) ) { err = pTrans->getNdbError(); goto failed; } @@ -179,6 +150,43 @@ UtilTransactions::clearTable3(Ndb* pNdb, return (err.code != 0 ? err.code : NDBT_FAILED); } +int +UtilTransactions::clearTable(Ndb* pNdb, + int records, + int parallelism){ + + return clearTable(pNdb, (NdbScanOperation::ScanFlag)0, + records, parallelism); +} + + +int +UtilTransactions::clearTable1(Ndb* pNdb, + int records, + int parallelism) +{ + return clearTable(pNdb, (NdbScanOperation::ScanFlag)0, + records, 1); +} + +int +UtilTransactions::clearTable2(Ndb* pNdb, + int records, + int parallelism) +{ + return clearTable(pNdb, (NdbScanOperation::ScanFlag)0, + records, parallelism); +} + +int +UtilTransactions::clearTable3(Ndb* pNdb, + int records, + int parallelism) +{ + return clearTable(pNdb, (NdbScanOperation::ScanFlag)0, + records, parallelism); +} + int UtilTransactions::copyTableData(Ndb* pNdb, const char* destName){ From 885ad6ef7b14a663c99861e54c2ac56bc2a00d18 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 28 Sep 2007 10:22:54 +0200 Subject: [PATCH 08/49] post merge --- storage/ndb/test/src/HugoTransactions.cpp | 180 ---------------------- 1 file changed, 180 deletions(-) diff --git a/storage/ndb/test/src/HugoTransactions.cpp b/storage/ndb/test/src/HugoTransactions.cpp index 8aefe7d9577..0e5f7cd8115 100644 --- a/storage/ndb/test/src/HugoTransactions.cpp +++ b/storage/ndb/test/src/HugoTransactions.cpp @@ -477,186 +477,6 @@ restart: return NDBT_FAILED; } - -#define RESTART_SCAN 99 - -int -HugoTransactions::scanUpdateRecords(Ndb* pNdb, - int records, - int abortPercent, - int parallelism){ - if(m_defaultScanUpdateMethod == 1){ - return scanUpdateRecords1(pNdb, records, abortPercent, parallelism); - } else if(m_defaultScanUpdateMethod == 2){ - return scanUpdateRecords2(pNdb, records, abortPercent, parallelism); - } else { - return scanUpdateRecords3(pNdb, records, abortPercent, parallelism); - } -} - -// Scan all records exclusive and update -// them one by one -int -HugoTransactions::scanUpdateRecords1(Ndb* pNdb, - int records, - int abortPercent, - int parallelism){ - return scanUpdateRecords3(pNdb, records, abortPercent, 1); -} - -// Scan all records exclusive and update -// them batched by asking nextScanResult to -// give us all cached records before fetching new -// records from db -int -HugoTransactions::scanUpdateRecords2(Ndb* pNdb, - int records, - int abortPercent, - int parallelism){ - return scanUpdateRecords3(pNdb, records, abortPercent, parallelism); -} - -int -HugoTransactions::scanUpdateRecords3(Ndb* pNdb, - int records, - int abortPercent, - int parallelism){ - int retryAttempt = 0; - int check, a; - NdbScanOperation *pOp; - - - while (true){ -restart: - if (retryAttempt++ >= m_retryMax){ - g_info << "ERROR: has retried this operation " << retryAttempt - << " times, failing!" << endl; - return NDBT_FAILED; - } - - pTrans = pNdb->startTransaction(); - if (pTrans == NULL) { - const NdbError err = pNdb->getNdbError(); - ERR(err); - if (err.status == NdbError::TemporaryError){ - NdbSleep_MilliSleep(50); - continue; - } - return NDBT_FAILED; - } - - pOp = getScanOperation(pTrans); - if (pOp == NULL) { - ERR(pTrans->getNdbError()); - closeTransaction(pNdb); - return NDBT_FAILED; - } - - if( pOp->readTuplesExclusive(parallelism) ) { - ERR(pTrans->getNdbError()); - closeTransaction(pNdb); - return NDBT_FAILED; - } - - // Read all attributes from this table - for(a=0; agetValue(tab.getColumn(a)->getName())) == NULL){ - ERR(pTrans->getNdbError()); - closeTransaction(pNdb); - return NDBT_FAILED; - } - } - - check = pTrans->execute(NoCommit, AbortOnError); - if( check == -1 ) { - const NdbError err = pTrans->getNdbError(); - ERR(err); - closeTransaction(pNdb); - if (err.status == NdbError::TemporaryError){ - NdbSleep_MilliSleep(50); - continue; - } - return NDBT_FAILED; - } - - // Abort after 1-100 or 1-records rows - int ranVal = rand(); - int abortCount = ranVal % (records == 0 ? 100 : records); - bool abortTrans = false; - if (abort > 0){ - // Abort if abortCount is less then abortPercent - if (abortCount < abortPercent) - abortTrans = true; - } - - int rows = 0; - while((check = pOp->nextResult(true)) == 0){ - do { - rows++; - NdbOperation* pUp = pOp->updateCurrentTuple(); - if(pUp == 0){ - ERR(pTrans->getNdbError()); - closeTransaction(pNdb); - return NDBT_FAILED; - } - const int updates = calc.getUpdatesValue(&row) + 1; - const int r = calc.getIdValue(&row); - for(a = 0; agetPrimaryKey() == false){ - if(setValueForAttr(pUp, a, r, updates ) != 0){ - ERR(pTrans->getNdbError()); - closeTransaction(pNdb); - return NDBT_FAILED; - } - } - } - - if (rows == abortCount && abortTrans == true){ - g_info << "Scan is aborted" << endl; - // This scan should be aborted - closeTransaction(pNdb); - return NDBT_OK; - } - } while((check = pOp->nextResult(false)) == 0); - - if(check != -1){ - check = pTrans->execute(Commit, AbortOnError); - if(check != -1) - m_latest_gci = pTrans->getGCI(); - pTrans->restart(); - } - - const NdbError err = pTrans->getNdbError(); - if( check == -1 ) { - closeTransaction(pNdb); - ERR(err); - if (err.status == NdbError::TemporaryError){ - NdbSleep_MilliSleep(50); - goto restart; - } - return NDBT_FAILED; - } - } - - const NdbError err = pTrans->getNdbError(); - if( check == -1 ) { - closeTransaction(pNdb); - ERR(err); - if (err.status == NdbError::TemporaryError){ - NdbSleep_MilliSleep(50); - goto restart; - } - return NDBT_FAILED; - } - - closeTransaction(pNdb); - - g_info << rows << " rows have been updated" << endl; - return NDBT_OK; - } - return NDBT_FAILED; -} - int HugoTransactions::scanUpdateRecords(Ndb* pNdb, int records, From d1772b37bd23ae1fd61feb5a7592bb3d5276f726 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 29 Sep 2007 11:10:12 +0200 Subject: [PATCH 09/49] ndb - bug#30975 add even more tests storage/ndb/test/ndbapi/testSystemRestart.cpp: add more tests... storage/ndb/test/run-test/daily-basic-tests.txt: add more tests --- storage/ndb/test/ndbapi/testSystemRestart.cpp | 130 +++++++++++++++--- .../ndb/test/run-test/daily-basic-tests.txt | 32 +++++ 2 files changed, 141 insertions(+), 21 deletions(-) diff --git a/storage/ndb/test/ndbapi/testSystemRestart.cpp b/storage/ndb/test/ndbapi/testSystemRestart.cpp index e4f9c627f4c..2495bf15186 100644 --- a/storage/ndb/test/ndbapi/testSystemRestart.cpp +++ b/storage/ndb/test/ndbapi/testSystemRestart.cpp @@ -1220,6 +1220,30 @@ runBug24664(NDBT_Context* ctx, NDBT_Step* step) return result; } +int +runStopper(NDBT_Context* ctx, NDBT_Step* step) +{ + NdbRestarter restarter; + Uint32 stop = 0; +loop: + while (!ctx->isTestStopped() && + ((stop = ctx->getProperty("StopAbort", Uint32(0))) == 0)) + { + NdbSleep_MilliSleep(30); + } + + if (ctx->isTestStopped()) + { + return NDBT_OK; + } + + ndbout << "Killing in " << stop << "ms..." << flush; + NdbSleep_MilliSleep(stop); + restarter.restartAll(false, true, true); + ctx->setProperty("StopAbort", Uint32(0)); + goto loop; +} + int runSR_DD_1(NDBT_Context* ctx, NDBT_Step* step) { Ndb* pNdb = GETNDB(step); @@ -1229,6 +1253,7 @@ int runSR_DD_1(NDBT_Context* ctx, NDBT_Step* step) NdbRestarter restarter; NdbBackup backup(GETNDB(step)->getNodeId()+1); bool lcploop = ctx->getProperty("LCP", (unsigned)0); + bool all = ctx->getProperty("ALL", (unsigned)0); Uint32 i = 1; Uint32 backupId; @@ -1254,11 +1279,18 @@ int runSR_DD_1(NDBT_Context* ctx, NDBT_Step* step) ndbout << "Loading records..." << startFrom << endl; CHECK(hugoTrans.loadTable(pNdb, startFrom) == 0); - ndbout << "Making " << nodeId << " crash" << endl; - int kill[] = { 9999, 1000, 3000 }; - CHECK(restarter.dumpStateOneNode(nodeId, val, 2) == 0); - CHECK(restarter.dumpStateOneNode(nodeId, kill, 3) == 0); - + if (!all) + { + ndbout << "Making " << nodeId << " crash" << endl; + int kill[] = { 9999, 1000, 3000 }; + CHECK(restarter.dumpStateOneNode(nodeId, val, 2) == 0); + CHECK(restarter.dumpStateOneNode(nodeId, kill, 3) == 0); + } + else + { + ndbout << "Crashing cluster" << endl; + ctx->setProperty("StopAbort", 1000 + rand() % (3000 - 1000)); + } Uint64 end = NdbTick_CurrentMillisecond() + 4000; Uint32 row = startFrom; do { @@ -1268,11 +1300,17 @@ int runSR_DD_1(NDBT_Context* ctx, NDBT_Step* step) row += 1000; } while (NdbTick_CurrentMillisecond() < end); - ndbout << "Waiting for " << nodeId << " to restart" << endl; - CHECK(restarter.waitNodesNoStart(&nodeId, 1) == 0); - - ndbout << "Restarting cluster" << endl; - CHECK(restarter.restartAll(false, true, true) == 0); + if (!all) + { + ndbout << "Waiting for " << nodeId << " to restart" << endl; + CHECK(restarter.waitNodesNoStart(&nodeId, 1) == 0); + ndbout << "Restarting cluster" << endl; + CHECK(restarter.restartAll(false, true, true) == 0); + } + else + { + ndbout << "Waiting for cluster to restart" << endl; + } CHECK(restarter.waitClusterNoStart() == 0); CHECK(restarter.startAll() == 0); CHECK(restarter.waitClusterStarted() == 0); @@ -1297,7 +1335,7 @@ int runSR_DD_1(NDBT_Context* ctx, NDBT_Step* step) } ndbout << "runSR_DD_1 finished" << endl; - + ctx->stopTest(); return result; } @@ -1311,6 +1349,7 @@ int runSR_DD_2(NDBT_Context* ctx, NDBT_Step* step) NdbRestarter restarter; NdbBackup backup(GETNDB(step)->getNodeId()+1); bool lcploop = ctx->getProperty("LCP", (unsigned)0); + bool all = ctx->getProperty("ALL", (unsigned)0); Uint32 i = 1; Uint32 backupId; @@ -1331,10 +1370,18 @@ int runSR_DD_2(NDBT_Context* ctx, NDBT_Step* step) int nodeId = restarter.getDbNodeId(rand() % restarter.getNumDbNodes()); - ndbout << "Making " << nodeId << " crash" << endl; - int kill[] = { 9999, 3000, 10000 }; - CHECK(restarter.dumpStateOneNode(nodeId, val, 2) == 0); - CHECK(restarter.dumpStateOneNode(nodeId, kill, 3) == 0); + if (!all) + { + ndbout << "Making " << nodeId << " crash" << endl; + int kill[] = { 9999, 3000, 10000 }; + CHECK(restarter.dumpStateOneNode(nodeId, val, 2) == 0); + CHECK(restarter.dumpStateOneNode(nodeId, kill, 3) == 0); + } + else + { + ndbout << "Crashing cluster" << endl; + ctx->setProperty("StopAbort", 1000 + rand() % (3000 - 1000)); + } Uint64 end = NdbTick_CurrentMillisecond() + 11000; Uint32 row = startFrom; @@ -1346,11 +1393,18 @@ int runSR_DD_2(NDBT_Context* ctx, NDBT_Step* step) break; } while (NdbTick_CurrentMillisecond() < end); - ndbout << "Waiting for " << nodeId << " to restart" << endl; - CHECK(restarter.waitNodesNoStart(&nodeId, 1) == 0); - - ndbout << "Restarting cluster" << endl; - CHECK(restarter.restartAll(false, true, true) == 0); + if (!all) + { + ndbout << "Waiting for " << nodeId << " to restart" << endl; + CHECK(restarter.waitNodesNoStart(&nodeId, 1) == 0); + ndbout << "Restarting cluster" << endl; + CHECK(restarter.restartAll(false, true, true) == 0); + } + else + { + ndbout << "Waiting for cluster to restart" << endl; + } + CHECK(restarter.waitClusterNoStart() == 0); CHECK(restarter.startAll() == 0); CHECK(restarter.waitClusterStarted() == 0); @@ -1369,7 +1423,7 @@ int runSR_DD_2(NDBT_Context* ctx, NDBT_Step* step) } ndbout << "runSR_DD_2 finished" << endl; - + ctx->stopTest(); return result; } @@ -1554,12 +1608,29 @@ TESTCASE("Bug24664", FINALIZER(runClearTable); } TESTCASE("SR_DD_1", "") +{ + TC_PROPERTY("ALL", 1); + INITIALIZER(runWaitStarted); + STEP(runStopper); + STEP(runSR_DD_1); + FINALIZER(runClearTable); +} +TESTCASE("SR_DD_1b", "") { INITIALIZER(runWaitStarted); STEP(runSR_DD_1); FINALIZER(runClearTable); } TESTCASE("SR_DD_1_LCP", "") +{ + TC_PROPERTY("ALL", 1); + TC_PROPERTY("LCP", 1); + INITIALIZER(runWaitStarted); + STEP(runStopper); + STEP(runSR_DD_1); + FINALIZER(runClearTable); +} +TESTCASE("SR_DD_1b_LCP", "") { TC_PROPERTY("LCP", 1); INITIALIZER(runWaitStarted); @@ -1567,12 +1638,29 @@ TESTCASE("SR_DD_1_LCP", "") FINALIZER(runClearTable); } TESTCASE("SR_DD_2", "") +{ + TC_PROPERTY("ALL", 1); + INITIALIZER(runWaitStarted); + STEP(runStopper); + STEP(runSR_DD_2); + FINALIZER(runClearTable); +} +TESTCASE("SR_DD_2b", "") { INITIALIZER(runWaitStarted); STEP(runSR_DD_2); FINALIZER(runClearTable); } TESTCASE("SR_DD_2_LCP", "") +{ + TC_PROPERTY("ALL", 1); + TC_PROPERTY("LCP", 1); + INITIALIZER(runWaitStarted); + STEP(runStopper); + STEP(runSR_DD_2); + FINALIZER(runClearTable); +} +TESTCASE("SR_DD_2b_LCP", "") { TC_PROPERTY("LCP", 1); INITIALIZER(runWaitStarted); diff --git a/storage/ndb/test/run-test/daily-basic-tests.txt b/storage/ndb/test/run-test/daily-basic-tests.txt index 200b258280a..2c654a13bcf 100644 --- a/storage/ndb/test/run-test/daily-basic-tests.txt +++ b/storage/ndb/test/run-test/daily-basic-tests.txt @@ -874,31 +874,63 @@ max-time: 1500 cmd: testSystemRestart args: -n SR_DD_1 D1 +max-time: 1500 +cmd: testSystemRestart +args: -n SR_DD_1b D1 + max-time: 1500 cmd: testSystemRestart args: -n SR_DD_1 D2 +max-time: 1500 +cmd: testSystemRestart +args: -n SR_DD_1b D2 + max-time: 1500 cmd: testSystemRestart args: -n SR_DD_1_LCP D1 +max-time: 1500 +cmd: testSystemRestart +args: -n SR_DD_1b_LCP D1 + max-time: 1500 cmd: testSystemRestart args: -n SR_DD_1_LCP D2 +max-time: 1500 +cmd: testSystemRestart +args: -n SR_DD_1b_LCP D2 + max-time: 1500 cmd: testSystemRestart args: -n SR_DD_2 D1 +max-time: 1500 +cmd: testSystemRestart +args: -n SR_DD_2b D1 + max-time: 1500 cmd: testSystemRestart args: -n SR_DD_2 D2 +max-time: 1500 +cmd: testSystemRestart +args: -n SR_DD_2b D2 + max-time: 1500 cmd: testSystemRestart args: -n SR_DD_2_LCP D1 +max-time: 1500 +cmd: testSystemRestart +args: -n SR_DD_2b_LCP D1 + max-time: 1500 cmd: testSystemRestart args: -n SR_DD_2_LCP D2 +max-time: 1500 +cmd: testSystemRestart +args: -n SR_DD_2b_LCP D2 + From f263c2ffce3c3e2acf6c5ef958ef3e0b1598b5e1 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 1 Oct 2007 14:32:22 +1000 Subject: [PATCH 10/49] remove debug printout ndb/src/kernel/blocks/dbtc/DbtcMain.cpp: remove accidently left in printout --- ndb/src/kernel/blocks/dbtc/DbtcMain.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp index 9697594d7d2..91adae183f4 100644 --- a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp +++ b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp @@ -6280,7 +6280,6 @@ void Dbtc::timeOutLoopStartLab(Signal* signal, Uint32 api_con_ptr) if (api_timer != 0) { Uint32 error= ZTIME_OUT_ERROR; time_out_value= time_out_param + (ndb_rand() & mask_value); - ndbout_c("timeout value: %u %u",time_out_value, time_out_value-time_out_param); if (unlikely(old_mask_value)) // abort during single user mode { apiConnectptr.i = api_con_ptr; From c19a8c0631daf263893672c70181cdc246e171c9 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 2 Oct 2007 13:36:13 +0200 Subject: [PATCH 11/49] Bug#25817 UPDATE IGNORE doesn't check write_set when checking unique indexes: Added checks --- mysql-test/r/ndb_update.result | 8 +++++++ mysql-test/t/ndb_update.test | 5 +++++ sql/ha_ndbcluster.cc | 40 ++++++++++++++++++++++++++++++---- sql/ha_ndbcluster.h | 9 +++++++- 4 files changed, 57 insertions(+), 5 deletions(-) diff --git a/mysql-test/r/ndb_update.result b/mysql-test/r/ndb_update.result index d75f82172ae..7848a47bcef 100644 --- a/mysql-test/r/ndb_update.result +++ b/mysql-test/r/ndb_update.result @@ -39,4 +39,12 @@ pk1 b c 10 0 0 12 2 2 14 1 1 +create unique index ib on t1(b); +update t1 set c = 4 where pk1 = 12; +update ignore t1 set b = 55 where pk1 = 14; +select * from t1 order by pk1; +pk1 b c +10 0 0 +12 2 4 +14 55 1 DROP TABLE IF EXISTS t1; diff --git a/mysql-test/t/ndb_update.test b/mysql-test/t/ndb_update.test index ebcc6995d74..0f8793300e0 100644 --- a/mysql-test/t/ndb_update.test +++ b/mysql-test/t/ndb_update.test @@ -33,6 +33,11 @@ UPDATE IGNORE t1 set pk1 = 1, c = 2 where pk1 = 4; select * from t1 order by pk1; UPDATE t1 set pk1 = pk1 + 10; select * from t1 order by pk1; +# bug#25817 +create unique index ib on t1(b); +update t1 set c = 4 where pk1 = 12; +update ignore t1 set b = 55 where pk1 = 14; +select * from t1 order by pk1; --disable_warnings DROP TABLE IF EXISTS t1; diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index b74b04f4238..90b8e77153c 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -1356,6 +1356,30 @@ int ha_ndbcluster::set_primary_key_from_record(NdbOperation *op, const byte *rec DBUG_RETURN(0); } +bool ha_ndbcluster::check_index_fields_in_write_set(uint keyno) +{ + KEY* key_info= table->key_info + keyno; + KEY_PART_INFO* key_part= key_info->key_part; + KEY_PART_INFO* end= key_part+key_info->key_parts; + uint i; + DBUG_ENTER("check_index_fields_in_write_set"); + + if (m_retrieve_all_fields) + { + DBUG_RETURN(true); + } + for (i= 0; key_part != end; key_part++, i++) + { + Field* field= key_part->field; + if (field->query_id != current_thd->query_id) + { + DBUG_RETURN(false); + } + } + + DBUG_RETURN(true); +} + int ha_ndbcluster::set_index_key_from_record(NdbOperation *op, const byte *record, uint keyno) { KEY* key_info= table->key_info + keyno; @@ -1643,7 +1667,8 @@ check_null_in_record(const KEY* key_info, const byte *record) * primary key or unique index values */ -int ha_ndbcluster::peek_indexed_rows(const byte *record, bool check_pk) +int ha_ndbcluster::peek_indexed_rows(const byte *record, + NDB_WRITE_OP write_op) { NdbTransaction *trans= m_active_trans; NdbOperation *op; @@ -1656,7 +1681,7 @@ int ha_ndbcluster::peek_indexed_rows(const byte *record, bool check_pk) (NdbOperation::LockMode)get_ndb_lock_type(m_lock.type); first= NULL; - if (check_pk && table->s->primary_key != MAX_KEY) + if (write_op != NDB_UPDATE && table->s->primary_key != MAX_KEY) { /* * Fetch any row with colliding primary key @@ -1690,6 +1715,12 @@ int ha_ndbcluster::peek_indexed_rows(const byte *record, bool check_pk) DBUG_PRINT("info", ("skipping check for key with NULL")); continue; } + if (write_op != NDB_INSERT && !check_index_fields_in_write_set(i)) + { + DBUG_PRINT("info", ("skipping check for key %u not in write_set", i)); + continue; + } + NdbIndexOperation *iop; NDBINDEX *unique_index = (NDBINDEX *) m_index[i].unique_index; key_part= key_info->key_part; @@ -2268,7 +2299,7 @@ int ha_ndbcluster::write_row(byte *record) start_bulk_insert will set parameters to ensure that each write_row is committed individually */ - int peek_res= peek_indexed_rows(record, true); + int peek_res= peek_indexed_rows(record, NDB_INSERT); if (!peek_res) { @@ -2456,7 +2487,8 @@ int ha_ndbcluster::update_row(const byte *old_data, byte *new_data) if (m_ignore_dup_key && (thd->lex->sql_command == SQLCOM_UPDATE || thd->lex->sql_command == SQLCOM_UPDATE_MULTI)) { - int peek_res= peek_indexed_rows(new_data, pk_update); + NDB_WRITE_OP write_op= (pk_update) ? NDB_PK_UPDATE : NDB_UPDATE; + int peek_res= peek_indexed_rows(new_data, write_op); if (!peek_res) { diff --git a/sql/ha_ndbcluster.h b/sql/ha_ndbcluster.h index 81cbdcd8fea..324969ad374 100644 --- a/sql/ha_ndbcluster.h +++ b/sql/ha_ndbcluster.h @@ -59,6 +59,12 @@ typedef struct ndb_index_data { bool null_in_unique_index; } NDB_INDEX_DATA; +typedef enum ndb_write_op { + NDB_INSERT = 0, + NDB_UPDATE = 1, + NDB_PK_UPDATE = 2 +} NDB_WRITE_OP; + typedef struct st_ndbcluster_share { THR_LOCK lock; pthread_mutex_t mutex; @@ -251,7 +257,7 @@ private: const NdbOperation *first, const NdbOperation *last, uint errcode); - int peek_indexed_rows(const byte *record, bool check_pk); + int peek_indexed_rows(const byte *record, NDB_WRITE_OP write_op); int unique_index_read(const byte *key, uint key_len, byte *buf); int ordered_index_scan(const key_range *start_key, @@ -286,6 +292,7 @@ private: int get_ndb_blobs_value(NdbBlob *last_ndb_blob, my_ptrdiff_t ptrdiff); int set_primary_key(NdbOperation *op, const byte *key); int set_primary_key_from_record(NdbOperation *op, const byte *record); + bool check_index_fields_in_write_set(uint keyno); int set_index_key_from_record(NdbOperation *op, const byte *record, uint keyno); int set_bounds(NdbIndexScanOperation*, const key_range *keys[2], uint= 0); From 085eac750219572e65bc6d600f6dcd7cfb133663 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 3 Oct 2007 16:16:48 +1000 Subject: [PATCH 12/49] [PATCH] BUG#29565 managment server can log entries multiple times after mgmd restart Close the event log on shutdown of mgmd (in stopEventLog()) Index: ndb-work/ndb/src/mgmsrv/MgmtSrvr.cpp =================================================================== ndb/src/mgmsrv/MgmtSrvr.cpp: BUG#29565 managment server can log entries multiple times after mgmd restart --- ndb/src/mgmsrv/MgmtSrvr.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp index 409694fead1..d68f42cbbb4 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -227,10 +227,10 @@ MgmtSrvr::startEventLog() } } -void -MgmtSrvr::stopEventLog() +void +MgmtSrvr::stopEventLog() { - // Nothing yet + g_eventLogger.close(); } class ErrorItem From 0114d06c29318fa867adcea3ea3024b507648c33 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 3 Oct 2007 17:25:46 +1000 Subject: [PATCH 13/49] [PATCH] BUG#25064 Remove newlines from cluster log Index: ndb/storage/ndb/src/common/debugger/EventLogger.cpp =================================================================== storage/ndb/src/common/debugger/EventLogger.cpp: BUG#25064 Remove newlines from cluster log --- storage/ndb/src/common/debugger/EventLogger.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/storage/ndb/src/common/debugger/EventLogger.cpp b/storage/ndb/src/common/debugger/EventLogger.cpp index 0964a54f906..bcc0d4a969c 100644 --- a/storage/ndb/src/common/debugger/EventLogger.cpp +++ b/storage/ndb/src/common/debugger/EventLogger.cpp @@ -498,9 +498,9 @@ void getTextTransReportCounters(QQQQ) { // ------------------------------------------------------------------- BaseString::snprintf(m_text, m_text_len, "Trans. Count = %u, Commit Count = %u, " - "Read Count = %u, Simple Read Count = %u,\n" + "Read Count = %u, Simple Read Count = %u, " "Write Count = %u, AttrInfo Count = %u, " - "Concurrent Operations = %u, Abort Count = %u\n" + "Concurrent Operations = %u, Abort Count = %u" " Scans: %u Range scans: %u", theData[1], theData[2], @@ -797,9 +797,9 @@ void getTextBackupFailedToStart(QQQQ) { } void getTextBackupCompleted(QQQQ) { BaseString::snprintf(m_text, m_text_len, - "Backup %u started from node %u completed\n" - " StartGCP: %u StopGCP: %u\n" - " #Records: %u #LogRecords: %u\n" + "Backup %u started from node %u completed." + " StartGCP: %u StopGCP: %u" + " #Records: %u #LogRecords: %u" " Data: %u bytes Log: %u bytes", theData[2], refToNode(theData[1]), theData[3], theData[4], theData[6], theData[8], From 2c139b348aba1ed158e93573566bd6bd58d24fa2 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 3 Oct 2007 17:26:03 +1000 Subject: [PATCH 14/49] [PATCH] BUG#25064 make formatting of key=value consistent in getTextTransReportCounters Index: ndb/storage/ndb/src/common/debugger/EventLogger.cpp =================================================================== storage/ndb/src/common/debugger/EventLogger.cpp: BUG#25064 make formatting of key=value consistent in getTextTransReportCounters --- storage/ndb/src/common/debugger/EventLogger.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/ndb/src/common/debugger/EventLogger.cpp b/storage/ndb/src/common/debugger/EventLogger.cpp index bcc0d4a969c..068b0c6ac18 100644 --- a/storage/ndb/src/common/debugger/EventLogger.cpp +++ b/storage/ndb/src/common/debugger/EventLogger.cpp @@ -501,7 +501,7 @@ void getTextTransReportCounters(QQQQ) { "Read Count = %u, Simple Read Count = %u, " "Write Count = %u, AttrInfo Count = %u, " "Concurrent Operations = %u, Abort Count = %u" - " Scans: %u Range scans: %u", + " Scans = %u Range scans = %u", theData[1], theData[2], theData[3], From 060588696e5fcad6039a9145661e1a9cccf9d2d3 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 3 Oct 2007 17:26:17 +1000 Subject: [PATCH 15/49] [PATCH] BUG#29509 ndb_mgm help needs to list the -a option for DN restart Index: ndb/storage/ndb/src/mgmclient/CommandInterpreter.cpp =================================================================== storage/ndb/src/mgmclient/CommandInterpreter.cpp: BUG#29509 ndb_mgm help needs to list the -a option for DN restart --- storage/ndb/src/mgmclient/CommandInterpreter.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/storage/ndb/src/mgmclient/CommandInterpreter.cpp b/storage/ndb/src/mgmclient/CommandInterpreter.cpp index 875cc2771ae..9e8910c9649 100644 --- a/storage/ndb/src/mgmclient/CommandInterpreter.cpp +++ b/storage/ndb/src/mgmclient/CommandInterpreter.cpp @@ -269,8 +269,8 @@ static const char* helpText = "CLUSTERLOG TOGGLE [] ... Toggle severity filter on/off\n" "CLUSTERLOG INFO Print cluster log information\n" " START Start data node (started with -n)\n" -" RESTART [-n] [-i] Restart data or management server node\n" -" STOP Stop data or management server node\n" +" RESTART [-n] [-i] [-a] Restart data or management server node\n" +" STOP [-a] Stop data or management server node\n" "ENTER SINGLE USER MODE Enter single user mode\n" "EXIT SINGLE USER MODE Exit single user mode\n" " STATUS Print status\n" @@ -434,7 +434,7 @@ static const char* helpTextRestart = " NDB Cluster -- Management Client -- Help for RESTART command\n" "---------------------------------------------------------------------------\n" "RESTART Restart data or management server node\n\n" -" RESTART [-n] [-i] \n" +" RESTART [-n] [-i] [-a]\n" " Restart the data or management node (or All data nodes).\n\n" " -n (--nostart) restarts the node but does not\n" " make it join the cluster. Use ' START' to\n" @@ -445,6 +445,7 @@ static const char* helpTextRestart = " in the same node group during start up.\n\n" " Consult the documentation before using -i.\n\n" " INCORRECT USE OF -i WILL CAUSE DATA LOSS!\n" +" -a Aborts the node, not syncing GCP.\n" ; static const char* helpTextStop = @@ -452,10 +453,11 @@ static const char* helpTextStop = " NDB Cluster -- Management Client -- Help for STOP command\n" "---------------------------------------------------------------------------\n" "STOP Stop data or management server node\n\n" -" STOP Stop the data or management server node .\n\n" +" STOP [-a] Stop the data or management server node .\n\n" " ALL STOP will just stop all data nodes.\n\n" " If you desire to also shut down management servers,\n" -" use SHUTDOWN instead.\n" +" use SHUTDOWN instead.\n" +" -a Aborts the node, not syncing GCP.\n" ; static const char* helpTextEnterSingleUserMode = From cabf7d7fec01113ae90ea62a2065d895904f0d39 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 3 Oct 2007 09:29:10 +0200 Subject: [PATCH 16/49] Removed tabs --- sql/ha_ndbcluster.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 90b8e77153c..d35aa93d5d3 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -1712,12 +1712,12 @@ int ha_ndbcluster::peek_indexed_rows(const byte *record, */ if (check_null_in_record(key_info, record)) { - DBUG_PRINT("info", ("skipping check for key with NULL")); + DBUG_PRINT("info", ("skipping check for key with NULL")); continue; } if (write_op != NDB_INSERT && !check_index_fields_in_write_set(i)) { - DBUG_PRINT("info", ("skipping check for key %u not in write_set", i)); + DBUG_PRINT("info", ("skipping check for key %u not in write_set", i)); continue; } From d2a896802f830e7d43ecdefd373b05001374f5ed Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 3 Oct 2007 09:54:33 +0200 Subject: [PATCH 17/49] Bug#25817 UPDATE IGNORE doesn't check write_set when checking unique indexes: Post merge 5.0->5.1 --- sql/ha_ndbcluster.cc | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 69512e5e7c7..b372849a183 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -1651,14 +1651,10 @@ bool ha_ndbcluster::check_index_fields_in_write_set(uint keyno) uint i; DBUG_ENTER("check_index_fields_in_write_set"); - if (m_retrieve_all_fields) - { - DBUG_RETURN(true); - } for (i= 0; key_part != end; key_part++, i++) { Field* field= key_part->field; - if (field->query_id != current_thd->query_id) + if (!bitmap_is_set(table->write_set, field->field_index)) { DBUG_RETURN(false); } @@ -1985,7 +1981,7 @@ check_null_in_record(const KEY* key_info, const uchar *record) * primary key or unique index values */ -int ha_ndbcluster::peek_indexed_rows(const byte *record, +int ha_ndbcluster::peek_indexed_rows(const uchar *record, NDB_WRITE_OP write_op) { NdbTransaction *trans= m_active_trans; @@ -1998,7 +1994,7 @@ int ha_ndbcluster::peek_indexed_rows(const byte *record, NdbOperation::LockMode lm= (NdbOperation::LockMode)get_ndb_lock_type(m_lock.type); first= NULL; - if (check_pk && table->s->primary_key != MAX_KEY) + if (write_op != NDB_UPDATE && table->s->primary_key != MAX_KEY) { /* * Fetch any row with colliding primary key @@ -2048,6 +2044,11 @@ int ha_ndbcluster::peek_indexed_rows(const byte *record, DBUG_PRINT("info", ("skipping check for key with NULL")); continue; } + if (write_op != NDB_INSERT && !check_index_fields_in_write_set(i)) + { + DBUG_PRINT("info", ("skipping check for key %u not in write_set", i)); + continue; + } NdbIndexOperation *iop; const NDBINDEX *unique_index = m_index[i].unique_index; key_part= key_info->key_part; From d0d6fb96a634fcb894522d13a366edf073f1e67f Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 4 Oct 2007 11:32:49 +0200 Subject: [PATCH 18/49] ndb - bug#29390: if ScanFilter is too large, abort or optionally discard it mysql-test/r/ndb_condition_pushdown.result: if ScanFilter is too large, abort or optionaly discard it mysql-test/t/ndb_condition_pushdown.test: if ScanFilter is too large, abort or optionaly discard it ndb/include/kernel/signaldata/ScanTab.hpp: if ScanFilter is too large, abort or optionaly discard it ndb/include/ndbapi/Ndb.hpp: if ScanFilter is too large, abort or optionaly discard it ndb/include/ndbapi/NdbScanFilter.hpp: if ScanFilter is too large, abort or optionaly discard it ndb/include/ndbapi/ndbapi_limits.h: if ScanFilter is too large, abort or optionaly discard it ndb/src/ndbapi/NdbScanFilter.cpp: if ScanFilter is too large, abort or optionaly discard it ndb/src/ndbapi/NdbScanOperation.cpp: if ScanFilter is too large, abort or optionaly discard it ndb/src/ndbapi/ndberror.c: if ScanFilter is too large, abort or optionaly discard it sql/ha_ndbcluster_cond.cc: if ScanFilter is too large, abort or optionaly discard it --- mysql-test/r/ndb_condition_pushdown.result | 22 + mysql-test/t/ndb_condition_pushdown.test | 1025 ++++++++++++++++++++ ndb/include/kernel/signaldata/ScanTab.hpp | 1 + ndb/include/ndbapi/Ndb.hpp | 1 + ndb/include/ndbapi/NdbScanFilter.hpp | 27 +- ndb/include/ndbapi/ndbapi_limits.h | 2 + ndb/src/ndbapi/NdbScanFilter.cpp | 208 +++- ndb/src/ndbapi/NdbScanOperation.cpp | 4 + ndb/src/ndbapi/ndberror.c | 3 +- sql/ha_ndbcluster_cond.cc | 20 +- 10 files changed, 1287 insertions(+), 26 deletions(-) diff --git a/mysql-test/r/ndb_condition_pushdown.result b/mysql-test/r/ndb_condition_pushdown.result index 6012c9b6969..d49c0cd983e 100644 --- a/mysql-test/r/ndb_condition_pushdown.result +++ b/mysql-test/r/ndb_condition_pushdown.result @@ -1888,5 +1888,27 @@ set engine_condition_pushdown = 1; SELECT fname, lname FROM t1 WHERE (fname like 'Y%') or (lname like 'F%'); fname lname Young Foo +drop table t1; +create table t1 (a int, b int, c int, d int, primary key using hash(a)) +engine=ndbcluster; +insert into t1 values (10,1,100,0+0x1111); +insert into t1 values (20,2,200,0+0x2222); +insert into t1 values (30,3,300,0+0x3333); +insert into t1 values (40,4,400,0+0x4444); +insert into t1 values (50,5,500,0+0x5555); +set engine_condition_pushdown = on; +select a,b,d from t1 +where b in (0,1,2,5) +order by b; +a b d +10 1 4369 +20 2 8738 +50 5 21845 +a b d +10 1 4369 +20 2 8738 +50 5 21845 +Warnings: +Warning 4294 Scan filter is too large, discarded set engine_condition_pushdown = @old_ecpd; DROP TABLE t1,t2,t3,t4,t5; diff --git a/mysql-test/t/ndb_condition_pushdown.test b/mysql-test/t/ndb_condition_pushdown.test index 748c26e2a9a..b5b7e41fb21 100644 --- a/mysql-test/t/ndb_condition_pushdown.test +++ b/mysql-test/t/ndb_condition_pushdown.test @@ -1718,5 +1718,1030 @@ SELECT fname, lname FROM t1 WHERE (fname like 'Y%') or (lname like 'F%'); set engine_condition_pushdown = 1; SELECT fname, lname FROM t1 WHERE (fname like 'Y%') or (lname like 'F%'); +# bug#29390 (scan filter is too large, discarded) + +drop table t1; + +create table t1 (a int, b int, c int, d int, primary key using hash(a)) + engine=ndbcluster; + +insert into t1 values (10,1,100,0+0x1111); +insert into t1 values (20,2,200,0+0x2222); +insert into t1 values (30,3,300,0+0x3333); +insert into t1 values (40,4,400,0+0x4444); +insert into t1 values (50,5,500,0+0x5555); + +set engine_condition_pushdown = on; + +select a,b,d from t1 + where b in (0,1,2,5) + order by b; + +--disable_query_log +select a,b,d from t1 + where b in ( +0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2, +0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2,5,0,1,2, +0,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_query_log + set engine_condition_pushdown = @old_ecpd; DROP TABLE t1,t2,t3,t4,t5; diff --git a/ndb/include/kernel/signaldata/ScanTab.hpp b/ndb/include/kernel/signaldata/ScanTab.hpp index 15a022e2cba..38ec4cccf7b 100644 --- a/ndb/include/kernel/signaldata/ScanTab.hpp +++ b/ndb/include/kernel/signaldata/ScanTab.hpp @@ -46,6 +46,7 @@ public: * Length of signal */ STATIC_CONST( StaticLength = 11 ); + STATIC_CONST( MaxTotalAttrInfo = 0xFFFF ); private: diff --git a/ndb/include/ndbapi/Ndb.hpp b/ndb/include/ndbapi/Ndb.hpp index f83db77739e..01bc899b4e1 100644 --- a/ndb/include/ndbapi/Ndb.hpp +++ b/ndb/include/ndbapi/Ndb.hpp @@ -1052,6 +1052,7 @@ class Ndb friend class NdbDictInterface; friend class NdbBlob; friend class NdbImpl; + friend class NdbScanFilterImpl; #endif public: diff --git a/ndb/include/ndbapi/NdbScanFilter.hpp b/ndb/include/ndbapi/NdbScanFilter.hpp index 1ef62558560..02fcb6215ba 100644 --- a/ndb/include/ndbapi/NdbScanFilter.hpp +++ b/ndb/include/ndbapi/NdbScanFilter.hpp @@ -17,6 +17,7 @@ #define NDB_SCAN_FILTER_HPP #include +#include /** * @class NdbScanFilter @@ -31,8 +32,13 @@ public: /** * Constructor * @param op The NdbOperation that the filter belongs to (is applied to). + * @param abort_on_too_large abort transaction on filter too large + * default: true + * @param max_size Maximum size of generated filter in words */ - NdbScanFilter(class NdbOperation * op); + NdbScanFilter(class NdbOperation * op, + bool abort_on_too_large = true, + Uint32 max_size = NDB_MAX_SCANFILTER_SIZE_IN_WORDS); ~NdbScanFilter(); /** @@ -166,6 +172,25 @@ public: /** @} *********************************************************************/ #endif + enum Error { + FilterTooLarge = 4294 + }; + + /** + * Get filter level error. + * + * Most errors are set only on operation level, and they abort the + * transaction. The error FilterTooLarge is set on filter level and + * by default it propagates to operation level and also aborts the + * transaction. + * + * If option abort_on_too_large is set to false, then FilterTooLarge + * does not propagate. One can then either ignore this error (in + * which case no filtering is done) or try to define a new filter + * immediately. + */ + const class NdbError & getNdbError() const; + private: #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL friend class NdbScanFilterImpl; diff --git a/ndb/include/ndbapi/ndbapi_limits.h b/ndb/include/ndbapi/ndbapi_limits.h index 63399e4bd0a..e283913d059 100644 --- a/ndb/include/ndbapi/ndbapi_limits.h +++ b/ndb/include/ndbapi/ndbapi_limits.h @@ -26,4 +26,6 @@ #define NDB_MAX_TUPLE_SIZE (NDB_MAX_TUPLE_SIZE_IN_WORDS*4) #define NDB_MAX_ACTIVE_EVENTS 100 +#define NDB_MAX_SCANFILTER_SIZE_IN_WORDS 50000 + #endif diff --git a/ndb/src/ndbapi/NdbScanFilter.cpp b/ndb/src/ndbapi/NdbScanFilter.cpp index fb47772fdea..624122b5c55 100644 --- a/ndb/src/ndbapi/NdbScanFilter.cpp +++ b/ndb/src/ndbapi/NdbScanFilter.cpp @@ -14,11 +14,14 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include +#include #include #include "NdbDictionaryImpl.hpp" #include #include #include +#include +#include "NdbApiSignal.hpp" #ifdef VM_TRACE #include @@ -52,14 +55,37 @@ public: int cond_col_const(Interpreter::BinaryCondition, Uint32 attrId, const void * value, Uint32 len); + + bool m_abort_on_too_large; + + NdbOperation::OperationStatus m_initial_op_status; + Uint32 m_initial_AI_size; + Uint32 m_max_size; + + Uint32 get_size() { + assert(m_operation->theTotalCurrAI_Len >= m_initial_AI_size); + return m_operation->theTotalCurrAI_Len - m_initial_AI_size; + } + bool check_size() { + if (get_size() <= m_max_size) + return true; + handle_filter_too_large(); + return false; + } + void handle_filter_too_large(); + + NdbError m_error; }; const Uint32 LabelExit = ~0; -NdbScanFilter::NdbScanFilter(class NdbOperation * op) +NdbScanFilter::NdbScanFilter(class NdbOperation * op, + bool abort_on_too_large, + Uint32 max_size) : m_impl(* new NdbScanFilterImpl()) { + DBUG_ENTER("NdbScanFilter::NdbScanFilter"); m_impl.m_current.m_group = (NdbScanFilter::Group)0; m_impl.m_current.m_popCount = 0; m_impl.m_current.m_ownLabel = 0; @@ -69,6 +95,21 @@ NdbScanFilter::NdbScanFilter(class NdbOperation * op) m_impl.m_latestAttrib = ~0; m_impl.m_operation = op; m_impl.m_negative = 0; + + DBUG_PRINT("info", ("op status: %d tot AI: %u in curr: %u", + op->theStatus, + op->theTotalCurrAI_Len, op->theAI_LenInCurrAI)); + + m_impl.m_abort_on_too_large = abort_on_too_large; + + m_impl.m_initial_op_status = op->theStatus; + m_impl.m_initial_AI_size = op->theTotalCurrAI_Len; + if (max_size > NDB_MAX_SCANFILTER_SIZE_IN_WORDS) + max_size = NDB_MAX_SCANFILTER_SIZE_IN_WORDS; + m_impl.m_max_size = max_size; + + m_impl.m_error.code = 0; + DBUG_VOID_RETURN; } NdbScanFilter::~NdbScanFilter(){ @@ -200,30 +241,38 @@ NdbScanFilter::end(){ switch(tmp.m_group){ case NdbScanFilter::AND: if(tmp.m_trueLabel == (Uint32)~0){ - m_impl.m_operation->interpret_exit_ok(); + if (m_impl.m_operation->interpret_exit_ok() == -1) + return -1; } else { - m_impl.m_operation->branch_label(tmp.m_trueLabel); + if (m_impl.m_operation->branch_label(tmp.m_trueLabel) == -1) + return -1; } break; case NdbScanFilter::NAND: if(tmp.m_trueLabel == (Uint32)~0){ - m_impl.m_operation->interpret_exit_nok(); + if (m_impl.m_operation->interpret_exit_nok() == -1) + return -1; } else { - m_impl.m_operation->branch_label(tmp.m_falseLabel); + if (m_impl.m_operation->branch_label(tmp.m_falseLabel) == -1) + return -1; } break; case NdbScanFilter::OR: if(tmp.m_falseLabel == (Uint32)~0){ - m_impl.m_operation->interpret_exit_nok(); + if (m_impl.m_operation->interpret_exit_nok() == -1) + return -1; } else { - m_impl.m_operation->branch_label(tmp.m_falseLabel); + if (m_impl.m_operation->branch_label(tmp.m_falseLabel) == -1) + return -1; } break; case NdbScanFilter::NOR: if(tmp.m_falseLabel == (Uint32)~0){ - m_impl.m_operation->interpret_exit_ok(); + if (m_impl.m_operation->interpret_exit_ok() == -1) + return -1; } else { - m_impl.m_operation->branch_label(tmp.m_trueLabel); + if (m_impl.m_operation->branch_label(tmp.m_trueLabel) == -1) + return -1; } break; default: @@ -231,24 +280,29 @@ NdbScanFilter::end(){ return -1; } - m_impl.m_operation->def_label(tmp.m_ownLabel); + if (m_impl.m_operation->def_label(tmp.m_ownLabel) == -1) + return -1; if(m_impl.m_stack.size() == 0){ switch(tmp.m_group){ case NdbScanFilter::AND: case NdbScanFilter::NOR: - m_impl.m_operation->interpret_exit_nok(); + if (m_impl.m_operation->interpret_exit_nok() == -1) + return -1; break; case NdbScanFilter::OR: case NdbScanFilter::NAND: - m_impl.m_operation->interpret_exit_ok(); + if (m_impl.m_operation->interpret_exit_ok() == -1) + return -1; break; default: m_impl.m_operation->setErrorCodeAbort(4260); return -1; } } - + + if (!m_impl.check_size()) + return -1; return 0; } @@ -261,10 +315,16 @@ NdbScanFilter::istrue(){ } if(m_impl.m_current.m_trueLabel == (Uint32)~0){ - return m_impl.m_operation->interpret_exit_ok(); + if (m_impl.m_operation->interpret_exit_ok() == -1) + return -1; } else { - return m_impl.m_operation->branch_label(m_impl.m_current.m_trueLabel); + if (m_impl.m_operation->branch_label(m_impl.m_current.m_trueLabel) == -1) + return -1; } + + if (!m_impl.check_size()) + return -1; + return 0; } int @@ -276,10 +336,16 @@ NdbScanFilter::isfalse(){ } if(m_impl.m_current.m_falseLabel == (Uint32)~0){ - return m_impl.m_operation->interpret_exit_nok(); + if (m_impl.m_operation->interpret_exit_nok() == -1) + return -1; } else { - return m_impl.m_operation->branch_label(m_impl.m_current.m_falseLabel); + if (m_impl.m_operation->branch_label(m_impl.m_current.m_falseLabel) == -1) + return -1; } + + if (!m_impl.check_size()) + return -1; + return 0; } @@ -330,7 +396,11 @@ NdbScanFilterImpl::cond_col(Interpreter::UnaryCondition op, Uint32 AttrId){ } Branch1 branch = table2[op].m_branches[m_current.m_group]; - (m_operation->* branch)(AttrId, m_current.m_ownLabel); + if ((m_operation->* branch)(AttrId, m_current.m_ownLabel) == -1) + return -1; + + if (!check_size()) + return -1; return 0; } @@ -463,8 +533,12 @@ NdbScanFilterImpl::cond_col_const(Interpreter::BinaryCondition op, return -1; } - int ret = (m_operation->* branch)(AttrId, value, len, false, m_current.m_ownLabel); - return ret; + if ((m_operation->* branch)(AttrId, value, len, false, m_current.m_ownLabel) == -1) + return -1; + + if (!check_size()) + return -1; + return 0; } int @@ -490,7 +564,99 @@ NdbScanFilter::cmp(BinaryCondition cond, int ColId, return m_impl.cond_col_const(Interpreter::NOT_LIKE, ColId, val, len); } return -1; -} +} + +void +NdbScanFilterImpl::handle_filter_too_large() +{ + DBUG_ENTER("NdbScanFilterImpl::handle_filter_too_large"); + + NdbOperation* const op = m_operation; + m_error.code = NdbScanFilter::FilterTooLarge; + if (m_abort_on_too_large) + op->setErrorCodeAbort(m_error.code); + + /* + * Possible interpreted parts at this point are: + * + * 1. initial read + * 2. interpreted program + * + * It is assumed that NdbScanFilter has created all of 2 + * so that we don't have to save interpreter state. + */ + + const Uint32 size = get_size(); + assert(size != 0); + + // new ATTRINFO size + const Uint32 new_size = m_initial_AI_size; + + // find last signal for new size + assert(op->theFirstATTRINFO != NULL); + NdbApiSignal* lastSignal = op->theFirstATTRINFO; + Uint32 n = 0; + while (n + AttrInfo::DataLength < new_size) { + lastSignal = lastSignal->next(); + assert(lastSignal != NULL); + n += AttrInfo::DataLength; + } + assert(n < size); + + // release remaining signals + NdbApiSignal* tSignal = lastSignal->next(); + op->theNdb->releaseSignalsInList(&tSignal); + lastSignal->next(NULL); + + // length of lastSignal + const Uint32 new_curr = AttrInfo::HeaderLength + new_size - n; + assert(new_curr <= 25); + + DBUG_PRINT("info", ("op status: %d->%d tot AI: %u->%u in curr: %u->%u", + op->theStatus, m_initial_op_status, + op->theTotalCurrAI_Len, new_size, + op->theAI_LenInCurrAI, new_curr)); + + // reset op state + op->theStatus = m_initial_op_status; + + // reset interpreter state to initial + op->theFirstBranch = NULL; + op->theLastBranch = NULL; + op->theFirstCall = NULL; + op->theLastCall = NULL; + op->theFirstSubroutine = NULL; + op->theLastSubroutine = NULL; + op->theNoOfLabels = 0; + op->theNoOfSubroutines = 0; + + // reset AI size + op->theTotalCurrAI_Len = new_size; + op->theAI_LenInCurrAI = new_curr; + + // reset signal pointers + op->theCurrentATTRINFO = lastSignal; + op->theATTRINFOptr = &lastSignal->getDataPtrSend()[new_curr]; + + // interpreter sizes are set later somewhere + + DBUG_VOID_RETURN; +} + +static void +update(const NdbError & _err){ + NdbError & error = (NdbError &) _err; + ndberror_struct ndberror = (ndberror_struct)error; + ndberror_update(&ndberror); + error = NdbError(ndberror); +} + +const NdbError & +NdbScanFilter::getNdbError() const +{ + update(m_impl.m_error); + return m_impl.m_error; +} #if 0 diff --git a/ndb/src/ndbapi/NdbScanOperation.cpp b/ndb/src/ndbapi/NdbScanOperation.cpp index aec98a7f5d5..9176fb47297 100644 --- a/ndb/src/ndbapi/NdbScanOperation.cpp +++ b/ndb/src/ndbapi/NdbScanOperation.cpp @@ -849,6 +849,10 @@ NdbScanOperation::doSendScan(int aProcessorId) // sending it. This could not be done in openScan because // we created the ATTRINFO signals after the SCAN_TABREQ signal. ScanTabReq * const req = CAST_PTR(ScanTabReq, tSignal->getDataPtrSend()); + if (unlikely(theTotalCurrAI_Len > ScanTabReq::MaxTotalAttrInfo)) { + setErrorCode(4257); + return -1; + } req->attrLenKeyLen = (tupKeyLen << 16) | theTotalCurrAI_Len; Uint32 tmp = req->requestInfo; ScanTabReq::setDistributionKeyFlag(tmp, theDistrKeyIndicator_); diff --git a/ndb/src/ndbapi/ndberror.c b/ndb/src/ndbapi/ndberror.c index 24ccb1d07c2..56eb2c0f8bd 100644 --- a/ndb/src/ndbapi/ndberror.c +++ b/ndb/src/ndbapi/ndberror.c @@ -527,7 +527,8 @@ ErrorBundle ErrorCodes[] = { { 4270, IE, "Unknown blob error" }, { 4335, AE, "Only one autoincrement column allowed per table. Having a table without primary key uses an autoincremented hidden key, i.e. a table without a primary key can not have an autoincremented column" }, { 4271, AE, "Invalid index object, not retrieved via getIndex()" }, - { 4275, AE, "The blob method is incompatible with operation type or lock mode" } + { 4275, AE, "The blob method is incompatible with operation type or lock mode" }, + { 4294, AE, "Scan filter is too large, discarded" } }; static diff --git a/sql/ha_ndbcluster_cond.cc b/sql/ha_ndbcluster_cond.cc index ea3f8a7683a..c7b185a92f0 100644 --- a/sql/ha_ndbcluster_cond.cc +++ b/sql/ha_ndbcluster_cond.cc @@ -1338,9 +1338,23 @@ ha_ndbcluster_cond::generate_scan_filter(NdbScanOperation *op) if (m_cond_stack) { - NdbScanFilter filter(op); + NdbScanFilter filter(op, false); // don't abort on too large - DBUG_RETURN(generate_scan_filter_from_cond(filter)); + int ret=generate_scan_filter_from_cond(filter); + if (ret != 0) + { + const NdbError& err=filter.getNdbError(); + if (err.code == NdbScanFilter::FilterTooLarge) + { + // err.message has static storage + DBUG_PRINT("info", ("%s", err.message)); + push_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN, + err.code, err.message); + ret=0; + } + } + if (ret != 0) + DBUG_RETURN(ret); } else { @@ -1391,7 +1405,7 @@ int ha_ndbcluster_cond::generate_scan_filter_from_key(NdbScanOperation *op, { KEY_PART_INFO* key_part= key_info->key_part; KEY_PART_INFO* end= key_part+key_info->key_parts; - NdbScanFilter filter(op); + NdbScanFilter filter(op, true); // abort on too large int res; DBUG_ENTER("generate_scan_filter_from_key"); From b465fa9634d16ae473148bb74ec67ae199862cac Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 4 Oct 2007 19:46:01 +0200 Subject: [PATCH 19/49] ndb - wl#29390 post-merge 5.0 to 5.1 storage/ndb/src/ndbapi/ndberror.c: wl#29390 post-merge 5.0 to 5.1 --- storage/ndb/src/ndbapi/ndberror.c | 1 + 1 file changed, 1 insertion(+) diff --git a/storage/ndb/src/ndbapi/ndberror.c b/storage/ndb/src/ndbapi/ndberror.c index a0417e5b118..0ad2faff76a 100644 --- a/storage/ndb/src/ndbapi/ndberror.c +++ b/storage/ndb/src/ndbapi/ndberror.c @@ -624,6 +624,7 @@ ErrorBundle ErrorCodes[] = { { 4273, DMEC, IE, "No blob table in dict cache" }, { 4274, DMEC, IE, "Corrupted main table PK in blob operation" }, { 4275, DMEC, AE, "The blob method is incompatible with operation type or lock mode" }, + { 4294, DMEC, AE, "Scan filter is too large, discarded" }, { NO_CONTACT_WITH_PROCESS, DMEC, AE, "No contact with the process (dead ?)."}, From b86c73080f4d456aa71ce1d8f1b21aec95265c7e Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 8 Oct 2007 15:07:58 +0200 Subject: [PATCH 20/49] ndb - fix bug in old test prg(s) fix SR1 and SR2 storage/ndb/test/ndbapi/testSystemRestart.cpp: fix SR1 and SR2 --- storage/ndb/test/ndbapi/testSystemRestart.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/storage/ndb/test/ndbapi/testSystemRestart.cpp b/storage/ndb/test/ndbapi/testSystemRestart.cpp index 2495bf15186..419c1eb1438 100644 --- a/storage/ndb/test/ndbapi/testSystemRestart.cpp +++ b/storage/ndb/test/ndbapi/testSystemRestart.cpp @@ -122,7 +122,7 @@ int runSystemRestart1(NDBT_Context* ctx, NDBT_Step* step){ CHECK(hugoTrans.loadTable(pNdb, records) == 0); CHECK(hugoTrans.pkUpdateRecords(pNdb, records) == 0); CHECK(hugoTrans.pkDelRecords(pNdb, records/2) == 0); - CHECK(hugoTrans.scanUpdateRecords(pNdb, records) == 0); + CHECK(hugoTrans.scanUpdateRecords(pNdb, records/2) == 0); CHECK(utilTrans.clearTable(pNdb, records) == 0); CHECK(hugoTrans.loadTable(pNdb, records) == 0); CHECK(utilTrans.clearTable(pNdb, records) == 0); @@ -143,7 +143,7 @@ int runSystemRestart1(NDBT_Context* ctx, NDBT_Step* step){ CHECK(hugoTrans.loadTable(pNdb, records) == 0); CHECK(hugoTrans.pkUpdateRecords(pNdb, records) == 0); CHECK(hugoTrans.pkDelRecords(pNdb, records/2) == 0); - CHECK(hugoTrans.scanUpdateRecords(pNdb, records) == 0); + CHECK(hugoTrans.scanUpdateRecords(pNdb, records/2) == 0); CHECK(utilTrans.clearTable(pNdb, records) == 0); CHECK(hugoTrans.loadTable(pNdb, records) == 0); CHECK(utilTrans.clearTable(pNdb, records) == 0); @@ -266,7 +266,7 @@ int runSystemRestart2(NDBT_Context* ctx, NDBT_Step* step){ CHECK(hugoTrans.loadTable(pNdb, records) == 0); CHECK(hugoTrans.pkUpdateRecords(pNdb, records) == 0); CHECK(hugoTrans.pkDelRecords(pNdb, records/2) == 0); - CHECK(hugoTrans.scanUpdateRecords(pNdb, records) == 0); + CHECK(hugoTrans.scanUpdateRecords(pNdb, records/2) == 0); CHECK(utilTrans.clearTable(pNdb, records) == 0); CHECK(hugoTrans.loadTable(pNdb, records) == 0); CHECK(utilTrans.clearTable(pNdb, records) == 0); From 8625e94286df6f5d562d2ea8551eafa4826a6e27 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 8 Oct 2007 15:11:47 +0200 Subject: [PATCH 21/49] ndb - Set usable timeout for atrt (problem introduced by stew's timeout handling) storage/ndb/src/cw/cpcd/APIService.cpp: Set usable timeout for atrt --- storage/ndb/src/cw/cpcd/APIService.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/ndb/src/cw/cpcd/APIService.cpp b/storage/ndb/src/cw/cpcd/APIService.cpp index 5bbf2c86e23..ca4ab733842 100644 --- a/storage/ndb/src/cw/cpcd/APIService.cpp +++ b/storage/ndb/src/cw/cpcd/APIService.cpp @@ -145,7 +145,7 @@ CPCDAPISession::CPCDAPISession(NDB_SOCKET_TYPE sock, : SocketServer::Session(sock) , m_cpcd(cpcd) { - m_input = new SocketInputStream(sock); + m_input = new SocketInputStream(sock, 7*24*60*60000); m_output = new SocketOutputStream(sock); m_parser = new Parser(commands, *m_input, true, true, true); } From b32226604e3df387309ee68b7c1d20487c9d63c2 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 8 Oct 2007 15:53:29 +0200 Subject: [PATCH 22/49] ndb - bug#30975 (recommit to 51-telco-gca) - only update extent pages *after* flush of real page has been done - sync both create/drop of table into undolog (for disk tables) storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp: inform TUP which LCP to restore each fragment to storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp: 1) inform TUP which LCP to restore each fragment to 2) inform TUP both before/after a page has been written storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp: 1) inform TUP which LCP to restore each fragment to 2) inform TUP both before/after a page has been written storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp: log both create/drop table storage/ndb/src/kernel/blocks/lgman.cpp: let TUP know about all LCPs storage/ndb/src/kernel/blocks/pgman.cpp: add "when" argument to disk_page_unmap_callback so that TUP gets informed both before and after page writeout so that extent pages can be updated only *after* page has been written storage/ndb/src/kernel/blocks/tsman.cpp: remove lsn from update page free bits use wal for page vs extent relation storage/ndb/src/kernel/blocks/tsman.hpp: remove lsn from update page free bits use wal for page vs extent relation --- .../ndb/src/kernel/blocks/dblqh/DblqhMain.cpp | 11 +- storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp | 9 +- .../kernel/blocks/dbtup/DbtupDiskAlloc.cpp | 254 +++++++++++++----- .../ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp | 32 ++- storage/ndb/src/kernel/blocks/lgman.cpp | 12 +- storage/ndb/src/kernel/blocks/pgman.cpp | 36 ++- storage/ndb/src/kernel/blocks/tsman.cpp | 62 +++-- storage/ndb/src/kernel/blocks/tsman.hpp | 24 +- 8 files changed, 314 insertions(+), 126 deletions(-) diff --git a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp index bd5e52c1800..6f0d676194f 100644 --- a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp +++ b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp @@ -14042,11 +14042,16 @@ void Dblqh::execSTART_FRAGREQ(Signal* signal) fragptr.p->fragStatus = Fragrecord::ACTIVE_CREATION; } - c_tup->disk_restart_mark_no_lcp(tabptr.i, fragId); + c_tup->disk_restart_lcp_id(tabptr.i, fragId, RNIL); jamEntry(); - return; - }//if + } + else + { + jam(); + c_tup->disk_restart_lcp_id(tabptr.i, fragId, lcpId); + jamEntry(); + } c_lcpId = (c_lcpId == 0 ? lcpId : c_lcpId); c_lcpId = (c_lcpId < lcpId ? c_lcpId : lcpId); diff --git a/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp b/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp index 05f993dcece..eaf00138acf 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp +++ b/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp @@ -624,7 +624,8 @@ struct Fragrecord { DLList::Head m_scanList; - enum { UC_LCP = 1, UC_CREATE = 2 }; + enum { UC_LCP = 1, UC_CREATE = 2, UC_SET_LCP = 3 }; + Uint32 m_restore_lcp_id; Uint32 m_undo_complete; Uint32 m_tablespace_id; Uint32 m_logfile_group_id; @@ -2748,7 +2749,7 @@ private: public: int disk_page_load_hook(Uint32 page_id); - void disk_page_unmap_callback(Uint32 page_id, Uint32 dirty_count); + void disk_page_unmap_callback(Uint32 when, Uint32 page, Uint32 dirty_count); int disk_restart_alloc_extent(Uint32 tableId, Uint32 fragId, const Local_key* key, Uint32 pages); @@ -2769,11 +2770,11 @@ public: Local_key m_key; }; - void disk_restart_mark_no_lcp(Uint32 table, Uint32 frag); + void disk_restart_lcp_id(Uint32 table, Uint32 frag, Uint32 lcpId); private: void disk_restart_undo_next(Signal*); - void disk_restart_undo_lcp(Uint32, Uint32, Uint32 flag); + void disk_restart_undo_lcp(Uint32, Uint32, Uint32 flag, Uint32 lcpId); void disk_restart_undo_callback(Signal* signal, Uint32, Uint32); void disk_restart_undo_alloc(Apply_undo*); void disk_restart_undo_update(Apply_undo*); diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp index db336df6652..4509adb7da0 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp +++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp @@ -907,8 +907,10 @@ Dbtup::disk_page_set_dirty(PagePtr pagePtr) } void -Dbtup::disk_page_unmap_callback(Uint32 page_id, Uint32 dirty_count) +Dbtup::disk_page_unmap_callback(Uint32 when, + Uint32 page_id, Uint32 dirty_count) { + jamEntry(); Ptr gpage; m_global_page_pool.getPtr(gpage, page_id); PagePtr pagePtr; @@ -922,17 +924,9 @@ Dbtup::disk_page_unmap_callback(Uint32 page_id, Uint32 dirty_count) { return ; } - - Local_key key; - key.m_page_no = pagePtr.p->m_page_no; - key.m_file_no = pagePtr.p->m_file_no; + Uint32 idx = pagePtr.p->list_index; - ndbassert((idx & 0x8000) == 0); - - if (DBG_DISK) - ndbout << "disk_page_unmap_callback " << key << endl; - Ptr tabPtr; tabPtr.i= pagePtr.p->m_table_id; ptrCheckGuard(tabPtr, cnoOfTablerec, tablerec); @@ -942,26 +936,83 @@ Dbtup::disk_page_unmap_callback(Uint32 page_id, Uint32 dirty_count) Disk_alloc_info& alloc= fragPtr.p->m_disk_alloc_info; - if (dirty_count == 0) + if (when == 0) { - Uint32 free = pagePtr.p->free_space; - Uint32 used = pagePtr.p->uncommitted_used_space; - ddassert(free >= used); - ddassert(alloc.calc_page_free_bits(free - used) == idx); + /** + * Before pageout + */ + jam(); + + if (DBG_DISK) + { + Local_key key; + key.m_page_no = pagePtr.p->m_page_no; + key.m_file_no = pagePtr.p->m_file_no; + ndbout << "disk_page_unmap_callback(before) " << key + << " cnt: " << dirty_count << " " << (idx & ~0x8000) << endl; + } + + ndbassert((idx & 0x8000) == 0); + + ArrayPool *pool= (ArrayPool*)&m_global_page_pool; + LocalDLList list(*pool, alloc.m_dirty_pages[idx]); + list.remove(pagePtr); + + if (dirty_count == 0) + { + jam(); + pagePtr.p->list_index = idx | 0x8000; + + Local_key key; + key.m_page_no = pagePtr.p->m_page_no; + key.m_file_no = pagePtr.p->m_file_no; + + Uint32 free = pagePtr.p->free_space; + Uint32 used = pagePtr.p->uncommitted_used_space; + ddassert(free >= used); + ddassert(alloc.calc_page_free_bits(free - used) == idx); + + Tablespace_client tsman(0, c_tsman, + fragPtr.p->fragTableId, + fragPtr.p->fragmentId, + fragPtr.p->m_tablespace_id); + + tsman.unmap_page(&key, idx); + jamEntry(); + } + } + else if (when == 1) + { + /** + * After page out + */ + jam(); + + Local_key key; + key.m_page_no = pagePtr.p->m_page_no; + key.m_file_no = pagePtr.p->m_file_no; + Uint32 real_free = pagePtr.p->free_space; + if (DBG_DISK) + { + ndbout << "disk_page_unmap_callback(after) " << key + << " cnt: " << dirty_count << " " << (idx & ~0x8000) << endl; + } + Tablespace_client tsman(0, c_tsman, fragPtr.p->fragTableId, fragPtr.p->fragmentId, fragPtr.p->m_tablespace_id); - tsman.unmap_page(&key, idx); - jamEntry(); - pagePtr.p->list_index = idx | 0x8000; + if (DBG_DISK && alloc.calc_page_free_bits(real_free) != (idx & ~0x8000)) + { + ndbout << key + << " calc: " << alloc.calc_page_free_bits(real_free) + << " idx: " << (idx & ~0x8000) + << endl; + } + tsman.update_page_free_bits(&key, alloc.calc_page_free_bits(real_free)); } - - ArrayPool *pool= (ArrayPool*)&m_global_page_pool; - LocalDLList list(*pool, alloc.m_dirty_pages[idx]); - list.remove(pagePtr); } void @@ -992,20 +1043,6 @@ Dbtup::disk_page_alloc(Signal* signal, lsn= disk_page_undo_alloc(pagePtr.p, key, sz, gci, logfile_group_id); } - - Uint32 new_free = pagePtr.p->free_space; - Uint32 new_bits= alloc.calc_page_free_bits(new_free); - - if (old_bits != new_bits) - { - Tablespace_client tsman(signal, c_tsman, - fragPtrP->fragTableId, - fragPtrP->fragmentId, - fragPtrP->m_tablespace_id); - - tsman.update_page_free_bits(key, new_bits, lsn); - jamEntry(); - } } void @@ -1049,17 +1086,6 @@ Dbtup::disk_page_free(Signal *signal, Uint32 new_free = pagePtr.p->free_space; Uint32 new_bits = alloc.calc_page_free_bits(new_free); - if (old_bits != new_bits) - { - Tablespace_client tsman(signal, c_tsman, - fragPtrP->fragTableId, - fragPtrP->fragmentId, - fragPtrP->m_tablespace_id); - - tsman.update_page_free_bits(key, new_bits, lsn); - jamEntry(); - } - Uint32 ext = pagePtr.p->m_extent_info_ptr; Uint32 used = pagePtr.p->uncommitted_used_space; Uint32 old_idx = pagePtr.p->list_index; @@ -1345,15 +1371,23 @@ Dbtup::disk_restart_undo(Signal* signal, Uint64 lsn, case File_formats::Undofile::UNDO_LCP_FIRST: case File_formats::Undofile::UNDO_LCP: { + jam(); ndbrequire(len == 3); + Uint32 lcp = ptr[0]; Uint32 tableId = ptr[1] >> 16; Uint32 fragId = ptr[1] & 0xFFFF; - disk_restart_undo_lcp(tableId, fragId, Fragrecord::UC_LCP); + disk_restart_undo_lcp(tableId, fragId, Fragrecord::UC_LCP, lcp); disk_restart_undo_next(signal); + + if (DBG_UNDO) + { + ndbout_c("UNDO LCP %u (%u, %u)", lcp, tableId, fragId); + } return; } case File_formats::Undofile::UNDO_TUP_ALLOC: { + jam(); Disk_undo::Alloc* rec= (Disk_undo::Alloc*)ptr; preq.m_page.m_page_no = rec->m_page_no; preq.m_page.m_file_no = rec->m_file_no_page_idx >> 16; @@ -1362,6 +1396,7 @@ Dbtup::disk_restart_undo(Signal* signal, Uint64 lsn, } case File_formats::Undofile::UNDO_TUP_UPDATE: { + jam(); Disk_undo::Update* rec= (Disk_undo::Update*)ptr; preq.m_page.m_page_no = rec->m_page_no; preq.m_page.m_file_no = rec->m_file_no_page_idx >> 16; @@ -1370,6 +1405,7 @@ Dbtup::disk_restart_undo(Signal* signal, Uint64 lsn, } case File_formats::Undofile::UNDO_TUP_FREE: { + jam(); Disk_undo::Free* rec= (Disk_undo::Free*)ptr; preq.m_page.m_page_no = rec->m_page_no; preq.m_page.m_file_no = rec->m_file_no_page_idx >> 16; @@ -1381,6 +1417,7 @@ Dbtup::disk_restart_undo(Signal* signal, Uint64 lsn, * */ { + jam(); Disk_undo::Create* rec= (Disk_undo::Create*)ptr; Ptr tabPtr; tabPtr.i= rec->m_table; @@ -1388,12 +1425,34 @@ Dbtup::disk_restart_undo(Signal* signal, Uint64 lsn, for(Uint32 i = 0; ifragrec[i] != RNIL) disk_restart_undo_lcp(tabPtr.i, tabPtr.p->fragid[i], - Fragrecord::UC_CREATE); + Fragrecord::UC_CREATE, 0); disk_restart_undo_next(signal); + + if (DBG_UNDO) + { + ndbout_c("UNDO CREATE (%u)", tabPtr.i); + } return; } case File_formats::Undofile::UNDO_TUP_DROP: + { jam(); + Disk_undo::Drop* rec = (Disk_undo::Drop*)ptr; + Ptr tabPtr; + tabPtr.i= rec->m_table; + ptrCheckGuard(tabPtr, cnoOfTablerec, tablerec); + for(Uint32 i = 0; ifragrec[i] != RNIL) + disk_restart_undo_lcp(tabPtr.i, tabPtr.p->fragid[i], + Fragrecord::UC_CREATE, 0); + disk_restart_undo_next(signal); + + if (DBG_UNDO) + { + ndbout_c("UNDO DROP (%u)", tabPtr.i); + } + return; + } case File_formats::Undofile::UNDO_TUP_ALLOC_EXTENT: jam(); case File_formats::Undofile::UNDO_TUP_FREE_EXTENT: @@ -1402,6 +1461,7 @@ Dbtup::disk_restart_undo(Signal* signal, Uint64 lsn, return; case File_formats::Undofile::UNDO_END: + jam(); f_undo_done = true; return; default: @@ -1435,14 +1495,32 @@ Dbtup::disk_restart_undo_next(Signal* signal) } void -Dbtup::disk_restart_mark_no_lcp(Uint32 tableId, Uint32 fragId) +Dbtup::disk_restart_lcp_id(Uint32 tableId, Uint32 fragId, Uint32 lcpId) { jamEntry(); - disk_restart_undo_lcp(tableId, fragId, Fragrecord::UC_CREATE); + + if (lcpId == RNIL) + { + disk_restart_undo_lcp(tableId, fragId, Fragrecord::UC_CREATE, 0); + if (DBG_UNDO) + { + ndbout_c("mark_no_lcp (%u, %u)", tableId, fragId); + } + } + else + { + disk_restart_undo_lcp(tableId, fragId, Fragrecord::UC_SET_LCP, lcpId); + if (DBG_UNDO) + { + ndbout_c("mark_no_lcp (%u, %u)", tableId, fragId); + } + + } } void -Dbtup::disk_restart_undo_lcp(Uint32 tableId, Uint32 fragId, Uint32 flag) +Dbtup::disk_restart_undo_lcp(Uint32 tableId, Uint32 fragId, Uint32 flag, + Uint32 lcpId) { Ptr tabPtr; tabPtr.i= tableId; @@ -1450,11 +1528,43 @@ Dbtup::disk_restart_undo_lcp(Uint32 tableId, Uint32 fragId, Uint32 flag) if (tabPtr.p->tableStatus == DEFINED) { + jam(); FragrecordPtr fragPtr; getFragmentrec(fragPtr, fragId, tabPtr.p); if (!fragPtr.isNull()) { - fragPtr.p->m_undo_complete |= flag; + jam(); + switch(flag){ + case Fragrecord::UC_CREATE: + jam(); + fragPtr.p->m_undo_complete |= flag; + return; + case Fragrecord::UC_LCP: + jam(); + if (fragPtr.p->m_undo_complete == 0 && + fragPtr.p->m_restore_lcp_id == lcpId) + { + jam(); + fragPtr.p->m_undo_complete |= flag; + if (DBG_UNDO) + ndbout_c("table: %u fragment: %u lcp: %u -> done", + tableId, fragId, lcpId); + } + return; + case Fragrecord::UC_SET_LCP: + { + jam(); + if (DBG_UNDO) + ndbout_c("table: %u fragment: %u restore to lcp: %u", + tableId, fragId, lcpId); + ndbrequire(fragPtr.p->m_undo_complete == 0); + ndbrequire(fragPtr.p->m_restore_lcp_id == RNIL); + fragPtr.p->m_restore_lcp_id = lcpId; + return; + } + } + jamLine(flag); + ndbrequire(false); } } } @@ -1478,6 +1588,7 @@ Dbtup::disk_restart_undo_callback(Signal* signal, pagePtr.p->nextList != RNIL || pagePtr.p->prevList != RNIL) { + jam(); update = true; pagePtr.p->list_index |= 0x8000; pagePtr.p->nextList = pagePtr.p->prevList = RNIL; @@ -1488,6 +1599,9 @@ Dbtup::disk_restart_undo_callback(Signal* signal, if (tableId >= cnoOfTablerec) { + jam(); + if (DBG_UNDO) + ndbout_c("UNDO table> %u", tableId); disk_restart_undo_next(signal); return; } @@ -1496,6 +1610,9 @@ Dbtup::disk_restart_undo_callback(Signal* signal, if (undo->m_table_ptr.p->tableStatus != DEFINED) { + jam(); + if (DBG_UNDO) + ndbout_c("UNDO !defined (%u) ", tableId); disk_restart_undo_next(signal); return; } @@ -1503,19 +1620,25 @@ Dbtup::disk_restart_undo_callback(Signal* signal, getFragmentrec(undo->m_fragment_ptr, fragId, undo->m_table_ptr.p); if(undo->m_fragment_ptr.isNull()) { + jam(); + if (DBG_UNDO) + ndbout_c("UNDO fragment null %u/%u", tableId, fragId); disk_restart_undo_next(signal); return; } if (undo->m_fragment_ptr.p->m_undo_complete) { + jam(); + if (DBG_UNDO) + ndbout_c("UNDO undo complete %u/%u", tableId, fragId); disk_restart_undo_next(signal); return; } - Local_key key; - key.m_page_no = pagePtr.p->m_page_no; - key.m_file_no = pagePtr.p->m_file_no; + Local_key key = undo->m_key; +// key.m_page_no = pagePtr.p->m_page_no; +// key.m_file_no = pagePtr.p->m_file_no; Uint64 lsn = 0; lsn += pagePtr.p->m_page_header.m_page_lsn_hi; lsn <<= 32; @@ -1525,6 +1648,7 @@ Dbtup::disk_restart_undo_callback(Signal* signal, if (undo->m_lsn <= lsn) { + jam(); if (DBG_UNDO) { ndbout << "apply: " << undo->m_lsn << "(" << lsn << " )" @@ -1539,12 +1663,15 @@ Dbtup::disk_restart_undo_callback(Signal* signal, */ switch(undo->m_type){ case File_formats::Undofile::UNDO_TUP_ALLOC: + jam(); disk_restart_undo_alloc(undo); break; case File_formats::Undofile::UNDO_TUP_UPDATE: + jam(); disk_restart_undo_update(undo); break; case File_formats::Undofile::UNDO_TUP_FREE: + jam(); disk_restart_undo_free(undo); break; default: @@ -1559,14 +1686,17 @@ Dbtup::disk_restart_undo_callback(Signal* signal, m_pgman.update_lsn(undo->m_key, lsn); jamEntry(); + + disk_restart_undo_page_bits(signal, undo); } else if (DBG_UNDO) { + jam(); ndbout << "ignore: " << undo->m_lsn << "(" << lsn << " )" - << key << " type: " << undo->m_type << endl; + << key << " type: " << undo->m_type + << " tab: " << tableId << endl; } - disk_restart_undo_page_bits(signal, undo); disk_restart_undo_next(signal); } @@ -1641,16 +1771,12 @@ Dbtup::disk_restart_undo_page_bits(Signal* signal, Apply_undo* undo) Uint32 new_bits = alloc.calc_page_free_bits(free); pageP->list_index = 0x8000 | new_bits; - Uint64 lsn = 0; - lsn += pageP->m_page_header.m_page_lsn_hi; lsn <<= 32; - lsn += pageP->m_page_header.m_page_lsn_lo; - Tablespace_client tsman(signal, c_tsman, fragPtrP->fragTableId, fragPtrP->fragmentId, fragPtrP->m_tablespace_id); - tsman.restart_undo_page_free_bits(&undo->m_key, new_bits, undo->m_lsn, lsn); + tsman.restart_undo_page_free_bits(&undo->m_key, new_bits); jamEntry(); } @@ -1687,6 +1813,7 @@ Dbtup::disk_restart_alloc_extent(Uint32 tableId, Uint32 fragId, if (alloc.m_curr_extent_info_ptr_i != RNIL) { + jam(); Ptr old; c_extent_pool.getPtr(old, alloc.m_curr_extent_info_ptr_i); ndbassert(old.p->m_free_matrix_pos == RNIL); @@ -1713,6 +1840,7 @@ void Dbtup::disk_restart_page_bits(Uint32 tableId, Uint32 fragId, const Local_key*, Uint32 bits) { + jam(); TablerecPtr tabPtr; FragrecordPtr fragPtr; tabPtr.i = tableId; diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp index 3c2d521c1f9..94366905e00 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp +++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp @@ -146,6 +146,7 @@ void Dbtup::execTUPFRAGREQ(Signal* signal) regFragPtr.p->m_lcp_scan_op = RNIL; regFragPtr.p->m_lcp_keep_list = RNIL; regFragPtr.p->m_var_page_chunks = RNIL; + regFragPtr.p->m_restore_lcp_id = RNIL; if (ERROR_INSERTED(4007) && regTabPtr.p->fragid[0] == fragId || ERROR_INSERTED(4008) && regTabPtr.p->fragid[1] == fragId) { @@ -673,11 +674,11 @@ Dbtup::undo_createtable_callback(Signal* signal, Uint32 opPtrI, Uint32 unused) switch(ret){ case 0: return; + case -1: + warningEvent("Failed to sync log for create of table: %u", regTabPtr.i); default: - ndbout_c("ret: %d", ret); - ndbrequire(false); + execute(signal, req.m_callback, regFragPtr.p->m_logfile_group_id); } - } void @@ -958,8 +959,6 @@ void Dbtup::releaseFragment(Signal* signal, Uint32 tableId, return; } -#if NOT_YET_UNDO_DROP_TABLE -#error "This code is complete, but I prefer not to enable it until I need it" if (logfile_group_id != RNIL) { Callback cb; @@ -968,7 +967,14 @@ void Dbtup::releaseFragment(Signal* signal, Uint32 tableId, safe_cast(&Dbtup::drop_table_log_buffer_callback); Uint32 sz= sizeof(Disk_undo::Drop) >> 2; int r0 = c_lgman->alloc_log_space(logfile_group_id, sz); - + if (r0) + { + jam(); + warningEvent("Failed to alloc log space for drop table: %u", + tabPtr.i); + goto done; + } + Logfile_client lgman(this, c_lgman, logfile_group_id); int res= lgman.get_log_buffer(signal, sz, &cb); switch(res){ @@ -976,15 +982,18 @@ void Dbtup::releaseFragment(Signal* signal, Uint32 tableId, ljam(); return; case -1: - ndbrequire("NOT YET IMPLEMENTED" == 0); + warningEvent("Failed to get log buffer for drop table: %u", + tabPtr.i); + c_lgman->free_log_space(logfile_group_id, sz); + goto done; break; default: execute(signal, cb, logfile_group_id); return; } } -#endif - + +done: drop_table_logsync_callback(signal, tabPtr.i, RNIL); } @@ -1163,9 +1172,10 @@ Dbtup::drop_table_log_buffer_callback(Signal* signal, Uint32 tablePtrI, switch(ret){ case 0: return; + case -1: + warningEvent("Failed to syn log for drop of table: %u", tablePtrI); default: - ndbout_c("ret: %d", ret); - ndbrequire(false); + execute(signal, req.m_callback, logfile_group_id); } } diff --git a/storage/ndb/src/kernel/blocks/lgman.cpp b/storage/ndb/src/kernel/blocks/lgman.cpp index 59b95f4e97f..ce01b31927c 100644 --- a/storage/ndb/src/kernel/blocks/lgman.cpp +++ b/storage/ndb/src/kernel/blocks/lgman.cpp @@ -2684,8 +2684,16 @@ Lgman::execute_undo_record(Signal* signal) Uint32 lcp = * (ptr - len + 1); if(m_latest_lcp && lcp > m_latest_lcp) { - // Just ignore - break; + if (0) + { + const Uint32 * base = ptr - len + 1; + Uint32 lcp = base[0]; + Uint32 tableId = base[1] >> 16; + Uint32 fragId = base[1] & 0xFFFF; + + ndbout_c("NOT! ignoring lcp: %u tab: %u frag: %u", + lcp, tableId, fragId); + } } if(m_latest_lcp == 0 || diff --git a/storage/ndb/src/kernel/blocks/pgman.cpp b/storage/ndb/src/kernel/blocks/pgman.cpp index a5558aa320d..1f914639d6b 100644 --- a/storage/ndb/src/kernel/blocks/pgman.cpp +++ b/storage/ndb/src/kernel/blocks/pgman.cpp @@ -500,6 +500,11 @@ Pgman::release_page_entry(Ptr& ptr) if (! (state & Page_entry::LOCKED)) ndbrequire(! (state & Page_entry::REQUEST)); + + if (ptr.p->m_copy_page_i != RNIL) + { + m_global_page_pool.release(ptr.p->m_copy_page_i); + } set_page_state(ptr, 0); m_page_hashlist.remove(ptr); @@ -1151,7 +1156,8 @@ Pgman::process_cleanup(Signal* signal) #ifdef VM_TRACE debugOut << "PGMAN: " << ptr << " : process_cleanup" << endl; #endif - c_tup->disk_page_unmap_callback(ptr.p->m_real_page_i, + c_tup->disk_page_unmap_callback(0, + ptr.p->m_real_page_i, ptr.p->m_dirty_count); pageout(signal, ptr); max_count--; @@ -1189,6 +1195,11 @@ Pgman::move_cleanup_ptr(Ptr ptr) void Pgman::execLCP_FRAG_ORD(Signal* signal) { + if (ERROR_INSERTED(11008)) + { + ndbout_c("Ignore LCP_FRAG_ORD"); + return; + } LcpFragOrd* ord = (LcpFragOrd*)signal->getDataPtr(); ndbrequire(ord->lcpId >= m_last_lcp_complete + 1 || m_last_lcp_complete == 0); m_last_lcp = ord->lcpId; @@ -1205,6 +1216,12 @@ Pgman::execLCP_FRAG_ORD(Signal* signal) void Pgman::execEND_LCP_REQ(Signal* signal) { + if (ERROR_INSERTED(11008)) + { + ndbout_c("Ignore END_LCP"); + return; + } + EndLcpReq* req = (EndLcpReq*)signal->getDataPtr(); m_end_lcp_req = *req; @@ -1283,7 +1300,8 @@ Pgman::process_lcp(Signal* signal) { DBG_LCP(" pageout()" << endl); ptr.p->m_state |= Page_entry::LCP; - c_tup->disk_page_unmap_callback(ptr.p->m_real_page_i, + c_tup->disk_page_unmap_callback(0, + ptr.p->m_real_page_i, ptr.p->m_dirty_count); pageout(signal, ptr); } @@ -1505,6 +1523,10 @@ Pgman::fswriteconf(Signal* signal, Ptr ptr) Page_state state = ptr.p->m_state; ndbrequire(state & Page_entry::PAGEOUT); + c_tup->disk_page_unmap_callback(1, + ptr.p->m_real_page_i, + ptr.p->m_dirty_count); + state &= ~ Page_entry::PAGEOUT; state &= ~ Page_entry::EMPTY; state &= ~ Page_entry::DIRTY; @@ -1758,7 +1780,7 @@ Pgman::get_page(Signal* signal, Ptr ptr, Page_request page_req) #endif state |= Page_entry::REQUEST; - if (only_request && req_flags & Page_request::EMPTY_PAGE) + if (only_request && (req_flags & Page_request::EMPTY_PAGE)) { state |= Page_entry::EMPTY; } @@ -2420,7 +2442,8 @@ Pgman::execDUMP_STATE_ORD(Signal* signal) if (pl_hash.find(ptr, key)) { ndbout << "pageout " << ptr << endl; - c_tup->disk_page_unmap_callback(ptr.p->m_real_page_i, + c_tup->disk_page_unmap_callback(0, + ptr.p->m_real_page_i, ptr.p->m_dirty_count); pageout(signal, ptr); } @@ -2476,6 +2499,11 @@ Pgman::execDUMP_STATE_ORD(Signal* signal) { SET_ERROR_INSERT_VALUE(11007); } + + if (signal->theData[0] == 11008) + { + SET_ERROR_INSERT_VALUE(11008); + } } // page cache client diff --git a/storage/ndb/src/kernel/blocks/tsman.cpp b/storage/ndb/src/kernel/blocks/tsman.cpp index 97fc19cc0aa..353bfc6e3c5 100644 --- a/storage/ndb/src/kernel/blocks/tsman.cpp +++ b/storage/ndb/src/kernel/blocks/tsman.cpp @@ -302,7 +302,7 @@ Tsman::execDUMP_STATE_ORD(Signal* signal){ Uint32 new_bits = curr_bits ^ rand(); Local_key key = chunks[chunk].start_page; key.m_page_no += page; - ndbrequire(update_page_free_bits(signal, &key, new_bits, 0) == 0); + ndbrequire(update_page_free_bits(signal, &key, new_bits) == 0); } } } @@ -369,6 +369,20 @@ Tsman::execCREATE_FILEGROUP_REQ(Signal* signal){ CreateFilegroupImplRef::SignalLength, JBB); } +NdbOut& +operator<<(NdbOut& out, const File_formats::Datafile::Extent_header & obj) +{ + out << "table: " << obj.m_table + << " fragment: " << obj.m_fragment_id << " "; + for(Uint32 i = 0; i<32; i++) + { + char t[2]; + BaseString::snprintf(t, sizeof(t), "%x", obj.get_free_bits(i)); + out << t; + } + return out; +} + void Tsman::execDROP_FILEGROUP_REQ(Signal* signal){ jamEntry(); @@ -1582,8 +1596,7 @@ Tsman::execFREE_EXTENT_REQ(Signal* signal) int Tsman::update_page_free_bits(Signal* signal, Local_key *key, - unsigned committed_bits, - Uint64 lsn) + unsigned committed_bits) { jamEntry(); @@ -1618,6 +1631,18 @@ Tsman::update_page_free_bits(Signal* signal, File_formats::Datafile::Extent_header* header = page->get_header(val.m_extent_no, val.m_extent_size); + if (header->m_table == RNIL) + { + ndbout << "update page free bits page: " << *key + << " " << *header << endl; + } + + if (0) + { + ndbout << "update page free bits page(" << committed_bits << ") " + << *key << " " << *header << endl; + } + ndbrequire(header->m_table != RNIL); Uint32 page_no_in_extent = calc_page_no_in_extent(key->m_page_no, &val); @@ -1629,7 +1654,7 @@ Tsman::update_page_free_bits(Signal* signal, Uint32 src = header->get_free_bits(page_no_in_extent) & UNCOMMITTED_MASK; header->update_free_bits(page_no_in_extent, src | committed_bits); - m_page_cache_client.update_lsn(preq.m_page, lsn); + m_page_cache_client.update_lsn(preq.m_page, 0); return 0; } @@ -1717,6 +1742,11 @@ Tsman::unmap_page(Signal* signal, Local_key *key, Uint32 uncommitted_bits) File_formats::Datafile::Extent_header* header = page->get_header(val.m_extent_no, val.m_extent_size); + if (header->m_table == RNIL) + { + ndbout << "trying to unmap page: " << *key + << " " << *header << endl; + } ndbrequire(header->m_table != RNIL); Uint32 page_no_in_extent = calc_page_no_in_extent(key->m_page_no, &val); @@ -1738,9 +1768,7 @@ Tsman::restart_undo_page_free_bits(Signal* signal, Uint32 tableId, Uint32 fragId, Local_key *key, - unsigned bits, - Uint64 undo_lsn, - Uint64 page_lsn) + unsigned bits) { jamEntry(); @@ -1774,21 +1802,7 @@ Tsman::restart_undo_page_free_bits(Signal* signal, (File_formats::Datafile::Extent_page*)ptr_p; File_formats::Datafile::Extent_header* header = page->get_header(val.m_extent_no, val.m_extent_size); - - Uint64 lsn = 0; - lsn += page->m_page_header.m_page_lsn_hi; lsn <<= 32; - lsn += page->m_page_header.m_page_lsn_lo; - - if (undo_lsn > lsn && undo_lsn > page_lsn) - { - if (DBG_UNDO) - ndbout << "tsman: ignore " << undo_lsn << "(" << lsn << ", " - << page_lsn << ") " - << *key << " " - << " -> " << bits << endl; - return 0; - } - + if (header->m_table == RNIL) { if (DBG_UNDO) @@ -1807,7 +1821,7 @@ Tsman::restart_undo_page_free_bits(Signal* signal, */ if (DBG_UNDO) { - ndbout << "tsman: apply " << undo_lsn << "(" << lsn << ") " + ndbout << "tsman: apply " << *key << " " << (src & COMMITTED_MASK) << " -> " << bits << endl; } @@ -1855,7 +1869,7 @@ Tsman::execALLOC_PAGE_REQ(Signal* signal) /** * Handling of unmapped extent header pages is not implemented */ - int flags = 0; + int flags = Page_cache_client::DIRTY_REQ; int real_page_id; Uint32 page_no; Uint32 src_bits; diff --git a/storage/ndb/src/kernel/blocks/tsman.hpp b/storage/ndb/src/kernel/blocks/tsman.hpp index 1293cc54141..20019e6d4d1 100644 --- a/storage/ndb/src/kernel/blocks/tsman.hpp +++ b/storage/ndb/src/kernel/blocks/tsman.hpp @@ -209,12 +209,12 @@ private: void load_extent_page_callback(Signal*, Uint32, Uint32); void create_file_ref(Signal*, Ptr, Ptr, Uint32,Uint32,Uint32); - int update_page_free_bits(Signal*, Local_key*, unsigned committed_bits, - Uint64 lsn); + int update_page_free_bits(Signal*, Local_key*, unsigned committed_bits); + int get_page_free_bits(Signal*, Local_key*, unsigned*, unsigned*); int unmap_page(Signal*, Local_key*, unsigned uncommitted_bits); int restart_undo_page_free_bits(Signal*, Uint32, Uint32, Local_key*, - unsigned committed_bits, Uint64, Uint64); + unsigned committed_bits); int alloc_extent(Signal* signal, Uint32 tablespace, Local_key* key); int alloc_page_from_extent(Signal*, Uint32, Local_key*, Uint32 bits); @@ -320,7 +320,7 @@ public: /** * Update page free bits */ - int update_page_free_bits(Local_key*, unsigned bits, Uint64 lsn); + int update_page_free_bits(Local_key*, unsigned bits); /** * Get page free bits @@ -336,8 +336,7 @@ public: /** * Undo handling of page bits */ - int restart_undo_page_free_bits(Local_key*, unsigned bits, - Uint64 lsn, Uint64 page_lsn); + int restart_undo_page_free_bits(Local_key*, unsigned bits); /** * Get tablespace info @@ -417,10 +416,9 @@ Tablespace_client::free_extent(Local_key* key, Uint64 lsn) inline int Tablespace_client::update_page_free_bits(Local_key *key, - unsigned committed_bits, - Uint64 lsn) + unsigned committed_bits) { - return m_tsman->update_page_free_bits(m_signal, key, committed_bits, lsn); + return m_tsman->update_page_free_bits(m_signal, key, committed_bits); } inline @@ -442,17 +440,13 @@ Tablespace_client::unmap_page(Local_key *key, unsigned uncommitted_bits) inline int Tablespace_client::restart_undo_page_free_bits(Local_key* key, - unsigned committed_bits, - Uint64 lsn, - Uint64 page_lsn) + unsigned committed_bits) { return m_tsman->restart_undo_page_free_bits(m_signal, m_table_id, m_fragment_id, key, - committed_bits, - lsn, - page_lsn); + committed_bits); } #endif From e53ffccb67177ce0245697ed3d70eedf20bfa4c6 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 8 Oct 2007 15:57:01 +0200 Subject: [PATCH 23/49] ndb - bug#31257 handle partially complete LCP better in SR storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp: remove partially complete LCP from "node" when doign removeNodeFromTable storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp: remove partially complete LCP from "node" when doign removeNodeFromTable --- storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp | 1 + .../ndb/src/kernel/blocks/dbdih/DbdihMain.cpp | 35 ++++++++++++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp b/storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp index 6321679269d..317983323cc 100644 --- a/storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp +++ b/storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp @@ -318,6 +318,7 @@ public: Uint8 noOfStartedChkpt; MasterLCPConf::State lcpStateAtTakeOver; + Uint32 m_remove_node_from_table_lcp_id; }; typedef Ptr NodeRecordPtr; /**********************************************************************/ diff --git a/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp b/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp index e731bde5917..f4433b9d264 100644 --- a/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp +++ b/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp @@ -4989,6 +4989,18 @@ void Dbdih::startRemoveFailedNode(Signal* signal, NodeRecordPtr failedNodePtr) return; } + /** + * If node has node complete LCP + * we need to remove it as undo might not be complete + * bug#31257 + */ + failedNodePtr.p->m_remove_node_from_table_lcp_id = RNIL; + if (c_lcpState.m_LCP_COMPLETE_REP_Counter_LQH.isWaitingFor(failedNodePtr.i)) + { + jam(); + failedNodePtr.p->m_remove_node_from_table_lcp_id = SYSFILE->latestLCP_ID; + } + jam(); signal->theData[0] = DihContinueB::ZREMOVE_NODE_FROM_TABLE; signal->theData[1] = failedNodePtr.i; @@ -5630,6 +5642,11 @@ void Dbdih::removeNodeFromTable(Signal* signal, return; }//if + NodeRecordPtr nodePtr; + nodePtr.i = nodeId; + ptrCheckGuard(nodePtr, MAX_NDB_NODES, nodeRecord); + const Uint32 lcpId = nodePtr.p->m_remove_node_from_table_lcp_id; + /** * For each fragment */ @@ -5637,7 +5654,6 @@ void Dbdih::removeNodeFromTable(Signal* signal, Uint32 noOfRemovedLcpReplicas = 0; // No of replicas in LCP removed Uint32 noOfRemainingLcpReplicas = 0;// No of replicas in LCP remaining - //const Uint32 lcpId = SYSFILE->latestLCP_ID; const bool lcpOngoingFlag = (tabPtr.p->tabLcpStatus== TabRecord::TLS_ACTIVE); const bool unlogged = (tabPtr.p->tabStorage != TabRecord::ST_NORMAL); @@ -5672,6 +5688,23 @@ void Dbdih::removeNodeFromTable(Signal* signal, noOfRemovedLcpReplicas ++; replicaPtr.p->lcpOngoingFlag = false; } + + if (lcpId != RNIL) + { + jam(); + Uint32 lcpNo = prevLcpNo(replicaPtr.p->nextLcp); + if (replicaPtr.p->lcpStatus[lcpNo] == ZVALID && + replicaPtr.p->lcpId[lcpNo] == SYSFILE->latestLCP_ID) + { + jam(); + replicaPtr.p->lcpStatus[lcpNo] = ZINVALID; + replicaPtr.p->lcpId[lcpNo] = 0; + replicaPtr.p->nextLcp = lcpNo; + ndbout_c("REMOVING lcp: %u from table: %u frag: %u node: %u", + SYSFILE->latestLCP_ID, + tabPtr.i, fragNo, nodeId); + } + } } } if (!found) From f401993dc8d7996c50056019b270d11ce23f7163 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 8 Oct 2007 15:58:08 +0200 Subject: [PATCH 24/49] ndb - remove extra ; (in test framework) storage/ndb/test/src/NDBT_Thread.cpp: remove extra ; --- storage/ndb/test/src/NDBT_Thread.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/ndb/test/src/NDBT_Thread.cpp b/storage/ndb/test/src/NDBT_Thread.cpp index 56cf2f6815b..ff6785724ba 100644 --- a/storage/ndb/test/src/NDBT_Thread.cpp +++ b/storage/ndb/test/src/NDBT_Thread.cpp @@ -131,7 +131,7 @@ NDBT_Thread::exit() m_state = Exit; signal(); unlock(); -}; +} void NDBT_Thread::join() From 14634a493726d51ef9ad6a1ae8b0b97dee077508 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 8 Oct 2007 16:00:18 +0200 Subject: [PATCH 25/49] ndb - Fix disk scan (backup) (introduced by only updating extent pages after pageout) storage/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp: Fix disk scan (backup) --- storage/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp index bb3d8cc0626..eecbee4c058 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp +++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp @@ -771,7 +771,7 @@ Dbtup::scanNext(Signal* signal, ScanOpPtr scanPtr) uncommitted = committed = ~(unsigned)0; int ret = tsman.get_page_free_bits(&key, &uncommitted, &committed); ndbrequire(ret == 0); - if (committed == 0) { + if (committed == 0 && uncommitted == 0) { // skip empty page jam(); pos.m_get = ScanPos::Get_next_page_dd; From 16f5fec258a240ffc9a43a80cb7b4a41aab3c081 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 8 Oct 2007 16:02:21 +0200 Subject: [PATCH 26/49] ndb - fix dd drop table race condition add list of pages being unmaped, so we can wait for it to be empty before dropping extents storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp: add list of pages being unmaped storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp: add list of pages being unmaped storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp: wait for unmap pages --- storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp | 2 ++ .../ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp | 6 ++++++ storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp | 13 +++++++++++++ 3 files changed, 21 insertions(+) diff --git a/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp b/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp index eaf00138acf..08332a2e1a1 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp +++ b/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp @@ -563,6 +563,8 @@ typedef Ptr FragoperrecPtr; */ Page_request_list::Head m_page_requests[MAX_FREE_LIST]; + DLList::Head m_unmap_pages; + /** * Current extent */ diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp index 4509adb7da0..a235e02a4b7 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp +++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp @@ -956,7 +956,9 @@ Dbtup::disk_page_unmap_callback(Uint32 when, ArrayPool *pool= (ArrayPool*)&m_global_page_pool; LocalDLList list(*pool, alloc.m_dirty_pages[idx]); + LocalDLList list2(*pool, alloc.m_unmap_pages); list.remove(pagePtr); + list2.add(pagePtr); if (dirty_count == 0) { @@ -999,6 +1001,10 @@ Dbtup::disk_page_unmap_callback(Uint32 when, << " cnt: " << dirty_count << " " << (idx & ~0x8000) << endl; } + ArrayPool *pool= (ArrayPool*)&m_global_page_pool; + LocalDLList list(*pool, alloc.m_unmap_pages); + list.remove(pagePtr); + Tablespace_client tsman(0, c_tsman, fragPtr.p->fragTableId, fragPtr.p->fragmentId, diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp index 94366905e00..4df3f91068c 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp +++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp @@ -1005,7 +1005,20 @@ Dbtup::drop_fragment_unmap_pages(Signal *signal, { if (tabPtr.p->m_no_of_disk_attributes) { + jam(); Disk_alloc_info& alloc_info= fragPtr.p->m_disk_alloc_info; + + if (!alloc_info.m_unmap_pages.isEmpty()) + { + jam(); + ndbout_c("waiting for unmape pages"); + signal->theData[0] = ZUNMAP_PAGES; + signal->theData[1] = tabPtr.i; + signal->theData[2] = fragPtr.i; + signal->theData[3] = pos; + sendSignal(cownref, GSN_CONTINUEB, signal, 4, JBB); + return; + } while(alloc_info.m_dirty_pages[pos].isEmpty() && pos < MAX_FREE_LIST) pos++; From a586bb61c0510e053c727753e04651e2aaa48609 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 8 Oct 2007 16:10:41 +0200 Subject: [PATCH 27/49] ndb - post merge fixes storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp: merge storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp: merge --- storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp | 4 ---- storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp index 9115ddf2e67..8420e7f2bde 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp +++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp @@ -1026,8 +1026,6 @@ Dbtup::disk_page_alloc(Signal* signal, Disk_alloc_info& alloc= fragPtrP->m_disk_alloc_info; Uint64 lsn; - Uint32 old_free = pagePtr.p->free_space; - Uint32 old_bits= alloc.calc_page_free_bits(old_free); if (tabPtrP->m_attributes[DD].m_no_of_varsize == 0) { ddassert(pagePtr.p->uncommitted_used_space > 0); @@ -1059,7 +1057,6 @@ Dbtup::disk_page_free(Signal *signal, Uint32 logfile_group_id= fragPtrP->m_logfile_group_id; Disk_alloc_info& alloc= fragPtrP->m_disk_alloc_info; Uint32 old_free= pagePtr.p->free_space; - Uint32 old_bits= alloc.calc_page_free_bits(old_free); Uint32 sz; Uint64 lsn; @@ -1086,7 +1083,6 @@ Dbtup::disk_page_free(Signal *signal, } Uint32 new_free = pagePtr.p->free_space; - Uint32 new_bits = alloc.calc_page_free_bits(new_free); Uint32 ext = pagePtr.p->m_extent_info_ptr; Uint32 used = pagePtr.p->uncommitted_used_space; diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp index e24927c4cb1..c8df5f5154e 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp +++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp @@ -967,7 +967,7 @@ void Dbtup::releaseFragment(Signal* signal, Uint32 tableId, cb.m_callbackFunction = safe_cast(&Dbtup::drop_table_log_buffer_callback); Uint32 sz= sizeof(Disk_undo::Drop) >> 2; - (void) c_lgman->alloc_log_space(logfile_group_id, sz); + int r0 = c_lgman->alloc_log_space(logfile_group_id, sz); if (r0) { jam(); From deb74591c9898e04ec3d0b9944e83f763eb3c6a7 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 9 Oct 2007 09:39:39 +0200 Subject: [PATCH 28/49] Bug #31470 ndb table with special characters in name are not discovered correctly --- mysql-test/suite/ndb/r/ndb_multi.result | 21 +++++++++++++++++++ mysql-test/suite/ndb/t/ndb_multi.test | 27 +++++++++++++++++++++++++ sql/handler.cc | 3 +-- 3 files changed, 49 insertions(+), 2 deletions(-) diff --git a/mysql-test/suite/ndb/r/ndb_multi.result b/mysql-test/suite/ndb/r/ndb_multi.result index 2bc49bf9b45..98c4265b833 100644 --- a/mysql-test/suite/ndb/r/ndb_multi.result +++ b/mysql-test/suite/ndb/r/ndb_multi.result @@ -121,3 +121,24 @@ show tables; Tables_in_db t2 drop database db; +use test; +create table `test`.`t1$EX` + (server_id int unsigned, +master_server_id int unsigned, +master_epoch bigint unsigned, +count int unsigned, +primary key(server_id, master_server_id, +master_epoch, count)) +engine ndb; +show tables like '%$%'; +Tables_in_test (%$%) +t1$EX +use test; +show tables like '%$%'; +Tables_in_test (%$%) +t1$EX +drop table `test`.`t1$EX`; +show tables like '%$%'; +Tables_in_test (%$%) +show tables like '%$%'; +Tables_in_test (%$%) diff --git a/mysql-test/suite/ndb/t/ndb_multi.test b/mysql-test/suite/ndb/t/ndb_multi.test index b8e052d606b..ce7e22b3b7f 100644 --- a/mysql-test/suite/ndb/t/ndb_multi.test +++ b/mysql-test/suite/ndb/t/ndb_multi.test @@ -122,4 +122,31 @@ connection server2; show tables; drop database db; + +# +# bug#31470, ndb table with special characters in name +# are not discovered correctly connection server1; +use test; +create table `test`.`t1$EX` + (server_id int unsigned, + master_server_id int unsigned, + master_epoch bigint unsigned, + count int unsigned, + primary key(server_id, master_server_id, + master_epoch, count)) + engine ndb; + +# check that table shows up ok on both servers +# before bugfix table would not show up on server2 +show tables like '%$%'; +connection server2; +use test; +show tables like '%$%'; + +# check cleanup +drop table `test`.`t1$EX`; +show tables like '%$%'; + +connection server1; +show tables like '%$%'; diff --git a/sql/handler.cc b/sql/handler.cc index dbe7f6727f7..126882c8e44 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -2641,8 +2641,7 @@ int ha_create_table_from_engine(THD* thd, const char *db, const char *name) frmblob and frmlen are set, write the frm to disk */ - (void)strxnmov(path,FN_REFLEN-1,mysql_data_home,FN_ROOTDIR, - db,FN_ROOTDIR,name,NullS); + build_table_filename(path, FN_REFLEN-1, db, name, "", 0); // Save the frm file error= writefrm(path, frmblob, frmlen); my_free(frmblob, MYF(0)); From 33bd12e19906dce3044679164563840e06c3eacd Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 9 Oct 2007 09:55:30 +0200 Subject: [PATCH 29/49] ndb - testSystemRestart -n SR_UNDO yet another test prg bug storage/ndb/test/ndbapi/testSystemRestart.cpp: yet another test prg bug --- storage/ndb/test/ndbapi/testSystemRestart.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/ndb/test/ndbapi/testSystemRestart.cpp b/storage/ndb/test/ndbapi/testSystemRestart.cpp index 419c1eb1438..67429ee0a41 100644 --- a/storage/ndb/test/ndbapi/testSystemRestart.cpp +++ b/storage/ndb/test/ndbapi/testSystemRestart.cpp @@ -330,7 +330,7 @@ int runSystemRestartTestUndoLog(NDBT_Context* ctx, NDBT_Step* step){ CHECK(hugoTrans.loadTable(pNdb, records) == 0); CHECK(hugoTrans.pkUpdateRecords(pNdb, records) == 0); CHECK(hugoTrans.pkDelRecords(pNdb, records/2) == 0); - CHECK(hugoTrans.scanUpdateRecords(pNdb, records) == 0); + CHECK(hugoTrans.scanUpdateRecords(pNdb, records/2) == 0); CHECK(utilTrans.clearTable(pNdb, records) == 0); CHECK(hugoTrans.loadTable(pNdb, records) == 0); CHECK(utilTrans.clearTable(pNdb, records) == 0); From b9b14911a97a02d9934acf3fc21a017ecd91b3fc Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 9 Oct 2007 10:41:26 +0200 Subject: [PATCH 30/49] ndb - more test prg fixes (due to small change in scanUpdates impl.) (autotest tests) storage/ndb/test/ndbapi/testDict.cpp: more test prg fixes storage/ndb/test/ndbapi/testIndex.cpp: more test prg fixes storage/ndb/test/ndbapi/test_event.cpp: more test prg fixes --- storage/ndb/test/ndbapi/testDict.cpp | 4 ++-- storage/ndb/test/ndbapi/testIndex.cpp | 4 ++-- storage/ndb/test/ndbapi/test_event.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/storage/ndb/test/ndbapi/testDict.cpp b/storage/ndb/test/ndbapi/testDict.cpp index f7de43aea20..656b074ce8b 100644 --- a/storage/ndb/test/ndbapi/testDict.cpp +++ b/storage/ndb/test/ndbapi/testDict.cpp @@ -679,7 +679,7 @@ int runTestFragmentTypes(NDBT_Context* ctx, NDBT_Step* step){ CHECK(utilTrans.selectCount(pNdb, 64, &count) == 0); CHECK(count == records); CHECK(hugoTrans.pkDelRecords(pNdb, records/2) == 0); - CHECK(hugoTrans.scanUpdateRecords(pNdb, records) == 0); + CHECK(hugoTrans.scanUpdateRecords(pNdb, records/2) == 0); CHECK(utilTrans.selectCount(pNdb, 64, &count) == 0); CHECK(count == (records/2)); @@ -857,7 +857,7 @@ int runPkSizes(NDBT_Context* ctx, NDBT_Step* step){ CHECK(utilTrans.selectCount(pNdb, 64, &count) == 0); CHECK(count == records); CHECK(hugoTrans.pkDelRecords(pNdb, records/2) == 0); - CHECK(hugoTrans.scanUpdateRecords(pNdb, records) == 0); + CHECK(hugoTrans.scanUpdateRecords(pNdb, records/2) == 0); CHECK(utilTrans.selectCount(pNdb, 64, &count) == 0); CHECK(count == (records/2)); CHECK(utilTrans.clearTable(pNdb, records) == 0); diff --git a/storage/ndb/test/ndbapi/testIndex.cpp b/storage/ndb/test/ndbapi/testIndex.cpp index 7691f036a46..e52aafa296b 100644 --- a/storage/ndb/test/ndbapi/testIndex.cpp +++ b/storage/ndb/test/ndbapi/testIndex.cpp @@ -809,7 +809,7 @@ int runSystemRestart1(NDBT_Context* ctx, NDBT_Step* step){ CHECK(hugoTrans.pkUpdateRecords(pNdb, records) == 0); CHECK(utilTrans.verifyIndex(pNdb, idxName, 16, false) == 0); CHECK(hugoTrans.pkDelRecords(pNdb, records/2) == 0); - CHECK(hugoTrans.scanUpdateRecords(pNdb, records) == 0); + CHECK(hugoTrans.scanUpdateRecords(pNdb, records/2) == 0); CHECK(utilTrans.verifyIndex(pNdb, idxName, 16, false) == 0); CHECK(utilTrans.clearTable(pNdb, records) == 0); CHECK(hugoTrans.loadTable(pNdb, records, 1) == 0); @@ -834,7 +834,7 @@ int runSystemRestart1(NDBT_Context* ctx, NDBT_Step* step){ CHECK(utilTrans.verifyIndex(pNdb, idxName, 16, false) == 0); CHECK(hugoTrans.pkDelRecords(pNdb, records/2) == 0); CHECK(utilTrans.verifyIndex(pNdb, idxName, 16, false) == 0); - CHECK(hugoTrans.scanUpdateRecords(pNdb, records) == 0); + CHECK(hugoTrans.scanUpdateRecords(pNdb, records/2) == 0); CHECK(utilTrans.verifyIndex(pNdb, idxName, 16, false) == 0); CHECK(utilTrans.clearTable(pNdb, records) == 0); CHECK(hugoTrans.loadTable(pNdb, records, 1) == 0); diff --git a/storage/ndb/test/ndbapi/test_event.cpp b/storage/ndb/test/ndbapi/test_event.cpp index e1e0012d0d8..2083e235a3e 100644 --- a/storage/ndb/test/ndbapi/test_event.cpp +++ b/storage/ndb/test/ndbapi/test_event.cpp @@ -1730,7 +1730,7 @@ runScanUpdateUntilStopped(NDBT_Context* ctx, NDBT_Step* step){ HugoTransactions hugoTrans(*ctx->getTab()); while (ctx->isTestStopped() == false) { - if (hugoTrans.scanUpdateRecords(GETNDB(step), records, abort, + if (hugoTrans.scanUpdateRecords(GETNDB(step), 0, abort, parallelism) == NDBT_FAILED){ return NDBT_FAILED; } From de4cce52882b0c67a500ecec55efbb7c9bd4bbc4 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 9 Oct 2007 19:51:57 +0200 Subject: [PATCH 31/49] Updated NDB test to run for both RBR and MBR testing. In addition added test for Innodb and updated results files for all tests. mysql-test/suite/rpl_ndb/t/rpl_ndb_charset.test: Updated test to run for both row and mixed replication testing mysql-test/suite/rpl_ndb/r/rpl_ndb_charset.result: Updated results file mysql-test/extra/rpl_tests/rpl_row_charset.test: Updated test to specify the engine in the create. In addition had to add BIG SQL for NDB mysql-test/suite/rpl/r/rpl_row_charset.result: Updated results file mysql-test/suite/rpl/t/rpl_row_charset_innodb.test: Created a wrapper to test innodb storage engine as well mysql-test/suite/rpl/t/rpl_row_charset_innodb-master.opt: Option file to ensure innodb on master mysql-test/suite/rpl/t/rpl_row_charset_innodb-slave.opt: Option file to ensure innodb on slave mysql-test/suite/rpl/r/rpl_row_charset_innodb.result: New results file for innodb test case --- .../extra/rpl_tests/rpl_row_charset.test | 6 +- mysql-test/suite/rpl/r/rpl_row_charset.result | 8 +- .../suite/rpl/r/rpl_row_charset_innodb.result | 215 ++++++++++++++++++ .../rpl/t/rpl_row_charset_innodb-master.opt | 1 + .../rpl/t/rpl_row_charset_innodb-slave.opt | 1 + .../suite/rpl/t/rpl_row_charset_innodb.test | 9 + .../suite/rpl_ndb/r/rpl_ndb_charset.result | 34 +-- .../suite/rpl_ndb/t/rpl_ndb_charset.test | 4 +- 8 files changed, 254 insertions(+), 24 deletions(-) create mode 100644 mysql-test/suite/rpl/r/rpl_row_charset_innodb.result create mode 100644 mysql-test/suite/rpl/t/rpl_row_charset_innodb-master.opt create mode 100644 mysql-test/suite/rpl/t/rpl_row_charset_innodb-slave.opt create mode 100644 mysql-test/suite/rpl/t/rpl_row_charset_innodb.test diff --git a/mysql-test/extra/rpl_tests/rpl_row_charset.test b/mysql-test/extra/rpl_tests/rpl_row_charset.test index a21ed5bb841..c1eccff9bd5 100644 --- a/mysql-test/extra/rpl_tests/rpl_row_charset.test +++ b/mysql-test/extra/rpl_tests/rpl_row_charset.test @@ -38,7 +38,7 @@ show create database mysqltest3; connection master; use mysqltest2; -create table t1 (a int auto_increment primary key, b varchar(100)); +--eval create table t1 (a int auto_increment primary key, b varchar(100))engine=$engine_type; set character_set_client=cp850, collation_connection=latin2_croatian_ci; insert into t1 (b) values(@@character_set_server); insert into t1 (b) values(@@collation_server); @@ -146,13 +146,15 @@ set collation_server=9999998; select "--- --3943--" as ""; use test; -CREATE TABLE t1 (c1 VARBINARY(255), c2 VARBINARY(255)); +--eval CREATE TABLE t1 (c1 VARBINARY(255), c2 VARBINARY(255))ENGINE=$engine_type; SET CHARACTER_SET_CLIENT=koi8r, CHARACTER_SET_CONNECTION=cp1251, CHARACTER_SET_RESULTS=koi8r; INSERT INTO t1 (c1, c2) VALUES ('îÕ, ÚÁ ÒÙÂÁÌËÕ','îÕ, ÚÁ ÒÙÂÁÌËÕ'); +SET SQL_BIG_SELECTS=1; select hex(c1), hex(c2) from t1; sync_slave_with_master; +SET SQL_BIG_SELECTS=1; select hex(c1), hex(c2) from t1; connection master; diff --git a/mysql-test/suite/rpl/r/rpl_row_charset.result b/mysql-test/suite/rpl/r/rpl_row_charset.result index e51f3e57d1f..caaa9d8332b 100644 --- a/mysql-test/suite/rpl/r/rpl_row_charset.result +++ b/mysql-test/suite/rpl/r/rpl_row_charset.result @@ -40,7 +40,7 @@ show create database mysqltest3; Database Create Database mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET armscii8 COLLATE armscii8_bin */ use mysqltest2; -create table t1 (a int auto_increment primary key, b varchar(100)); +create table t1 (a int auto_increment primary key, b varchar(100))engine=myisam;; set character_set_client=cp850, collation_connection=latin2_croatian_ci; insert into t1 (b) values(@@character_set_server); insert into t1 (b) values(@@collation_server); @@ -117,7 +117,7 @@ master-bin.000001 # Query # # create database mysqltest2 character set latin2 master-bin.000001 # Query # # create database mysqltest3 master-bin.000001 # Query # # drop database mysqltest3 master-bin.000001 # Query # # create database mysqltest3 -master-bin.000001 # Query # # use `mysqltest2`; create table t1 (a int auto_increment primary key, b varchar(100)) +master-bin.000001 # Query # # use `mysqltest2`; create table t1 (a int auto_increment primary key, b varchar(100))engine=myisam master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) @@ -177,14 +177,16 @@ select "--- --3943--" as ""; --- --3943-- use test; -CREATE TABLE t1 (c1 VARBINARY(255), c2 VARBINARY(255)); +CREATE TABLE t1 (c1 VARBINARY(255), c2 VARBINARY(255))ENGINE=myisam;; SET CHARACTER_SET_CLIENT=koi8r, CHARACTER_SET_CONNECTION=cp1251, CHARACTER_SET_RESULTS=koi8r; INSERT INTO t1 (c1, c2) VALUES ('îÕ, ÚÁ ÒÙÂÁÌËÕ','îÕ, ÚÁ ÒÙÂÁÌËÕ'); +SET SQL_BIG_SELECTS=1; select hex(c1), hex(c2) from t1; hex(c1) hex(c2) CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3 +SET SQL_BIG_SELECTS=1; select hex(c1), hex(c2) from t1; hex(c1) hex(c2) CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3 diff --git a/mysql-test/suite/rpl/r/rpl_row_charset_innodb.result b/mysql-test/suite/rpl/r/rpl_row_charset_innodb.result new file mode 100644 index 00000000000..eb1dc585457 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_row_charset_innodb.result @@ -0,0 +1,215 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +set timestamp=1000000000; +drop database if exists mysqltest2; +drop database if exists mysqltest3; +create database mysqltest2 character set latin2; +set @@character_set_server=latin5; +create database mysqltest3; + +--- --master-- +show create database mysqltest2; +Database Create Database +mysqltest2 CREATE DATABASE `mysqltest2` /*!40100 DEFAULT CHARACTER SET latin2 */ +show create database mysqltest3; +Database Create Database +mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET latin5 */ + +--- --slave-- +show create database mysqltest2; +Database Create Database +mysqltest2 CREATE DATABASE `mysqltest2` /*!40100 DEFAULT CHARACTER SET latin2 */ +show create database mysqltest3; +Database Create Database +mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET latin5 */ +set @@collation_server=armscii8_bin; +drop database mysqltest3; +create database mysqltest3; + +--- --master-- +show create database mysqltest3; +Database Create Database +mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET armscii8 COLLATE armscii8_bin */ + +--- --slave-- +show create database mysqltest3; +Database Create Database +mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET armscii8 COLLATE armscii8_bin */ +use mysqltest2; +create table t1 (a int auto_increment primary key, b varchar(100))engine=innodb;; +set character_set_client=cp850, collation_connection=latin2_croatian_ci; +insert into t1 (b) values(@@character_set_server); +insert into t1 (b) values(@@collation_server); +insert into t1 (b) values(@@character_set_client); +insert into t1 (b) values(@@character_set_connection); +insert into t1 (b) values(@@collation_connection); + +--- --master-- +select * from t1 order by a; +a b +1 armscii8 +2 armscii8_bin +3 cp850 +4 latin2 +5 latin2_croatian_ci + +--- --slave-- +select * from mysqltest2.t1 order by a; +a b +1 armscii8 +2 armscii8_bin +3 cp850 +4 latin2 +5 latin2_croatian_ci +select "--- --muller--" as ""; + +--- --muller-- +set character_set_client=latin1, collation_connection=latin1_german1_ci; +truncate table t1; +insert into t1 (b) values(@@collation_connection); +insert into t1 (b) values(LEAST("Müller","Muffler")); +set collation_connection=latin1_german2_ci; +insert into t1 (b) values(@@collation_connection); +insert into t1 (b) values(LEAST("Müller","Muffler")); + +--- --master-- +select * from t1 order by a; +a b +1 latin1_german1_ci +2 Muffler +3 latin1_german2_ci +4 Müller + +--- --slave-- +select * from mysqltest2.t1 order by a; +a b +1 latin1_german1_ci +2 Muffler +3 latin1_german2_ci +4 Müller +select "--- --INSERT--" as ""; + +--- --INSERT-- +set @a= _cp850 'Müller' collate cp850_general_ci; +truncate table t1; +insert into t1 (b) values(collation(@a)); + +--- --master-- +select * from t1 order by a; +a b +1 cp850_general_ci + +--- --slave-- +select * from mysqltest2.t1 order by a; +a b +1 cp850_general_ci +drop database mysqltest2; +drop database mysqltest3; +show binlog events from ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # drop database if exists mysqltest2 +master-bin.000001 # Query # # drop database if exists mysqltest3 +master-bin.000001 # Query # # create database mysqltest2 character set latin2 +master-bin.000001 # Query # # create database mysqltest3 +master-bin.000001 # Query # # drop database mysqltest3 +master-bin.000001 # Query # # create database mysqltest3 +master-bin.000001 # Query # # use `mysqltest2`; create table t1 (a int auto_increment primary key, b varchar(100))engine=innodb +master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `mysqltest2`; truncate table t1 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `mysqltest2`; truncate table t1 +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # drop database mysqltest2 +master-bin.000001 # Query # # drop database mysqltest3 +select "--- --global--" as ""; + +--- --global-- +set global character_set_server=latin2; +set global character_set_server=latin1; +set global character_set_server=latin2; +set global character_set_server=latin1; +select "--- --oneshot--" as ""; + +--- --oneshot-- +set one_shot @@character_set_server=latin5; +set @@max_join_size=1000; +select @@character_set_server; +@@character_set_server +latin5 +select @@character_set_server; +@@character_set_server +latin1 +set @@character_set_server=latin5; +select @@character_set_server; +@@character_set_server +latin5 +select @@character_set_server; +@@character_set_server +latin5 +set one_shot max_join_size=10; +ERROR HY000: The 'SET ONE_SHOT' syntax is reserved for purposes internal to the MySQL server +set character_set_client=9999999; +ERROR 42000: Unknown character set: '9999999' +set collation_server=9999998; +ERROR HY000: Unknown collation: '9999998' +select "--- --3943--" as ""; + +--- --3943-- +use test; +CREATE TABLE t1 (c1 VARBINARY(255), c2 VARBINARY(255))ENGINE=innodb;; +SET CHARACTER_SET_CLIENT=koi8r, +CHARACTER_SET_CONNECTION=cp1251, +CHARACTER_SET_RESULTS=koi8r; +INSERT INTO t1 (c1, c2) VALUES ('îÕ, ÚÁ ÒÙÂÁÌËÕ','îÕ, ÚÁ ÒÙÂÁÌËÕ'); +SET SQL_BIG_SELECTS=1; +select hex(c1), hex(c2) from t1; +hex(c1) hex(c2) +CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3 +SET SQL_BIG_SELECTS=1; +select hex(c1), hex(c2) from t1; +hex(c1) hex(c2) +CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3 +drop table t1; +select "--- --6676--" as ""; + +--- --6676-- +create table `t1` ( +`pk` varchar(10) not null default '', +primary key (`pk`) +) engine=innodb default charset=latin1; +set @p=_latin1 'test'; +update t1 set pk='test' where pk=@p; +drop table t1; diff --git a/mysql-test/suite/rpl/t/rpl_row_charset_innodb-master.opt b/mysql-test/suite/rpl/t/rpl_row_charset_innodb-master.opt new file mode 100644 index 00000000000..627becdbfb5 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_row_charset_innodb-master.opt @@ -0,0 +1 @@ +--innodb diff --git a/mysql-test/suite/rpl/t/rpl_row_charset_innodb-slave.opt b/mysql-test/suite/rpl/t/rpl_row_charset_innodb-slave.opt new file mode 100644 index 00000000000..627becdbfb5 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_row_charset_innodb-slave.opt @@ -0,0 +1 @@ +--innodb diff --git a/mysql-test/suite/rpl/t/rpl_row_charset_innodb.test b/mysql-test/suite/rpl/t/rpl_row_charset_innodb.test new file mode 100644 index 00000000000..1465500d0eb --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_row_charset_innodb.test @@ -0,0 +1,9 @@ +######################################################## +# By JBM 2005-02-15 Wrapped to allow reuse of test code# +# Added to skip if ndb is default # +######################################################## +-- source include/not_ndb_default.inc +-- source include/have_binlog_format_row.inc +-- source include/master-slave.inc +let $engine_type=innodb; +-- source extra/rpl_tests/rpl_row_charset.test diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_charset.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_charset.result index ed9b3cfbfa8..8b1f3093332 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_charset.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_charset.result @@ -40,7 +40,7 @@ show create database mysqltest3; Database Create Database mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET armscii8 COLLATE armscii8_bin */ use mysqltest2; -create table t1 (a int auto_increment primary key, b varchar(100)); +create table t1 (a int auto_increment primary key, b varchar(100))engine=NDB;; set character_set_client=cp850, collation_connection=latin2_croatian_ci; insert into t1 (b) values(@@character_set_server); insert into t1 (b) values(@@collation_server); @@ -117,29 +117,27 @@ master-bin.000001 # Query # # create database mysqltest2 character set latin2 master-bin.000001 # Query # # create database mysqltest3 master-bin.000001 # Query # # drop database mysqltest3 master-bin.000001 # Query # # create database mysqltest3 -master-bin.000001 # Query # # use `mysqltest2`; create table t1 (a int auto_increment primary key, b varchar(100)) -master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `mysqltest2`; create table t1 (a int auto_increment primary key, b varchar(100))engine=NDB +master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `mysqltest2`; truncate table t1 +master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `mysqltest2`; truncate table t1 +master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (mysqltest2.t1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # drop database mysqltest2 master-bin.000001 # Query # # drop database mysqltest3 select "--- --global--" as ""; @@ -177,14 +175,16 @@ select "--- --3943--" as ""; --- --3943-- use test; -CREATE TABLE t1 (c1 VARBINARY(255), c2 VARBINARY(255)); +CREATE TABLE t1 (c1 VARBINARY(255), c2 VARBINARY(255))ENGINE=NDB;; SET CHARACTER_SET_CLIENT=koi8r, CHARACTER_SET_CONNECTION=cp1251, CHARACTER_SET_RESULTS=koi8r; INSERT INTO t1 (c1, c2) VALUES ('îÕ, ÚÁ ÒÙÂÁÌËÕ','îÕ, ÚÁ ÒÙÂÁÌËÕ'); +SET SQL_BIG_SELECTS=1; select hex(c1), hex(c2) from t1; hex(c1) hex(c2) CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3 +SET SQL_BIG_SELECTS=1; select hex(c1), hex(c2) from t1; hex(c1) hex(c2) CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3 diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_charset.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_charset.test index 4bac267443e..f14229a52f9 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_charset.test +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_charset.test @@ -1,8 +1,8 @@ ######################################################## # By JBM 2005-02-15 Wrapped to allow reuse of test code# ######################################################## ---source include/have_ndb.inc --- source include/have_binlog_format_row.inc +-- source include/have_ndb.inc +-- source include/have_binlog_format_mixed_or_row.inc -- source include/ndb_master-slave.inc let $engine_type=NDB; -- source extra/rpl_tests/rpl_row_charset.test From 1f3caac29753874a9e13c6254ba1a3119609c80c Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 10 Oct 2007 14:18:34 +0200 Subject: [PATCH 32/49] rpl_bug31076.test, rpl_bug31076.result: Correcting test bug mysql-test/suite/rpl/r/rpl_bug31076.result: Correcting test bug mysql-test/suite/rpl/t/rpl_bug31076.test: Correcting test bug --- mysql-test/suite/rpl/r/rpl_bug31076.result | 1 + mysql-test/suite/rpl/t/rpl_bug31076.test | 3 +++ 2 files changed, 4 insertions(+) diff --git a/mysql-test/suite/rpl/r/rpl_bug31076.result b/mysql-test/suite/rpl/r/rpl_bug31076.result index c991b2f1946..2d6bed37901 100644 --- a/mysql-test/suite/rpl/r/rpl_bug31076.result +++ b/mysql-test/suite/rpl/r/rpl_bug31076.result @@ -61,3 +61,4 @@ visits_id myid src ip cc org ref time host entry visit_exit user_id visit_start SELECT * FROM visits_events; event_id visit_id timestamp src data visits_events_id 20000 21231038 2007-09-18 03:59:02 Downloads/MySQL-4.1/mysql-4.1.12a-win32.zip 33712207 +DROP DATABASE track; diff --git a/mysql-test/suite/rpl/t/rpl_bug31076.test b/mysql-test/suite/rpl/t/rpl_bug31076.test index 6cb8cc0d902..70584e4e830 100644 --- a/mysql-test/suite/rpl/t/rpl_bug31076.test +++ b/mysql-test/suite/rpl/t/rpl_bug31076.test @@ -111,3 +111,6 @@ VALUES ('3m3l4rhs6do0sf5p1i9lr94g928a272v', '', '', INET_ATON('71.118.124.98'), SELECT * FROM visits; SELECT * FROM visits_events; + +DROP DATABASE track; +# End 5.1 test case From 15c04ead976791c4cf512b828282759751d84559 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 10 Oct 2007 16:43:20 +0200 Subject: [PATCH 33/49] .del-rpl_stm_extraColmaster_ndb.test~5ac81fa1ec366ba: Delete: mysql-test/suite/rpl/t/rpl_stm_extraColmaster_ndb.test .del-rpl_row_extraColmaster_ndb.result~a2c64bae75b49d2: Delete: mysql-test/suite/rpl/r/rpl_row_extraColmaster_ndb.result .del-rpl_row_extraColmaster_ndb.test~523b0954869c4423: Delete: mysql-test/suite/rpl/t/rpl_row_extraColmaster_ndb.test Many files: merged and cleanup of test cases BitKeeper/deleted/.del-rpl_row_extraColmaster_ndb.test~523b0954869c4423: Delete: mysql-test/suite/rpl/t/rpl_row_extraColmaster_ndb.test BitKeeper/deleted/.del-rpl_stm_extraColmaster_ndb.test~5ac81fa1ec366ba: Delete: mysql-test/suite/rpl/t/rpl_stm_extraColmaster_ndb.test BitKeeper/deleted/.del-rpl_row_extraColmaster_ndb.result~a2c64bae75b49d2: Delete: mysql-test/suite/rpl/r/rpl_row_extraColmaster_ndb.result mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result: merged and cleanup of test cases mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result: merged and cleanup of test cases mysql-test/suite/rpl/t/rpl_extraColmaster_innodb.test: merged and cleanup of test cases mysql-test/suite/rpl/t/rpl_extraColmaster_myisam.test: merged and cleanup of test cases mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test: merged and cleanup of test cases --- .../extra/rpl_tests/rpl_extraMaster_Col.test | 842 ++++++++++++++---- .../rpl/r/rpl_extraColmaster_innodb.result | Bin 38226 -> 98074 bytes .../rpl/r/rpl_extraColmaster_myisam.result | Bin 38226 -> 98074 bytes .../rpl/r/rpl_row_extraColmaster_ndb.result | Bin 19129 -> 0 bytes .../rpl/t/rpl_extraColmaster_innodb.test | 3 +- .../rpl/t/rpl_extraColmaster_myisam.test | 2 + .../rpl/t/rpl_row_extraColmaster_ndb.test | 12 - .../rpl/t/rpl_stm_extraColmaster_ndb.test | 13 - 8 files changed, 696 insertions(+), 176 deletions(-) delete mode 100644 mysql-test/suite/rpl/r/rpl_row_extraColmaster_ndb.result delete mode 100644 mysql-test/suite/rpl/t/rpl_row_extraColmaster_ndb.test delete mode 100644 mysql-test/suite/rpl/t/rpl_stm_extraColmaster_ndb.test diff --git a/mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test b/mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test index 26b1e6d5ba0..d3959d10306 100644 --- a/mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test +++ b/mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test @@ -1,16 +1,22 @@ ############################################################# +# Author: Chuck +############################################################# # Purpose: To test having extra columns on the master WL#3915 # engine inspecific sourced part ############################################################# - +# Change Author: Jeb +# Change: Cleanup and extend testing +############################################################# # TODO: partition specific # -- source include/have_partition.inc +# Note: Will be done in different test due to NDB using this +# test case. +############################################################ ########### Clean up ################ --disable_warnings --disable_query_log -DROP TABLE IF EXISTS t1,t2,t3,t4,t31; - +DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t10,t11,t12,t13,t14,t15,t16,t17,t18,t31; --enable_query_log --enable_warnings @@ -70,154 +76,87 @@ DROP TABLE IF EXISTS t1,t2,t3,t4,t31; #VARCHAR(M) # - +let $binformat = `SHOW VARIABLES LIKE '%binlog_format%'`; +--echo +--echo *********************************************************** +--echo *********************************************************** +--echo ***************** Start of Testing ************************ +--echo *********************************************************** +--echo *********************************************************** +--echo * This test format == $binformat and engine == $engine_type +--echo *********************************************************** +--echo *********************************************************** +--echo +--echo ***** Testing more columns on the Master ***** +--echo connection master; eval CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), - f5 FLOAT DEFAULT '2.00') - ENGINE=$engine_type; - -sync_slave_with_master; -alter table t1 drop f5; - -connection master; -INSERT into t1 values (1, 1, 1, 'first', 1.0); - - sync_slave_with_master; ---replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # ---query_vertical show slave status; - select * from t1 order by f3; - -connection master; -DROP TABLE t1; -eval CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), - f5 FLOAT DEFAULT '2.00', - f6 CHAR(4) DEFAULT 'TEST') - ENGINE=$engine_type; - -sync_slave_with_master; -alter table t1 drop f5, drop f6; - -connection master; -INSERT into t1 values (1, 1, 1, 'first', 1.0, 'yksi'); - - sync_slave_with_master; ---replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # ---query_vertical show slave status; - select * from t1 order by f3; - -connection master; -DROP TABLE t1; -eval CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), - f5 FLOAT DEFAULT '2.00', - f6 CHAR(4) DEFAULT 'TEST', - f7 INT DEFAULT '0') - ENGINE=$engine_type; - -sync_slave_with_master; -alter table t1 drop f5, drop f6, drop f7; - -connection master; -INSERT into t1 values (1, 1, 1, 'first', 1.0, 'yksi', 1); - sync_slave_with_master; ---replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # ---query_vertical show slave status; - select * from t1 order by f3; - -connection master; -DROP TABLE t1; -eval CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), - f5 FLOAT DEFAULT '2.00', - f6 CHAR(4) DEFAULT 'TEST', - f7 INT DEFAULT '0', - f8 TEXT) - ENGINE=$engine_type; - -sync_slave_with_master; -alter table t1 drop f5, drop f6, drop f7, drop f8; - -connection master; -INSERT into t1 values (1, 1, 1, 'first', 1.0, 'yksi', 1, 'lounge of happiness'); - sync_slave_with_master; ---replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # ---query_vertical show slave status; - select * from t1 order by f3; - -connection master; -DROP TABLE t1; -eval CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), - f5 FLOAT DEFAULT '2.00', - f6 CHAR(4) DEFAULT 'TEST', - f7 INT DEFAULT '0', - f8 TEXT, - f9 LONGBLOB) - ENGINE=$engine_type; - -sync_slave_with_master; -alter table t1 drop f5, drop f6, drop f7, drop f8, drop f9; - -connection master; -INSERT into t1 values (1, 1, 1, 'first', 1.0, 'yksi', 1, 'lounge of happiness', 'very fat blob'); - sync_slave_with_master; ---replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # ---query_vertical show slave status; - select * from t1 order by f3; - -connection master; -DROP TABLE t1; -eval CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), - f5 FLOAT DEFAULT '2.00', - f6 CHAR(4) DEFAULT 'TEST', - f7 INT DEFAULT '0', - f8 TEXT, - f9 LONGBLOB, - f10 BIT(63)) - ENGINE=$engine_type; - -sync_slave_with_master; -alter table t1 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10; - -connection master; -INSERT into t1 values (1, 1, 1, 'first', 1.0, 'yksi', 1, 'lounge of happiness', 'very fat blob', b'01010101010101'); - sync_slave_with_master; ---replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # ---query_vertical show slave status; - select * from t1 order by f3; - -connection master; -DROP TABLE t1; - eval CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), /* extra */ - f5 FLOAT DEFAULT '2.00', - f6 CHAR(4) DEFAULT 'TEST', - f7 INT DEFAULT '0', - f8 TEXT, - f9 LONGBLOB, - f10 BIT(63), - f11 VARBINARY(64)) - ENGINE=$engine_type; - -#connection slave; - sync_slave_with_master; - alter table t1 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11; + f5 FLOAT DEFAULT '2.00', + f6 CHAR(4) DEFAULT 'TEST', + f7 INT DEFAULT '0', + f8 TEXT, + f9 LONGBLOB, + f10 BIT(63), + f11 VARBINARY(64))ENGINE=$engine_type; +--echo +--echo * Alter Table on Slave and drop columns f5 through f11 * +--echo +sync_slave_with_master; +alter table t1 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11; +--echo +--echo * Insert data in Master then update and delete some rows* +--echo connection master; +let $j= 50; +--disable_query_log +while ($j) +{ + eval INSERT INTO t1 VALUES ($j, $j, $j, 'second', 2.0, 'kaks', 2, + 'got stolen from the paradise', + 'very fat blob', b'01010101010101', + 0x123456); + dec $j; +} +let $j= 30; +while ($j) +{ + eval update t1 set f4= 'next' where f1=$j; + dec $j; + dec $j; + eval delete from t1 where f1=$j; + dec $j; +} +--enable_query_log - INSERT into t1 values (1, 1, 1, 'first', 1.0, 'yksi', 1, 'lounge of happiness', 'very fat blob', b'01010101010101', 0x123456); - INSERT into t1 values (2, 2, 2, 'second', 2.0, 'kaks', 2, 'got stolen from the paradise', 'very fat blob', b'01010101010101', 0x123456), (3, 3, 3, 'third', 3.0, 'kolm', 3, 'got stolen from the paradise', 'very fat blob', b'01010101010101', 0x123456); - update t1 set f4= 'next' where f1=1; - delete from t1 where f1=1; - - select * from t1 order by f3; - +--echo * Select count and 20 rows from Master * +--echo +SELECT COUNT(*) FROM t1; +--echo +SELECT f1,f2,f3,f4,f5,f6,f7,f8,f9, + hex(f10),hex(f11) FROM t1 ORDER BY f3 LIMIT 20; #connection slave; - sync_slave_with_master; ---replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # ---query_vertical show slave status; - select * from t1 order by f3; +sync_slave_with_master; +--echo +--echo * Select count and 20 rows from Slave * +--echo +SELECT COUNT(*) FROM t1; +--echo +SELECT * FROM t1 ORDER BY f3 LIMIT 20; +--echo +--echo * Show Slave Status * +--echo +--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # +--query_vertical show slave status; +--echo ### Altering table def scenario +--echo +--echo ***** Testing Altering table def scenario ***** +--echo connection master; @@ -232,7 +171,7 @@ connection master; f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', f12 SET('a', 'b', 'c') default 'b') ENGINE=$engine_type; - +--echo eval CREATE TABLE t3 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), /* extra */ f5 DOUBLE DEFAULT '2.00', @@ -243,7 +182,7 @@ connection master; f12 SET('a', 'b', 'c') default 'b') ENGINE=$engine_type; - +--echo # no ENUM and SET eval CREATE TABLE t4 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), /* extra */ @@ -256,7 +195,7 @@ connection master; f11 CHAR(255)) ENGINE=$engine_type; - +--echo eval CREATE TABLE t31 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), /* extra */ @@ -293,7 +232,9 @@ connection master; f34 VARBINARY(1025), f35 VARCHAR(257) ) ENGINE=$engine_type; - +--echo +--echo ** Alter tables on slave and drop columns ** +--echo #connection slave; sync_slave_with_master; alter table t2 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11, drop @@ -308,8 +249,8 @@ f12; drop f26, drop f27, drop f28, drop f29, drop f30, drop f31, drop f32, drop f33, drop f34, drop f35; - - +--echo +--echo ** Insert Data into Master ** connection master; INSERT into t2 set f1=1, f2=1, f3=1, f4='first', f8='f8: medium size blob', f10='f10: some var char'; @@ -458,7 +399,10 @@ binary data'; /*f34 VARBINARY(1025),*/ '3333 minus 3', /*f35 VARCHAR(257),*/ NULL ); - +--echo +--echo ** Sync slave with master ** +--echo ** Do selects from tables ** +--echo #connection slave; sync_slave_with_master; @@ -469,24 +413,33 @@ binary data'; select * from t31 order by f1; connection master; - +--echo +--echo ** Do updates master ** +--echo update t31 set f5=555555555555555 where f3=6; update t31 set f2=2 where f3=2; update t31 set f1=NULL where f3=1; update t31 set f3=NULL, f27=NULL, f35='f35 new value' where f3=3; +--echo +--echo ** Delete from Master ** +--echo + delete from t1; delete from t2; delete from t3; delete from t4; delete from t31; +--echo +--echo ** Check slave status ** +--echo #connection slave; sync_slave_with_master; select * from t31; --replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # +--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # --query_vertical show slave status; #### Clean Up #### @@ -496,11 +449,600 @@ connection master; --disable_query_log DROP TABLE t1,t2,t3,t4,t31; +###################################################### #connection slave; sync_slave_with_master; --enable_query_log --enable_warnings +--echo +--echo **************************************** +--echo * columns in master at middle of table * +--echo * Expect: Proper error message * +--echo **************************************** +--echo +--echo ** Stop and Reset Slave ** +--echo +STOP SLAVE; +RESET SLAVE; +--echo +--echo ** create table slave side ** +eval CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5) + ) ENGINE=$engine_type; -# END of the tests +--echo +--echo ** Connect to master and create table ** +--echo +--connection master +eval CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233', + c CHAR(5), e INT DEFAULT '1')ENGINE=$engine_type; +RESET MASTER; + +--echo +--echo *** Start Slave *** +connection slave; +START SLAVE; + +--echo +--echo *** Master Data Insert *** +connection master; +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); +INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT), + (2,@b1,DEFAULT,'JOE',DEFAULT), + (3,@b1,DEFAULT,'QA',DEFAULT); + +--echo +--echo ******************************************** +--echo *** Expect slave to fail with Error 1523 *** +--echo ******************************************** +--echo +connection slave; +wait_for_slave_to_stop; +--replace_result $MASTER_MYPORT MASTER_PORT +--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # +--query_vertical SHOW SLAVE STATUS +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; +START SLAVE; + +--echo +--echo *** Drop t10 *** +connection master; +DROP TABLE t10; +sync_slave_with_master; + +############################################ +############## Continued ################### +############################################ +--echo +--echo ********************************************* +--echo * More columns in master at middle of table * +--echo * Expect: Proper error message * +--echo ********************************************* +--echo +--echo *** Create t11 on slave *** +STOP SLAVE; +RESET SLAVE; + +eval CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254) + ) ENGINE=$engine_type; + +--echo +--echo *** Create t11 on Master *** +connection master; +eval CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT, + c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE=$engine_type; + +RESET MASTER; + +--echo +--echo *** Start Slave *** +connection slave; +START SLAVE; + +--echo +--echo *** Master Data Insert *** +connection master; +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); +INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT), + (2,@b1,'Testing is cool','JOE',DEFAULT), + (3,@b1,DEFAULT,'QA',DEFAULT); + +--echo +--echo ******************************************** +--echo *** Expect slave to fail with Error 1523 *** +--echo ******************************************** +--echo +connection slave; +wait_for_slave_to_stop; +--replace_result $MASTER_MYPORT MASTER_PORT +--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # +--query_vertical SHOW SLAVE STATUS +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; +START SLAVE; + +--echo +--echo *** Drop t11 *** +connection master; +DROP TABLE t11; +sync_slave_with_master; + +############################################ +############## Continued ################### +############################################ +--echo +--echo ********************************************* +--echo * More columns in master at middle of table * +--echo * Expect: This one should pass blob-text * +--echo ********************************************* +--echo +--echo *** Create t12 on slave *** +STOP SLAVE; +RESET SLAVE; +eval CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB + ) ENGINE=$engine_type; + +--echo +--echo *** Create t12 on Master *** +connection master; +eval CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT, + c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE=$engine_type; + +RESET MASTER; + +--echo +--echo *** Start Slave *** +connection slave; +START SLAVE; + +--echo +--echo *** Master Data Insert *** +connection master; +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); +INSERT INTO t12 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), + (2,@b1,'JOE',DEFAULT,DEFAULT), + (3,@b1,'QA',DEFAULT,DEFAULT); +--echo +SELECT a,hex(b),f,c,e FROM t12 ORDER BY a; + +--echo +--echo *** Select on Slave *** +sync_slave_with_master; +SELECT a,hex(b),c FROM t12 ORDER BY a; + +--echo +--echo *** Drop t12 *** +connection master; +DROP TABLE t12; +sync_slave_with_master; + +############################################ +############## Continued ################### +############################################ +--echo +--echo **************************************************** +--echo * - Alter Master adding columns at middle of table * +--echo * Expect: columns added * +--echo **************************************************** +--echo +--echo +--echo *** Create t14 on slave *** +STOP SLAVE; +RESET SLAVE; +eval CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) + ) ENGINE=$engine_type; + +--echo +--echo *** Create t14 on Master *** +connection master; +eval CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5), + c6 INT DEFAULT '1', + c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP + )ENGINE=$engine_type; + +RESET MASTER; + +--echo +--echo *** Start Slave *** +connection slave; +START SLAVE; + +--echo +--echo *** Master Data Insert *** +connection master; +ALTER TABLE t14 ADD COLUMN c2 DECIMAL(8,2) AFTER c1; +ALTER TABLE t14 ADD COLUMN c3 TEXT AFTER c2; +--echo +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); +INSERT INTO t14 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle',DEFAULT,DEFAULT), + (2,2.00,'This Test Should work',@b1,'JOE',DEFAULT,DEFAULT), + (3,3.00,'If is does not, I will open a bug',@b1,'QA',DEFAULT,DEFAULT); +--echo +--replace_column 7 CURRENT_TIMESTAMP +SELECT c1,c2,c3,hex(c4),c5,c6,c7 FROM t14 ORDER BY c1; + +--echo +--echo *** Select on Slave **** +sync_slave_with_master; +SELECT c1,c2,c3,hex(c4),c5 FROM t14 ORDER BY c1; + +#################################################### +--echo +--echo **************************************************** +--echo * - Alter Master Dropping columns from the middle. * +--echo * Expect: columns dropped * +--echo **************************************************** +--echo +--echo *** connect to master and drop columns *** +connection master; +ALTER TABLE t14 DROP COLUMN c2; +ALTER TABLE t14 DROP COLUMN c7; +--echo +--echo *** Select from Master *** +SELECT c1,c3,hex(c4),c5,c6 FROM t14 ORDER BY c1; +--echo + +--echo ************ +--echo * Bug30415 * +--echo ************ +# Uncomment below once fixed + +#--echo *** Select from Slave *** +#sync_slave_with_master; +#SELECT c1,c2,c3,hex(c4),c5 FROM t14 ORDER BY c1; + +# Bug30415 +# Remove below once fixed +#*************************** +connection slave; +wait_for_slave_to_stop; +--replace_result $MASTER_MYPORT MASTER_PORT +--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # +--query_vertical SHOW SLAVE STATUS +#*************************** + +STOP SLAVE; +RESET SLAVE; + +--echo +--echo *** Drop t14 *** +DROP TABLE t14; + +connection master; +DROP TABLE t14; +RESET MASTER; + +connection slave; +START SLAVE; + +################################################# +--echo +--echo ************************************************* +--echo * - Alter Master adding columns at end of table * +--echo * Expect: Error 1054 * +--echo ************************************************* +--echo +--echo *** Create t15 on slave *** +STOP SLAVE; +RESET SLAVE; +eval CREATE TABLE t15 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) + ) ENGINE=$engine_type; + +--echo +--echo *** Create t15 on Master *** +connection master; +eval CREATE TABLE t15 (c1 INT KEY, c4 BLOB, c5 CHAR(5), + c6 INT DEFAULT '1', + c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP + )ENGINE=$engine_type; + +RESET MASTER; + +--echo +--echo *** Start Slave *** +connection slave; +START SLAVE; + +--echo +--echo *** Master Data Insert *** +connection master; +ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7; +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); +INSERT INTO t15 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT,3.00), + (2,@b1,'JOE',DEFAULT,DEFAULT,3.00), + (3,@b1,'QA',DEFAULT,DEFAULT,3.00); +--replace_column 5 CURRENT_TIMESTAMP +SELECT c1,hex(c4),c5,c6,c7,c2 FROM t15 ORDER BY c1; + +--echo +--echo ******************************************** +--echo *** Expect slave to fail with Error 1054 *** +--echo ******************************************** +--echo +connection slave; +wait_for_slave_to_stop; +--replace_result $MASTER_MYPORT MASTER_PORT +--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # +--query_vertical SHOW SLAVE STATUS +STOP SLAVE; +RESET SLAVE; + +--echo +--echo *** Drop t15 *** +DROP TABLE t15; + +connection master; +DROP TABLE t15; +RESET MASTER; + +connection slave; +START SLAVE; + +#################################################### +--echo +--echo ************************************************ +--echo * - Create index on Master column not on slave * +--echo * Expect:Warning * +--echo ************************************************ +--echo +--echo *** Create t16 on slave *** +STOP SLAVE; +RESET SLAVE; +eval CREATE TABLE t16 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) + ) ENGINE=$engine_type; + +--echo +--echo *** Create t16 on Master *** +connection master; +eval CREATE TABLE t16 (c1 INT KEY, c4 BLOB, c5 CHAR(5), + c6 INT DEFAULT '1', + c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP + )ENGINE=$engine_type; + +RESET MASTER; + +--echo +--echo *** Start Slave *** +connection slave; +START SLAVE; + +--echo +--echo *** Master Create Index and Data Insert *** +connection master; +CREATE INDEX part_of_c6 ON t16 (c6); +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); +INSERT INTO t16 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), + (2,@b1,'JOE',2,DEFAULT), + (3,@b1,'QA',3,DEFAULT); +--replace_column 5 CURRENT_TIMESTAMP +SELECT c1,hex(c4),c5,c6,c7 FROM t16 ORDER BY c1; + +# Uncomment the below when bug 30434 is patched + +#--echo *** Select on Slave **** +#sync_slave_with_master; +#SELECT c1,hex(c4),c5 FROM t16 ORDER BY c1; +# +#--echo *** Drop t16 *** +#connection master; +#DROP TABLE t16; +#sync_slave_with_master; + +# Remove the below when bug 30434 is patched +#******************************************* +--echo +--echo ***************** +--echo *** BUG 30434 *** +--echo ***************** +--echo +connection slave; +wait_for_slave_to_stop; +--replace_result $MASTER_MYPORT MASTER_PORT +--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # +--query_vertical SHOW SLAVE STATUS +STOP SLAVE; +RESET SLAVE; + +--echo +--echo *** Drop t16 *** +DROP TABLE t16; + +connection master; +DROP TABLE t16; +RESET MASTER; + +connection slave; +START SLAVE; +#******************************************* + +#################################################### +--echo +--echo ***************************************************** +--echo * - Delete rows using column on Master not on slave * +--echo * Expect: Rows Deleted * +--echo ***************************************************** +--echo +--echo *** Create t17 on slave *** +STOP SLAVE; +RESET SLAVE; +eval CREATE TABLE t17 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) + ) ENGINE=$engine_type; + +--echo +--echo *** Create t17 on Master *** +connection master; +eval CREATE TABLE t17 (c1 INT KEY, c4 BLOB, c5 CHAR(5), + c6 INT DEFAULT '1', + c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP + )ENGINE=$engine_type; + +RESET MASTER; + +--echo +--echo *** Start Slave *** +connection slave; +START SLAVE; + +--echo +--echo *** Master Data Insert *** +connection master; +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); +INSERT INTO t17 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), + (2,@b1,'JOE',2,DEFAULT), + (3,@b1,'QA',3,DEFAULT); +--replace_column 5 CURRENT_TIMESTAMP +SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1; + +--echo +--echo ** Select * from Slave ** +sync_slave_with_master; +SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1; + +--echo +--echo ** Delete from master ** +connection master; +DELETE FROM t17 WHERE c6 = 3; +--replace_column 5 CURRENT_TIMESTAMP +SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1; + +--echo +--echo ** Check slave ** +sync_slave_with_master; +SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1; + + +connection master; +DROP TABLE t17; +sync_slave_with_master; +--echo + +#################################################### +--echo +--echo ***************************************************** +--echo * - Update row using column on Master not on slave * +--echo * Expect: Rows updated * +--echo ***************************************************** +--echo +--echo ** Bug30674 ** +--echo +--echo *** Create t18 on slave *** +--echo + +STOP SLAVE; +RESET SLAVE; +eval CREATE TABLE t18 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) + ) ENGINE=$engine_type; + +--echo +--echo *** Create t18 on Master *** +connection master; +eval CREATE TABLE t18 (c1 INT KEY, c4 BLOB, c5 CHAR(5), + c6 INT DEFAULT '1', + c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP + )ENGINE=$engine_type; + +RESET MASTER; + +--echo +--echo *** Start Slave *** +connection slave; +START SLAVE; + +--echo +--echo *** Master Data Insert *** +connection master; +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); + +INSERT INTO t18 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), + (2,@b1,'JOE',2,DEFAULT), + (3,@b1,'QA',3,DEFAULT); +--replace_column 5 CURRENT_TIMESTAMP +SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1; + +--echo +--echo ** Select * from Slave ** +sync_slave_with_master; +SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1; + +--echo +--echo ** update from master ** +connection master; +####################################### +# This test should be uncommented +# once bug30674 is patched +####################################### + +#*************************** +#UPDATE t18 SET c5 = 'TEST' WHERE c6 = 3; +#*************************** + +--replace_column 5 CURRENT_TIMESTAMP +SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1; + +--echo +--echo ** Check slave ** +sync_slave_with_master; +SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1; + +connection master; +DROP TABLE t18; +sync_slave_with_master; +--echo + +#################################################### +--echo +--echo ***************************************************** +--echo * - Insert UUID column on Master not on slave * +--echo * Expect: Rows inserted * +--echo ***************************************************** +--echo +--echo *** Create t5 on slave *** +STOP SLAVE; +RESET SLAVE; +eval CREATE TABLE t5 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) + ) ENGINE=$engine_type; + +--echo +--echo *** Create t5 on Master *** +connection master; +eval CREATE TABLE t5 (c1 INT KEY, c4 BLOB, c5 CHAR(5), + c6 LONG, + c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP + )ENGINE=$engine_type; + +RESET MASTER; + +--echo +--echo *** Start Slave *** +connection slave; +START SLAVE; + +--echo +--echo *** Master Data Insert *** +connection master; +set @b1 = 'b1b1b1b1'; +INSERT INTO t5 () VALUES(1,@b1,'Kyle',UUID(),DEFAULT), + (2,@b1,'JOE',UUID(),DEFAULT), + (3,@b1,'QA',UUID(),DEFAULT); +--replace_column 4 UUID 5 TIME +SELECT c1,hex(c4),c5,c6,c7 FROM t5 ORDER BY c1; + +--echo +--echo ** Select * from Slave ** +sync_slave_with_master; +SELECT c1,hex(c4),c5 FROM t5 ORDER BY c1; + +connection master; +DROP TABLE t5; +sync_slave_with_master; +--echo + +# END of 5.1 tests case diff --git a/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result b/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result index 189066179255c33b7d56e0fdfd8a3893dda3535c..28985eb8cbab465b8fb3ac3e824ae37a3f89d32d 100644 GIT binary patch literal 98074 zcmeHwZFAbl()MTRS4{1GAa=1iNaD>&x$1FjcGu7GOAf|oH&u5Pg|QSY9F1eTUpXC*CnxVJ&sJ?&uxZwZ$ut(j$^GNQcqS%eF~5t& zIS)A5;=X^}?Hu(wqIdM}tb@@iUL}Dzz35d%5~}|r`d_^7o}M3dKZt*KKHy$m9RGUM zeHGUBs{X(BG1%wRf!P0-pEShJXO~Akankwu==!WDD&gx|tx^?!(v*+X_tJa4&Q-5c z^^+EtU>-qwKWU3z=l33d9Eh{ai(lTIUB1IfP!sP?d#{=i%1wem{P(E)?(_ondeyA& z?R74GIlbr{>Q0~$FOKdpyF`ztB^uz0<|=m@PgmVEsQ3JCI(htfCn(!}-yiUEayp|~ zICavfsvk}Lqosee^^XJnBdD2Q0axX8Jc}_&ZwK>%7>#v5pi9Q$@iVTfdd2rKe$FNj zvB0#Qp)UL43KxfS^yK4s&b1F~d{ZRT$%D=bDX%(bo#UQ3zP!HZz1rUsKX)(B(W`HL zeZ{ZWOsXWPCSf&+s!6?yS4*1Jq*YDY)#RY+-^G7mB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-;4EZO(V5CqRaE4wC{wLtq3i;R~Lkq z=j+)r;tFCdfRMQ237qL1aRukw6jzvVvCMKJ9o!i2YE9^5nZ+{bxTeQs<3GNx5($4UdVz11MH779Px5iYs62(jFPMyKPlR0ITS=?S>Rwdqg1Y9cAW%a`1wz<0{~vncCPe@M delta 3124 zcmbRBkM+_jrU`2&A7XNvEWj)-q{-##=kDp}YOC&v%C;zclnrydOYx0||JbW%e{s9Uhj!r(VK=Z68A7pX{I=~pa0~9PsbAXP5dS!NT zraJi!amVfuO>6QT0t^=N-4cM^Ek;3Py9F3NIr*h|>8T3&X$l#M1qGRTsl~+<1XnC} zCt4>{+lfGzm!%d}Dx@WrC?w_NCsE+$EbMM}t*5!0brh1+4GfVX&>LLE8TsW3#W{(a z#VxOpns?3$V#~LI^`zulSf&BzXsqc2Bk-|!L`T7(!qCXr#MBJvB|cR9Cl}0=7E&+H%*hKmWWs=Kw3x+jxQ>E`v5o=+sh4DA7Nr19FoqbNpOXvXK#i^^ z)o5$3(t?!4l2lMRSDad+kY-}5pq`gnQKGI;o{?IVs*q-AYiP}tlA4nWRFqbfp9@ln zEL9AYN-j~*0!vQz-YheDPKyA0nxO$_nxWz3y)90P3}7G{$|+1?3$ zIgKYT;LzbgR)x1nwPgkC-h8fqH{)g|Ap^$EyC*d;Znl|X$Fx~d+=OZKpBb!Dz@pc7 zGWRyo&7Nk8jFWk`Kb_38BXIKvi{Cg>n^1%7XuW_|L51`5 Oh0%HeRJjeJdI10o&!Tz& diff --git a/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result b/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result index 5bc1a13b1078a054d99dfef348ad74e85295e302..966f97e05789010f7d19e3e0c2a11a35dbf9291f 100644 GIT binary patch literal 98074 zcmeHwZFAbl()MTRS4{1GAa=1iNaD>&x$1FjcGu7GOAf|oH&u5Pg|QSY9F1eTUpfDFdUbSOdA4fHf=#nNOs26IPVOHc#xpS)i}_tF z&UwJe7We(*Z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XK#i^^ z)o5$3(t?!4l2lMRSDad+kY-}5pq`gnQKGI;o{?IVs*q-AYiP}tlA4nWRFqbfp9@ln zEL9AYN-j~*0!vQz-YheDPKyA0nxO$_nxWz3y)90P3}7G{$|+1?3$ zIgKYT;LzbgR)x1nwPgkC-h8fqH{)g|Ap^$EyC*d;Znl|X$Fx~d+=OZKpBb!Dz@pc7 zGWRyo&7Nk8jFWk`Kb_38BXIKvi{Cg>n^1%7XuW_|L51`5 Oh0%HeRJjeJdI118P@paV diff --git a/mysql-test/suite/rpl/r/rpl_row_extraColmaster_ndb.result b/mysql-test/suite/rpl/r/rpl_row_extraColmaster_ndb.result deleted file mode 100644 index 0b1f2e6c8bf9514ef53ef326dde109d3a78bdea8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 19129 zcmeHP-EZ4Q62DjSvB14AdJnV%)+LwJmjyk@w$cifWuGLc7odPZTT7d;Od2GW#P`>C zX1_$zk|V3lCCHI-B<}9)?APp%vojNBdGbiIW$=M@%|#0Ld2qdCBnk=p6lHlva@WqO zoqKlf+j+yzn|9u^^R}ILx@O8UmXn7d%UP;Y`|`^2Ak9@zPA7x@Y(QrHlhFWrKn_Be z497E@gjD`|_)9J)!}I>+J^5|$9?E=j`fGo3K%GO|3>)O_=%PO(XM?x>tI>>D^vH3n zLvt|xWjG%6tnt~2)ir}9bX|@a+Tk-0HoE3;JRMACB#QF{+y4+OS1cn3u1&h9(~+xAV8rk{M$1f4Yuh7#>`%Ibp$KF55z~%OnFn z6SfSV=DJ!jqexJww}rhP)?^jOQG9E>XPF%9^xva-F?Yfqm(dLjetwqB&rS^JgvuD+ z#z_kKrA(ljq4aGae3t)vv|J$D%>|OZEF8ha&j)E5Cx&CHM3Nfj^geo=pC+pqgaC>L zpV-YyGdFzn9R=T{CozkQ$+9 zgudw-_~CoWJeyox>K)%TzZeAA#0;APDg47VJj@2u*^cmFOPpxF4kv74J>6%KRpUjC z7d2jd7kB}BMvE&VTFcl~#n2d{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gSe?bT$%OqGBBw zha5mjNh*@SoJbO>Hx&zo5UfcG3RRg*@sK)Jxe&QP@71(O?P~)KJ#KW48||Y`rz43= z3Rcalnd}7cor4P5~1L!xK$NRP0F``9Hv%1bt$$7*Lt6*ZBY0X zm7nRVXgS~;18yXV(p0PLxv`cH=a~kpNktbVqk>Y4YB4rt7u(vT(W*_#w+(rS;#Ee( z>H+kYR9(SJj9knj$)gAOk0yMTEK`(#{d)sY?_wip6cG7Uk6Y>&YQBu+pl?}WvP$zi zIr%l1i)F)aExbaU;Bc+anp)mC^-B<2IFjyOsRr{J%oPxE36o%6V>#NEzZ#Yku)N6s zMF_`iICh3LZk9of3u}#=d>X`8tpuyd_=-w!jho*JZi2zk%A!v@;3hipgyK~j3N)gM z8>y?;h5`jG@LL-S3QyvF36PBnfbVN) z8vOao^HpRZPxywg1nHnf<-BP08s$qxFM2(AiGm7oRMfOb*X7_>t(Lnz9-bqk9Knb8 zoW$cK==o@=J9K-X0WM}Ag*!rrPz^&F}UKI@%V~L&}AhE n6S`dr%7hk5X}^;8U=WoB#;l@f)zOZ1v?G7>O#PA>c*)G4sd{H} diff --git a/mysql-test/suite/rpl/t/rpl_extraColmaster_innodb.test b/mysql-test/suite/rpl/t/rpl_extraColmaster_innodb.test index 082c22329fa..5255a9cfbad 100644 --- a/mysql-test/suite/rpl/t/rpl_extraColmaster_innodb.test +++ b/mysql-test/suite/rpl/t/rpl_extraColmaster_innodb.test @@ -12,4 +12,5 @@ set binlog_format=row; set binlog_format=statement; -- source extra/rpl_tests/rpl_extraMaster_Col.test - +set binlog_format=mixed; +-- source extra/rpl_tests/rpl_extraMaster_Col.test diff --git a/mysql-test/suite/rpl/t/rpl_extraColmaster_myisam.test b/mysql-test/suite/rpl/t/rpl_extraColmaster_myisam.test index 5bbd7953294..e6b41eabd0d 100644 --- a/mysql-test/suite/rpl/t/rpl_extraColmaster_myisam.test +++ b/mysql-test/suite/rpl/t/rpl_extraColmaster_myisam.test @@ -11,3 +11,5 @@ set binlog_format=row; set binlog_format=statement; -- source extra/rpl_tests/rpl_extraMaster_Col.test +set binlog_format=mixed; +-- source extra/rpl_tests/rpl_extraMaster_Col.test diff --git a/mysql-test/suite/rpl/t/rpl_row_extraColmaster_ndb.test b/mysql-test/suite/rpl/t/rpl_row_extraColmaster_ndb.test deleted file mode 100644 index b91947e52e2..00000000000 --- a/mysql-test/suite/rpl/t/rpl_row_extraColmaster_ndb.test +++ /dev/null @@ -1,12 +0,0 @@ -########################################### -# Purpose: Wrapper for rpl_extraMaster_Col.test -# Using NDB -########################################### --- source include/have_ndb.inc --- source include/ndb_master-slave.inc --- source include/have_binlog_format_row.inc - -let $engine_type = 'NDB'; - --- source extra/rpl_tests/rpl_extraMaster_Col.test - diff --git a/mysql-test/suite/rpl/t/rpl_stm_extraColmaster_ndb.test b/mysql-test/suite/rpl/t/rpl_stm_extraColmaster_ndb.test deleted file mode 100644 index 84734204439..00000000000 --- a/mysql-test/suite/rpl/t/rpl_stm_extraColmaster_ndb.test +++ /dev/null @@ -1,13 +0,0 @@ -########################################### -# Purpose: Wrapper for rpl_extraMaster_Col.test -# Using NDB -########################################### --- source include/have_ndb.inc --- source include/ndb_master-slave.inc --- source include/have_binlog_format_statement.inc - -let $engine_type = 'NDB'; - --- source extra/rpl_tests/rpl_extraMaster_Col.test - - From 2510ac8c4f0cfdfc939ea9bcb8c9a55f5c5c708a Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 10 Oct 2007 17:22:21 +0200 Subject: [PATCH 34/49] rpl_ndb_extraColMaster.test, rpl_ndb_extraColMaster.result: Back porting NDB test case mysql-test/suite/rpl_ndb/t/rpl_ndb_extraColMaster.test: Back porting NDB test case mysql-test/suite/rpl_ndb/r/rpl_ndb_extraColMaster.result: Back porting NDB test case --- .../rpl_ndb/r/rpl_ndb_extraColMaster.result | 2286 +++++++++++++++++ .../rpl_ndb/t/rpl_ndb_extraColMaster.test | 14 + 2 files changed, 2300 insertions(+) create mode 100644 mysql-test/suite/rpl_ndb/r/rpl_ndb_extraColMaster.result create mode 100644 mysql-test/suite/rpl_ndb/t/rpl_ndb_extraColMaster.test diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraColMaster.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraColMaster.result new file mode 100644 index 00000000000..38c8ab2afc5 --- /dev/null +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraColMaster.result @@ -0,0 +1,2286 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +set binlog_format=row; + +*********************************************************** +*********************************************************** +***************** Start of Testing ************************ +*********************************************************** +*********************************************************** +* This test format == binlog_format ROW and engine == 'NDB' +*********************************************************** +*********************************************************** + +***** Testing more columns on the Master ***** + +CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), +/* extra */ +f5 FLOAT DEFAULT '2.00', +f6 CHAR(4) DEFAULT 'TEST', +f7 INT DEFAULT '0', +f8 TEXT, +f9 LONGBLOB, +f10 BIT(63), +f11 VARBINARY(64))ENGINE='NDB'; + +* Alter Table on Slave and drop columns f5 through f11 * + +alter table t1 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11; + +* Insert data in Master then update and delete some rows* + +* Select count and 20 rows from Master * + +SELECT COUNT(*) FROM t1; +COUNT(*) +40 + +SELECT f1,f2,f3,f4,f5,f6,f7,f8,f9, +hex(f10),hex(f11) FROM t1 ORDER BY f3 LIMIT 20; +f1 f2 f3 f4 f5 f6 f7 f8 f9 hex(f10) hex(f11) +2 2 2 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +3 3 3 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +5 5 5 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +6 6 6 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +8 8 8 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +9 9 9 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +11 11 11 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +12 12 12 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +14 14 14 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +15 15 15 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +17 17 17 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +18 18 18 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +20 20 20 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +21 21 21 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +23 23 23 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +24 24 24 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +26 26 26 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +27 27 27 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +29 29 29 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +30 30 30 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 + +* Select count and 20 rows from Slave * + +SELECT COUNT(*) FROM t1; +COUNT(*) +40 + +SELECT * FROM t1 ORDER BY f3 LIMIT 20; +f1 f2 f3 f4 +2 2 2 second +3 3 3 next +5 5 5 second +6 6 6 next +8 8 8 second +9 9 9 next +11 11 11 second +12 12 12 next +14 14 14 second +15 15 15 next +17 17 17 second +18 18 18 next +20 20 20 second +21 21 21 next +23 23 23 second +24 24 24 next +26 26 26 second +27 27 27 next +29 29 29 second +30 30 30 next + +* Show Slave Status * + +show slave status;; +Slave_IO_State # +Master_Host 127.0.0.1 +Master_User root +Master_Port # +Connect_Retry 1 +Master_Log_File master-bin.000001 +Read_Master_Log_Pos # +Relay_Log_File # +Relay_Log_Pos # +Relay_Master_Log_File master-bin.000001 +Slave_IO_Running Yes +Slave_SQL_Running Yes +Replicate_Do_DB +Replicate_Ignore_DB +Replicate_Do_Table +Replicate_Ignore_Table +Replicate_Wild_Do_Table +Replicate_Wild_Ignore_Table +Last_Errno 0 +Last_Error +Skip_Counter 0 +Exec_Master_Log_Pos # +Relay_Log_Space # +Until_Condition None +Until_Log_File +Until_Log_Pos 0 +Master_SSL_Allowed No +Master_SSL_CA_File +Master_SSL_CA_Path +Master_SSL_Cert +Master_SSL_Cipher +Master_SSL_Key +Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No +Last_IO_Errno # +Last_IO_Error # +Last_SQL_Errno 0 +Last_SQL_Error + + +***** Testing Altering table def scenario ***** + +CREATE TABLE t2 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), +/* extra */ +f5 DOUBLE DEFAULT '2.00', +f6 ENUM('a', 'b', 'c') default 'a', +f7 DECIMAL(17,9) default '1000.00', +f8 MEDIUMBLOB, +f9 NUMERIC(6,4) default '2000.00', +f10 VARCHAR(1024), +f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', +f12 SET('a', 'b', 'c') default 'b') +ENGINE='NDB'; +Warnings: +Warning 1264 Out of range value for column 'f9' at row 1 + +CREATE TABLE t3 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), +/* extra */ +f5 DOUBLE DEFAULT '2.00', +f6 ENUM('a', 'b', 'c') default 'a', +f8 MEDIUMBLOB, +f10 VARCHAR(1024), +f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', +f12 SET('a', 'b', 'c') default 'b') +ENGINE='NDB'; + +CREATE TABLE t4 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), +/* extra */ +f5 DOUBLE DEFAULT '2.00', +f6 DECIMAL(17,9) default '1000.00', +f7 MEDIUMBLOB, +f8 NUMERIC(6,4) default '2000.00', +f9 VARCHAR(1024), +f10 BINARY(20) not null default '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', +f11 CHAR(255)) +ENGINE='NDB'; +Warnings: +Warning 1264 Out of range value for column 'f8' at row 1 + +CREATE TABLE t31 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), +/* extra */ +f5 BIGINT, +f6 BLOB, +f7 DATE, +f8 DATETIME, +f9 FLOAT, +f10 INT, +f11 LONGBLOB, +f12 LONGTEXT, +f13 MEDIUMBLOB, +f14 MEDIUMINT, +f15 MEDIUMTEXT, +f16 REAL, +f17 SMALLINT, +f18 TEXT, +f19 TIME, +f20 TIMESTAMP, +f21 TINYBLOB, +f22 TINYINT, +f23 TINYTEXT, +f24 YEAR, +f25 BINARY(255), +f26 BIT(64), +f27 CHAR(255), +f28 DECIMAL(30,7), +f29 DOUBLE, +f30 ENUM ('a','b', 'c') default 'a', +f31 FLOAT, +f32 NUMERIC(17,9), +f33 SET ('a', 'b', 'c') default 'b', +f34 VARBINARY(1025), +f35 VARCHAR(257) +) ENGINE='NDB'; + +** Alter tables on slave and drop columns ** + +alter table t2 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11, drop +f12; +alter table t3 drop f5, drop f6, drop f8, drop f10, drop f11, drop f12; +alter table t4 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11; +alter table t31 +drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11, +drop f12, drop f13, drop f14, drop f15, drop f16, drop f17, drop f18, +drop f19, drop f20, drop f21, drop f22, drop f23, drop f24, drop f25, +drop f26, drop f27, drop f28, drop f29, drop f30, drop f31, drop f32, +drop f33, drop f34, drop f35; + +** Insert Data into Master ** +INSERT into t2 set f1=1, f2=1, f3=1, f4='first', f8='f8: medium size blob', f10='f10: +some var char'; +INSERT into t2 values (2, 2, 2, 'second', +2.0, 'b', 2000.0002, 'f8: medium size blob', 2000, 'f10: some var char', +'01234567', 'c'), +(3, 3, 3, 'third', +3.0, 'b', 3000.0003, 'f8: medium size blob', 3000, 'f10: some var char', +'01234567', 'c'); +Warnings: +Warning 1264 Out of range value for column 'f9' at row 1 +Warning 1264 Out of range value for column 'f9' at row 2 +INSERT into t3 set f1=1, f2=1, f3=1, f4='first', f10='f10: some var char'; +INSERT into t4 set f1=1, f2=1, f3=1, f4='first', f7='f7: medium size blob', f10='f10: +binary data'; +INSERT into t31 set f1=1, f2=1, f3=1, f4='first'; +INSERT into t31 set f1=1, f2=1, f3=2, f4='second', +f9=2.2, f10='seven samurai', f28=222.222, f35='222'; +Warnings: +Warning 1366 Incorrect integer value: 'seven samurai' for column 'f10' at row 1 +INSERT into t31 values (1, 1, 3, 'third', +/* f5 BIGINT, */ 333333333333333333333333, +/* f6 BLOB, */ '3333333333333333333333', +/* f7 DATE, */ '2007-07-18', +/* f8 DATETIME, */ "2007-07-18", +/* f9 FLOAT, */ 3.33333333, +/* f10 INT, */ 333333333, +/* f11 LONGBLOB, */ '3333333333333333333', +/* f12 LONGTEXT, */ '3333333333333333333', +/* f13 MEDIUMBLOB, */ '3333333333333333333', +/* f14 MEDIUMINT, */ 33, +/* f15 MEDIUMTEXT, */ 3.3, +/* f16 REAL, */ 3.3, +/* f17 SMALLINT, */ 3, +/* f18 TEXT, */ '33', +/* f19 TIME, */ '2:59:58.999', +/* f20 TIMESTAMP, */ 20000303000000, +/* f21 TINYBLOB, */ '3333', +/* f22 TINYINT, */ 3, +/* f23 TINYTEXT, */ '3', +/* f24 YEAR, */ 3000, +/* f25 BINARY(255), */ 'three_33333', +/* f26 BIT(64), */ b'011', +/* f27 CHAR(255), */ 'three', +/* f28 DECIMAL(30,7), */ 3.333, +/* f29 DOUBLE, */ 3.333333333333333333333333333, +/* f30 ENUM ('a','b','c')*/ 'c', +/* f31 FLOAT, */ 3.0, +/* f32 NUMERIC(17,9), */ 3.3333, +/* f33 SET ('a','b','c'),*/ 'c', +/*f34 VARBINARY(1025),*/ '3333 minus 3', +/*f35 VARCHAR(257),*/ 'three times three' + ); +Warnings: +Warning 1264 Out of range value for column 'f5' at row 1 +Warning 1264 Out of range value for column 'f24' at row 1 +INSERT into t31 values (1, 1, 4, 'fourth', +/* f5 BIGINT, */ 333333333333333333333333, +/* f6 BLOB, */ '3333333333333333333333', +/* f7 DATE, */ '2007-07-18', +/* f8 DATETIME, */ "2007-07-18", +/* f9 FLOAT, */ 3.33333333, +/* f10 INT, */ 333333333, +/* f11 LONGBLOB, */ '3333333333333333333', +/* f12 LONGTEXT, */ '3333333333333333333', +/* f13 MEDIUMBLOB, */ '3333333333333333333', +/* f14 MEDIUMINT, */ 33, +/* f15 MEDIUMTEXT, */ 3.3, +/* f16 REAL, */ 3.3, +/* f17 SMALLINT, */ 3, +/* f18 TEXT, */ '33', +/* f19 TIME, */ '2:59:58.999', +/* f20 TIMESTAMP, */ 20000303000000, +/* f21 TINYBLOB, */ '3333', +/* f22 TINYINT, */ 3, +/* f23 TINYTEXT, */ '3', +/* f24 YEAR, */ 3000, +/* f25 BINARY(255), */ 'three_33333', +/* f26 BIT(64), */ b'011', +/* f27 CHAR(255), */ 'three', +/* f28 DECIMAL(30,7), */ 3.333, +/* f29 DOUBLE, */ 3.333333333333333333333333333, +/* f30 ENUM ('a','b','c')*/ 'c', +/* f31 FLOAT, */ 3.0, +/* f32 NUMERIC(17,9), */ 3.3333, +/* f33 SET ('a','b','c'),*/ 'c', +/*f34 VARBINARY(1025),*/ '3333 minus 3', +/*f35 VARCHAR(257),*/ 'three times three' + ), +(1, 1, 5, 'fifth', +/* f5 BIGINT, */ 333333333333333333333333, +/* f6 BLOB, */ '3333333333333333333333', +/* f7 DATE, */ '2007-07-18', +/* f8 DATETIME, */ "2007-07-18", +/* f9 FLOAT, */ 3.33333333, +/* f10 INT, */ 333333333, +/* f11 LONGBLOB, */ '3333333333333333333', +/* f12 LONGTEXT, */ '3333333333333333333', +/* f13 MEDIUMBLOB, */ '3333333333333333333', +/* f14 MEDIUMINT, */ 33, +/* f15 MEDIUMTEXT, */ 3.3, +/* f16 REAL, */ 3.3, +/* f17 SMALLINT, */ 3, +/* f18 TEXT, */ '33', +/* f19 TIME, */ '2:59:58.999', +/* f20 TIMESTAMP, */ 20000303000000, +/* f21 TINYBLOB, */ '3333', +/* f22 TINYINT, */ 3, +/* f23 TINYTEXT, */ '3', +/* f24 YEAR, */ 3000, +/* f25 BINARY(255), */ 'three_33333', +/* f26 BIT(64), */ b'011', +/* f27 CHAR(255), */ 'three', +/* f28 DECIMAL(30,7), */ 3.333, +/* f29 DOUBLE, */ 3.333333333333333333333333333, +/* f30 ENUM ('a','b','c')*/ 'c', +/* f31 FLOAT, */ 3.0, +/* f32 NUMERIC(17,9), */ 3.3333, +/* f33 SET ('a','b','c'),*/ 'c', +/*f34 VARBINARY(1025),*/ '3333 minus 3', +/*f35 VARCHAR(257),*/ 'three times three' + ), +(1, 1, 6, 'sixth', +/* f5 BIGINT, */ NULL, +/* f6 BLOB, */ '3333333333333333333333', +/* f7 DATE, */ '2007-07-18', +/* f8 DATETIME, */ "2007-07-18", +/* f9 FLOAT, */ 3.33333333, +/* f10 INT, */ 333333333, +/* f11 LONGBLOB, */ '3333333333333333333', +/* f12 LONGTEXT, */ '3333333333333333333', +/* f13 MEDIUMBLOB, */ '3333333333333333333', +/* f14 MEDIUMINT, */ 33, +/* f15 MEDIUMTEXT, */ 3.3, +/* f16 REAL, */ 3.3, +/* f17 SMALLINT, */ 3, +/* f18 TEXT, */ '33', +/* f19 TIME, */ '2:59:58.999', +/* f20 TIMESTAMP, */ 20000303000000, +/* f21 TINYBLOB, */ '3333', +/* f22 TINYINT, */ 3, +/* f23 TINYTEXT, */ '3', +/* f24 YEAR, */ 3000, +/* f25 BINARY(255), */ 'three_33333', +/* f26 BIT(64), */ b'011', +/* f27 CHAR(255), */ 'three', +/* f28 DECIMAL(30,7), */ 3.333, +/* f29 DOUBLE, */ 3.333333333333333333333333333, +/* f30 ENUM ('a','b','c')*/ 'c', +/* f31 FLOAT, */ 3.0, +/* f32 NUMERIC(17,9), */ 3.3333, +/* f33 SET ('a','b','c'),*/ 'c', +/*f34 VARBINARY(1025),*/ '3333 minus 3', +/*f35 VARCHAR(257),*/ NULL +); +Warnings: +Warning 1264 Out of range value for column 'f5' at row 1 +Warning 1264 Out of range value for column 'f24' at row 1 +Warning 1264 Out of range value for column 'f5' at row 2 +Warning 1264 Out of range value for column 'f24' at row 2 +Warning 1264 Out of range value for column 'f24' at row 3 + +** Sync slave with master ** +** Do selects from tables ** + +select * from t1 order by f3; +f1 f2 f3 f4 +2 2 2 second +3 3 3 next +5 5 5 second +6 6 6 next +8 8 8 second +9 9 9 next +11 11 11 second +12 12 12 next +14 14 14 second +15 15 15 next +17 17 17 second +18 18 18 next +20 20 20 second +21 21 21 next +23 23 23 second +24 24 24 next +26 26 26 second +27 27 27 next +29 29 29 second +30 30 30 next +31 31 31 second +32 32 32 second +33 33 33 second +34 34 34 second +35 35 35 second +36 36 36 second +37 37 37 second +38 38 38 second +39 39 39 second +40 40 40 second +41 41 41 second +42 42 42 second +43 43 43 second +44 44 44 second +45 45 45 second +46 46 46 second +47 47 47 second +48 48 48 second +49 49 49 second +50 50 50 second +select * from t2 order by f1; +f1 f2 f3 f4 +1 1 1 first +2 2 2 second +3 3 3 third +select * from t3 order by f1; +f1 f2 f3 f4 +1 1 1 first +select * from t4 order by f1; +f1 f2 f3 f4 +1 1 1 first +select * from t31 order by f1; +f1 f2 f3 f4 +1 1 5 fifth +1 1 3 third +1 1 1 first +1 1 6 sixth +1 1 2 second +1 1 4 fourth + +** Do updates master ** + +update t31 set f5=555555555555555 where f3=6; +update t31 set f2=2 where f3=2; +update t31 set f1=NULL where f3=1; +update t31 set f3=NULL, f27=NULL, f35='f35 new value' where f3=3; +Warnings: +Warning 1048 Column 'f3' cannot be null + +** Delete from Master ** + +delete from t1; +delete from t2; +delete from t3; +delete from t4; +delete from t31; + +** Check slave status ** + +select * from t31; +f1 f2 f3 f4 +show slave status;; +Slave_IO_State # +Master_Host 127.0.0.1 +Master_User root +Master_Port # +Connect_Retry 1 +Master_Log_File master-bin.000001 +Read_Master_Log_Pos # +Relay_Log_File # +Relay_Log_Pos # +Relay_Master_Log_File master-bin.000001 +Slave_IO_Running Yes +Slave_SQL_Running Yes +Replicate_Do_DB +Replicate_Ignore_DB +Replicate_Do_Table +Replicate_Ignore_Table +Replicate_Wild_Do_Table +Replicate_Wild_Ignore_Table +Last_Errno 0 +Last_Error +Skip_Counter 0 +Exec_Master_Log_Pos # +Relay_Log_Space # +Until_Condition None +Until_Log_File +Until_Log_Pos 0 +Master_SSL_Allowed No +Master_SSL_CA_File +Master_SSL_CA_Path +Master_SSL_Cert +Master_SSL_Cipher +Master_SSL_Key +Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No +Last_IO_Errno # +Last_IO_Error # +Last_SQL_Errno 0 +Last_SQL_Error + +**************************************** +* columns in master at middle of table * +* Expect: Proper error message * +**************************************** + +** Stop and Reset Slave ** + +STOP SLAVE; +RESET SLAVE; + +** create table slave side ** +CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5) +) ENGINE='NDB'; + +** Connect to master and create table ** + +CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233', +c CHAR(5), e INT DEFAULT '1')ENGINE='NDB'; +RESET MASTER; + +*** Start Slave *** +START SLAVE; + +*** Master Data Insert *** +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); +INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT), +(2,@b1,DEFAULT,'JOE',DEFAULT), +(3,@b1,DEFAULT,'QA',DEFAULT); + +******************************************** +*** Expect slave to fail with Error 1523 *** +******************************************** + +SHOW SLAVE STATUS; +Slave_IO_State # +Master_Host 127.0.0.1 +Master_User root +Master_Port # +Connect_Retry 1 +Master_Log_File master-bin.000001 +Read_Master_Log_Pos # +Relay_Log_File # +Relay_Log_Pos # +Relay_Master_Log_File master-bin.000001 +Slave_IO_Running Yes +Slave_SQL_Running No +Replicate_Do_DB +Replicate_Ignore_DB +Replicate_Do_Table +Replicate_Ignore_Table +Replicate_Wild_Do_Table +Replicate_Wild_Ignore_Table +Last_Errno 1532 +Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 +Skip_Counter 0 +Exec_Master_Log_Pos # +Relay_Log_Space # +Until_Condition None +Until_Log_File +Until_Log_Pos 0 +Master_SSL_Allowed No +Master_SSL_CA_File +Master_SSL_CA_Path +Master_SSL_Cert +Master_SSL_Cipher +Master_SSL_Key +Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No +Last_IO_Errno # +Last_IO_Error # +Last_SQL_Errno 1532 +Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; +START SLAVE; + +*** Drop t10 *** +DROP TABLE t10; + +********************************************* +* More columns in master at middle of table * +* Expect: Proper error message * +********************************************* + +*** Create t11 on slave *** +STOP SLAVE; +RESET SLAVE; +CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254) +) ENGINE='NDB'; + +*** Create t11 on Master *** +CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT, +c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='NDB'; +RESET MASTER; + +*** Start Slave *** +START SLAVE; + +*** Master Data Insert *** +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); +INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT), +(2,@b1,'Testing is cool','JOE',DEFAULT), +(3,@b1,DEFAULT,'QA',DEFAULT); + +******************************************** +*** Expect slave to fail with Error 1523 *** +******************************************** + +SHOW SLAVE STATUS; +Slave_IO_State # +Master_Host 127.0.0.1 +Master_User root +Master_Port # +Connect_Retry 1 +Master_Log_File master-bin.000001 +Read_Master_Log_Pos # +Relay_Log_File # +Relay_Log_Pos # +Relay_Master_Log_File master-bin.000001 +Slave_IO_Running Yes +Slave_SQL_Running No +Replicate_Do_DB +Replicate_Ignore_DB +Replicate_Do_Table +Replicate_Ignore_Table +Replicate_Wild_Do_Table +Replicate_Wild_Ignore_Table +Last_Errno 1532 +Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 +Skip_Counter 0 +Exec_Master_Log_Pos # +Relay_Log_Space # +Until_Condition None +Until_Log_File +Until_Log_Pos 0 +Master_SSL_Allowed No +Master_SSL_CA_File +Master_SSL_CA_Path +Master_SSL_Cert +Master_SSL_Cipher +Master_SSL_Key +Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No +Last_IO_Errno # +Last_IO_Error # +Last_SQL_Errno 1532 +Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; +START SLAVE; + +*** Drop t11 *** +DROP TABLE t11; + +********************************************* +* More columns in master at middle of table * +* Expect: This one should pass blob-text * +********************************************* + +*** Create t12 on slave *** +STOP SLAVE; +RESET SLAVE; +CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB +) ENGINE='NDB'; + +*** Create t12 on Master *** +CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT, +c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='NDB'; +RESET MASTER; + +*** Start Slave *** +START SLAVE; + +*** Master Data Insert *** +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); +INSERT INTO t12 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), +(2,@b1,'JOE',DEFAULT,DEFAULT), +(3,@b1,'QA',DEFAULT,DEFAULT); + +SELECT a,hex(b),f,c,e FROM t12 ORDER BY a; +a hex(b) f c e +1 62316231623162316231623162316231 Kyle test 1 +2 62316231623162316231623162316231 JOE test 1 +3 62316231623162316231623162316231 QA test 1 + +*** Select on Slave *** +SELECT a,hex(b),c FROM t12 ORDER BY a; +a hex(b) c +1 62316231623162316231623162316231 Kyle +2 62316231623162316231623162316231 JOE +3 62316231623162316231623162316231 QA + +*** Drop t12 *** +DROP TABLE t12; + +**************************************************** +* - Alter Master adding columns at middle of table * +* Expect: columns added * +**************************************************** + + +*** Create t14 on slave *** +STOP SLAVE; +RESET SLAVE; +CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) +) ENGINE='NDB'; + +*** Create t14 on Master *** +CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5), +c6 INT DEFAULT '1', +c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP +)ENGINE='NDB'; +RESET MASTER; + +*** Start Slave *** +START SLAVE; + +*** Master Data Insert *** +ALTER TABLE t14 ADD COLUMN c2 DECIMAL(8,2) AFTER c1; +ALTER TABLE t14 ADD COLUMN c3 TEXT AFTER c2; + +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); +INSERT INTO t14 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle',DEFAULT,DEFAULT), +(2,2.00,'This Test Should work',@b1,'JOE',DEFAULT,DEFAULT), +(3,3.00,'If is does not, I will open a bug',@b1,'QA',DEFAULT,DEFAULT); + +SELECT c1,c2,c3,hex(c4),c5,c6,c7 FROM t14 ORDER BY c1; +c1 c2 c3 hex(c4) c5 c6 c7 +1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP +2 2.00 This Test Should work 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP +3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP + +*** Select on Slave **** +SELECT c1,c2,c3,hex(c4),c5 FROM t14 ORDER BY c1; +c1 c2 c3 hex(c4) c5 +1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle +2 2.00 This Test Should work 62316231623162316231623162316231 JOE +3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA + +**************************************************** +* - Alter Master Dropping columns from the middle. * +* Expect: columns dropped * +**************************************************** + +*** connect to master and drop columns *** +ALTER TABLE t14 DROP COLUMN c2; +ALTER TABLE t14 DROP COLUMN c7; + +*** Select from Master *** +SELECT c1,c3,hex(c4),c5,c6 FROM t14 ORDER BY c1; +c1 c3 hex(c4) c5 c6 +1 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1 +2 This Test Should work 62316231623162316231623162316231 JOE 1 +3 If is does not, I will open a bug 62316231623162316231623162316231 QA 1 + +************ +* Bug30415 * +************ +SHOW SLAVE STATUS; +Slave_IO_State # +Master_Host 127.0.0.1 +Master_User root +Master_Port # +Connect_Retry 1 +Master_Log_File master-bin.000001 +Read_Master_Log_Pos # +Relay_Log_File # +Relay_Log_Pos # +Relay_Master_Log_File master-bin.000001 +Slave_IO_Running Yes +Slave_SQL_Running No +Replicate_Do_DB +Replicate_Ignore_DB +Replicate_Do_Table +Replicate_Ignore_Table +Replicate_Wild_Do_Table +Replicate_Wild_Ignore_Table +Last_Errno 1091 +Last_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7' +Skip_Counter 0 +Exec_Master_Log_Pos # +Relay_Log_Space # +Until_Condition None +Until_Log_File +Until_Log_Pos 0 +Master_SSL_Allowed No +Master_SSL_CA_File +Master_SSL_CA_Path +Master_SSL_Cert +Master_SSL_Cipher +Master_SSL_Key +Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No +Last_IO_Errno # +Last_IO_Error # +Last_SQL_Errno 1091 +Last_SQL_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7' +STOP SLAVE; +RESET SLAVE; + +*** Drop t14 *** +DROP TABLE t14; +DROP TABLE t14; +RESET MASTER; +START SLAVE; + +************************************************* +* - Alter Master adding columns at end of table * +* Expect: Error 1054 * +************************************************* + +*** Create t15 on slave *** +STOP SLAVE; +RESET SLAVE; +CREATE TABLE t15 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) +) ENGINE='NDB'; + +*** Create t15 on Master *** +CREATE TABLE t15 (c1 INT KEY, c4 BLOB, c5 CHAR(5), +c6 INT DEFAULT '1', +c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP +)ENGINE='NDB'; +RESET MASTER; + +*** Start Slave *** +START SLAVE; + +*** Master Data Insert *** +ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7; +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); +INSERT INTO t15 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT,3.00), +(2,@b1,'JOE',DEFAULT,DEFAULT,3.00), +(3,@b1,'QA',DEFAULT,DEFAULT,3.00); +SELECT c1,hex(c4),c5,c6,c7,c2 FROM t15 ORDER BY c1; +c1 hex(c4) c5 c6 c7 c2 +1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP 3.00 +2 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP 3.00 +3 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP 3.00 + +******************************************** +*** Expect slave to fail with Error 1054 *** +******************************************** + +SHOW SLAVE STATUS; +Slave_IO_State # +Master_Host 127.0.0.1 +Master_User root +Master_Port # +Connect_Retry 1 +Master_Log_File master-bin.000001 +Read_Master_Log_Pos # +Relay_Log_File # +Relay_Log_Pos # +Relay_Master_Log_File master-bin.000001 +Slave_IO_Running Yes +Slave_SQL_Running No +Replicate_Do_DB +Replicate_Ignore_DB +Replicate_Do_Table +Replicate_Ignore_Table +Replicate_Wild_Do_Table +Replicate_Wild_Ignore_Table +Last_Errno 1054 +Last_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7' +Skip_Counter 0 +Exec_Master_Log_Pos # +Relay_Log_Space # +Until_Condition None +Until_Log_File +Until_Log_Pos 0 +Master_SSL_Allowed No +Master_SSL_CA_File +Master_SSL_CA_Path +Master_SSL_Cert +Master_SSL_Cipher +Master_SSL_Key +Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No +Last_IO_Errno # +Last_IO_Error # +Last_SQL_Errno 1054 +Last_SQL_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7' +STOP SLAVE; +RESET SLAVE; + +*** Drop t15 *** +DROP TABLE t15; +DROP TABLE t15; +RESET MASTER; +START SLAVE; + +************************************************ +* - Create index on Master column not on slave * +* Expect:Warning * +************************************************ + +*** Create t16 on slave *** +STOP SLAVE; +RESET SLAVE; +CREATE TABLE t16 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) +) ENGINE='NDB'; + +*** Create t16 on Master *** +CREATE TABLE t16 (c1 INT KEY, c4 BLOB, c5 CHAR(5), +c6 INT DEFAULT '1', +c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP +)ENGINE='NDB'; +RESET MASTER; + +*** Start Slave *** +START SLAVE; + +*** Master Create Index and Data Insert *** +CREATE INDEX part_of_c6 ON t16 (c6); +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); +INSERT INTO t16 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), +(2,@b1,'JOE',2,DEFAULT), +(3,@b1,'QA',3,DEFAULT); +SELECT c1,hex(c4),c5,c6,c7 FROM t16 ORDER BY c1; +c1 hex(c4) c5 c6 c7 +1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP +2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP +3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP + +***************** +*** BUG 30434 *** +***************** + +SHOW SLAVE STATUS; +Slave_IO_State # +Master_Host 127.0.0.1 +Master_User root +Master_Port # +Connect_Retry 1 +Master_Log_File master-bin.000001 +Read_Master_Log_Pos # +Relay_Log_File # +Relay_Log_Pos # +Relay_Master_Log_File master-bin.000001 +Slave_IO_Running Yes +Slave_SQL_Running No +Replicate_Do_DB +Replicate_Ignore_DB +Replicate_Do_Table +Replicate_Ignore_Table +Replicate_Wild_Do_Table +Replicate_Wild_Ignore_Table +Last_Errno 1072 +Last_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)' +Skip_Counter 0 +Exec_Master_Log_Pos # +Relay_Log_Space # +Until_Condition None +Until_Log_File +Until_Log_Pos 0 +Master_SSL_Allowed No +Master_SSL_CA_File +Master_SSL_CA_Path +Master_SSL_Cert +Master_SSL_Cipher +Master_SSL_Key +Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No +Last_IO_Errno # +Last_IO_Error # +Last_SQL_Errno 1072 +Last_SQL_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)' +STOP SLAVE; +RESET SLAVE; + +*** Drop t16 *** +DROP TABLE t16; +DROP TABLE t16; +RESET MASTER; +START SLAVE; + +***************************************************** +* - Delete rows using column on Master not on slave * +* Expect: Rows Deleted * +***************************************************** + +*** Create t17 on slave *** +STOP SLAVE; +RESET SLAVE; +CREATE TABLE t17 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) +) ENGINE='NDB'; + +*** Create t17 on Master *** +CREATE TABLE t17 (c1 INT KEY, c4 BLOB, c5 CHAR(5), +c6 INT DEFAULT '1', +c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP +)ENGINE='NDB'; +RESET MASTER; + +*** Start Slave *** +START SLAVE; + +*** Master Data Insert *** +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); +INSERT INTO t17 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), +(2,@b1,'JOE',2,DEFAULT), +(3,@b1,'QA',3,DEFAULT); +SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1; +c1 hex(c4) c5 c6 c7 +1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP +2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP +3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP + +** Select * from Slave ** +SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1; +c1 hex(c4) c5 +1 62316231623162316231623162316231 Kyle +2 62316231623162316231623162316231 JOE +3 62316231623162316231623162316231 QA + +** Delete from master ** +DELETE FROM t17 WHERE c6 = 3; +SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1; +c1 hex(c4) c5 c6 c7 +1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP +2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP + +** Check slave ** +SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1; +c1 hex(c4) c5 +1 62316231623162316231623162316231 Kyle +2 62316231623162316231623162316231 JOE +DROP TABLE t17; + + +***************************************************** +* - Update row using column on Master not on slave * +* Expect: Rows updated * +***************************************************** + +** Bug30674 ** + +*** Create t18 on slave *** + +STOP SLAVE; +RESET SLAVE; +CREATE TABLE t18 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) +) ENGINE='NDB'; + +*** Create t18 on Master *** +CREATE TABLE t18 (c1 INT KEY, c4 BLOB, c5 CHAR(5), +c6 INT DEFAULT '1', +c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP +)ENGINE='NDB'; +RESET MASTER; + +*** Start Slave *** +START SLAVE; + +*** Master Data Insert *** +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); +INSERT INTO t18 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), +(2,@b1,'JOE',2,DEFAULT), +(3,@b1,'QA',3,DEFAULT); +SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1; +c1 hex(c4) c5 c6 c7 +1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP +2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP +3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP + +** Select * from Slave ** +SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1; +c1 hex(c4) c5 +1 62316231623162316231623162316231 Kyle +2 62316231623162316231623162316231 JOE +3 62316231623162316231623162316231 QA + +** update from master ** +SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1; +c1 hex(c4) c5 c6 c7 +1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP +2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP +3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP + +** Check slave ** +SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1; +c1 hex(c4) c5 +1 62316231623162316231623162316231 Kyle +2 62316231623162316231623162316231 JOE +3 62316231623162316231623162316231 QA +DROP TABLE t18; + + +***************************************************** +* - Insert UUID column on Master not on slave * +* Expect: Rows inserted * +***************************************************** + +*** Create t5 on slave *** +STOP SLAVE; +RESET SLAVE; +CREATE TABLE t5 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) +) ENGINE='NDB'; + +*** Create t5 on Master *** +CREATE TABLE t5 (c1 INT KEY, c4 BLOB, c5 CHAR(5), +c6 LONG, +c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP +)ENGINE='NDB'; +RESET MASTER; + +*** Start Slave *** +START SLAVE; + +*** Master Data Insert *** +set @b1 = 'b1b1b1b1'; +INSERT INTO t5 () VALUES(1,@b1,'Kyle',UUID(),DEFAULT), +(2,@b1,'JOE',UUID(),DEFAULT), +(3,@b1,'QA',UUID(),DEFAULT); +SELECT c1,hex(c4),c5,c6,c7 FROM t5 ORDER BY c1; +c1 hex(c4) c5 c6 c7 +1 6231623162316231 Kyle UUID TIME +2 6231623162316231 JOE UUID TIME +3 6231623162316231 QA UUID TIME + +** Select * from Slave ** +SELECT c1,hex(c4),c5 FROM t5 ORDER BY c1; +c1 hex(c4) c5 +1 6231623162316231 Kyle +2 6231623162316231 JOE +3 6231623162316231 QA +DROP TABLE t5; + +set binlog_format=mixed; + +*********************************************************** +*********************************************************** +***************** Start of Testing ************************ +*********************************************************** +*********************************************************** +* This test format == binlog_format MIXED and engine == 'NDB' +*********************************************************** +*********************************************************** + +***** Testing more columns on the Master ***** + +CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), +/* extra */ +f5 FLOAT DEFAULT '2.00', +f6 CHAR(4) DEFAULT 'TEST', +f7 INT DEFAULT '0', +f8 TEXT, +f9 LONGBLOB, +f10 BIT(63), +f11 VARBINARY(64))ENGINE='NDB'; + +* Alter Table on Slave and drop columns f5 through f11 * + +alter table t1 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11; + +* Insert data in Master then update and delete some rows* + +* Select count and 20 rows from Master * + +SELECT COUNT(*) FROM t1; +COUNT(*) +40 + +SELECT f1,f2,f3,f4,f5,f6,f7,f8,f9, +hex(f10),hex(f11) FROM t1 ORDER BY f3 LIMIT 20; +f1 f2 f3 f4 f5 f6 f7 f8 f9 hex(f10) hex(f11) +2 2 2 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +3 3 3 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +5 5 5 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +6 6 6 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +8 8 8 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +9 9 9 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +11 11 11 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +12 12 12 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +14 14 14 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +15 15 15 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +17 17 17 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +18 18 18 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +20 20 20 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +21 21 21 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +23 23 23 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +24 24 24 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +26 26 26 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +27 27 27 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +29 29 29 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 +30 30 30 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 + +* Select count and 20 rows from Slave * + +SELECT COUNT(*) FROM t1; +COUNT(*) +40 + +SELECT * FROM t1 ORDER BY f3 LIMIT 20; +f1 f2 f3 f4 +2 2 2 second +3 3 3 next +5 5 5 second +6 6 6 next +8 8 8 second +9 9 9 next +11 11 11 second +12 12 12 next +14 14 14 second +15 15 15 next +17 17 17 second +18 18 18 next +20 20 20 second +21 21 21 next +23 23 23 second +24 24 24 next +26 26 26 second +27 27 27 next +29 29 29 second +30 30 30 next + +* Show Slave Status * + +show slave status;; +Slave_IO_State # +Master_Host 127.0.0.1 +Master_User root +Master_Port # +Connect_Retry 1 +Master_Log_File master-bin.000001 +Read_Master_Log_Pos # +Relay_Log_File # +Relay_Log_Pos # +Relay_Master_Log_File master-bin.000001 +Slave_IO_Running Yes +Slave_SQL_Running Yes +Replicate_Do_DB +Replicate_Ignore_DB +Replicate_Do_Table +Replicate_Ignore_Table +Replicate_Wild_Do_Table +Replicate_Wild_Ignore_Table +Last_Errno 0 +Last_Error +Skip_Counter 0 +Exec_Master_Log_Pos # +Relay_Log_Space # +Until_Condition None +Until_Log_File +Until_Log_Pos 0 +Master_SSL_Allowed No +Master_SSL_CA_File +Master_SSL_CA_Path +Master_SSL_Cert +Master_SSL_Cipher +Master_SSL_Key +Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No +Last_IO_Errno # +Last_IO_Error # +Last_SQL_Errno 0 +Last_SQL_Error + + +***** Testing Altering table def scenario ***** + +CREATE TABLE t2 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), +/* extra */ +f5 DOUBLE DEFAULT '2.00', +f6 ENUM('a', 'b', 'c') default 'a', +f7 DECIMAL(17,9) default '1000.00', +f8 MEDIUMBLOB, +f9 NUMERIC(6,4) default '2000.00', +f10 VARCHAR(1024), +f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', +f12 SET('a', 'b', 'c') default 'b') +ENGINE='NDB'; +Warnings: +Warning 1264 Out of range value for column 'f9' at row 1 + +CREATE TABLE t3 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), +/* extra */ +f5 DOUBLE DEFAULT '2.00', +f6 ENUM('a', 'b', 'c') default 'a', +f8 MEDIUMBLOB, +f10 VARCHAR(1024), +f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', +f12 SET('a', 'b', 'c') default 'b') +ENGINE='NDB'; + +CREATE TABLE t4 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), +/* extra */ +f5 DOUBLE DEFAULT '2.00', +f6 DECIMAL(17,9) default '1000.00', +f7 MEDIUMBLOB, +f8 NUMERIC(6,4) default '2000.00', +f9 VARCHAR(1024), +f10 BINARY(20) not null default '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', +f11 CHAR(255)) +ENGINE='NDB'; +Warnings: +Warning 1264 Out of range value for column 'f8' at row 1 + +CREATE TABLE t31 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), +/* extra */ +f5 BIGINT, +f6 BLOB, +f7 DATE, +f8 DATETIME, +f9 FLOAT, +f10 INT, +f11 LONGBLOB, +f12 LONGTEXT, +f13 MEDIUMBLOB, +f14 MEDIUMINT, +f15 MEDIUMTEXT, +f16 REAL, +f17 SMALLINT, +f18 TEXT, +f19 TIME, +f20 TIMESTAMP, +f21 TINYBLOB, +f22 TINYINT, +f23 TINYTEXT, +f24 YEAR, +f25 BINARY(255), +f26 BIT(64), +f27 CHAR(255), +f28 DECIMAL(30,7), +f29 DOUBLE, +f30 ENUM ('a','b', 'c') default 'a', +f31 FLOAT, +f32 NUMERIC(17,9), +f33 SET ('a', 'b', 'c') default 'b', +f34 VARBINARY(1025), +f35 VARCHAR(257) +) ENGINE='NDB'; + +** Alter tables on slave and drop columns ** + +alter table t2 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11, drop +f12; +alter table t3 drop f5, drop f6, drop f8, drop f10, drop f11, drop f12; +alter table t4 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11; +alter table t31 +drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11, +drop f12, drop f13, drop f14, drop f15, drop f16, drop f17, drop f18, +drop f19, drop f20, drop f21, drop f22, drop f23, drop f24, drop f25, +drop f26, drop f27, drop f28, drop f29, drop f30, drop f31, drop f32, +drop f33, drop f34, drop f35; + +** Insert Data into Master ** +INSERT into t2 set f1=1, f2=1, f3=1, f4='first', f8='f8: medium size blob', f10='f10: +some var char'; +INSERT into t2 values (2, 2, 2, 'second', +2.0, 'b', 2000.0002, 'f8: medium size blob', 2000, 'f10: some var char', +'01234567', 'c'), +(3, 3, 3, 'third', +3.0, 'b', 3000.0003, 'f8: medium size blob', 3000, 'f10: some var char', +'01234567', 'c'); +Warnings: +Warning 1264 Out of range value for column 'f9' at row 1 +Warning 1264 Out of range value for column 'f9' at row 2 +INSERT into t3 set f1=1, f2=1, f3=1, f4='first', f10='f10: some var char'; +INSERT into t4 set f1=1, f2=1, f3=1, f4='first', f7='f7: medium size blob', f10='f10: +binary data'; +INSERT into t31 set f1=1, f2=1, f3=1, f4='first'; +INSERT into t31 set f1=1, f2=1, f3=2, f4='second', +f9=2.2, f10='seven samurai', f28=222.222, f35='222'; +Warnings: +Warning 1366 Incorrect integer value: 'seven samurai' for column 'f10' at row 1 +INSERT into t31 values (1, 1, 3, 'third', +/* f5 BIGINT, */ 333333333333333333333333, +/* f6 BLOB, */ '3333333333333333333333', +/* f7 DATE, */ '2007-07-18', +/* f8 DATETIME, */ "2007-07-18", +/* f9 FLOAT, */ 3.33333333, +/* f10 INT, */ 333333333, +/* f11 LONGBLOB, */ '3333333333333333333', +/* f12 LONGTEXT, */ '3333333333333333333', +/* f13 MEDIUMBLOB, */ '3333333333333333333', +/* f14 MEDIUMINT, */ 33, +/* f15 MEDIUMTEXT, */ 3.3, +/* f16 REAL, */ 3.3, +/* f17 SMALLINT, */ 3, +/* f18 TEXT, */ '33', +/* f19 TIME, */ '2:59:58.999', +/* f20 TIMESTAMP, */ 20000303000000, +/* f21 TINYBLOB, */ '3333', +/* f22 TINYINT, */ 3, +/* f23 TINYTEXT, */ '3', +/* f24 YEAR, */ 3000, +/* f25 BINARY(255), */ 'three_33333', +/* f26 BIT(64), */ b'011', +/* f27 CHAR(255), */ 'three', +/* f28 DECIMAL(30,7), */ 3.333, +/* f29 DOUBLE, */ 3.333333333333333333333333333, +/* f30 ENUM ('a','b','c')*/ 'c', +/* f31 FLOAT, */ 3.0, +/* f32 NUMERIC(17,9), */ 3.3333, +/* f33 SET ('a','b','c'),*/ 'c', +/*f34 VARBINARY(1025),*/ '3333 minus 3', +/*f35 VARCHAR(257),*/ 'three times three' + ); +Warnings: +Warning 1264 Out of range value for column 'f5' at row 1 +Warning 1264 Out of range value for column 'f24' at row 1 +INSERT into t31 values (1, 1, 4, 'fourth', +/* f5 BIGINT, */ 333333333333333333333333, +/* f6 BLOB, */ '3333333333333333333333', +/* f7 DATE, */ '2007-07-18', +/* f8 DATETIME, */ "2007-07-18", +/* f9 FLOAT, */ 3.33333333, +/* f10 INT, */ 333333333, +/* f11 LONGBLOB, */ '3333333333333333333', +/* f12 LONGTEXT, */ '3333333333333333333', +/* f13 MEDIUMBLOB, */ '3333333333333333333', +/* f14 MEDIUMINT, */ 33, +/* f15 MEDIUMTEXT, */ 3.3, +/* f16 REAL, */ 3.3, +/* f17 SMALLINT, */ 3, +/* f18 TEXT, */ '33', +/* f19 TIME, */ '2:59:58.999', +/* f20 TIMESTAMP, */ 20000303000000, +/* f21 TINYBLOB, */ '3333', +/* f22 TINYINT, */ 3, +/* f23 TINYTEXT, */ '3', +/* f24 YEAR, */ 3000, +/* f25 BINARY(255), */ 'three_33333', +/* f26 BIT(64), */ b'011', +/* f27 CHAR(255), */ 'three', +/* f28 DECIMAL(30,7), */ 3.333, +/* f29 DOUBLE, */ 3.333333333333333333333333333, +/* f30 ENUM ('a','b','c')*/ 'c', +/* f31 FLOAT, */ 3.0, +/* f32 NUMERIC(17,9), */ 3.3333, +/* f33 SET ('a','b','c'),*/ 'c', +/*f34 VARBINARY(1025),*/ '3333 minus 3', +/*f35 VARCHAR(257),*/ 'three times three' + ), +(1, 1, 5, 'fifth', +/* f5 BIGINT, */ 333333333333333333333333, +/* f6 BLOB, */ '3333333333333333333333', +/* f7 DATE, */ '2007-07-18', +/* f8 DATETIME, */ "2007-07-18", +/* f9 FLOAT, */ 3.33333333, +/* f10 INT, */ 333333333, +/* f11 LONGBLOB, */ '3333333333333333333', +/* f12 LONGTEXT, */ '3333333333333333333', +/* f13 MEDIUMBLOB, */ '3333333333333333333', +/* f14 MEDIUMINT, */ 33, +/* f15 MEDIUMTEXT, */ 3.3, +/* f16 REAL, */ 3.3, +/* f17 SMALLINT, */ 3, +/* f18 TEXT, */ '33', +/* f19 TIME, */ '2:59:58.999', +/* f20 TIMESTAMP, */ 20000303000000, +/* f21 TINYBLOB, */ '3333', +/* f22 TINYINT, */ 3, +/* f23 TINYTEXT, */ '3', +/* f24 YEAR, */ 3000, +/* f25 BINARY(255), */ 'three_33333', +/* f26 BIT(64), */ b'011', +/* f27 CHAR(255), */ 'three', +/* f28 DECIMAL(30,7), */ 3.333, +/* f29 DOUBLE, */ 3.333333333333333333333333333, +/* f30 ENUM ('a','b','c')*/ 'c', +/* f31 FLOAT, */ 3.0, +/* f32 NUMERIC(17,9), */ 3.3333, +/* f33 SET ('a','b','c'),*/ 'c', +/*f34 VARBINARY(1025),*/ '3333 minus 3', +/*f35 VARCHAR(257),*/ 'three times three' + ), +(1, 1, 6, 'sixth', +/* f5 BIGINT, */ NULL, +/* f6 BLOB, */ '3333333333333333333333', +/* f7 DATE, */ '2007-07-18', +/* f8 DATETIME, */ "2007-07-18", +/* f9 FLOAT, */ 3.33333333, +/* f10 INT, */ 333333333, +/* f11 LONGBLOB, */ '3333333333333333333', +/* f12 LONGTEXT, */ '3333333333333333333', +/* f13 MEDIUMBLOB, */ '3333333333333333333', +/* f14 MEDIUMINT, */ 33, +/* f15 MEDIUMTEXT, */ 3.3, +/* f16 REAL, */ 3.3, +/* f17 SMALLINT, */ 3, +/* f18 TEXT, */ '33', +/* f19 TIME, */ '2:59:58.999', +/* f20 TIMESTAMP, */ 20000303000000, +/* f21 TINYBLOB, */ '3333', +/* f22 TINYINT, */ 3, +/* f23 TINYTEXT, */ '3', +/* f24 YEAR, */ 3000, +/* f25 BINARY(255), */ 'three_33333', +/* f26 BIT(64), */ b'011', +/* f27 CHAR(255), */ 'three', +/* f28 DECIMAL(30,7), */ 3.333, +/* f29 DOUBLE, */ 3.333333333333333333333333333, +/* f30 ENUM ('a','b','c')*/ 'c', +/* f31 FLOAT, */ 3.0, +/* f32 NUMERIC(17,9), */ 3.3333, +/* f33 SET ('a','b','c'),*/ 'c', +/*f34 VARBINARY(1025),*/ '3333 minus 3', +/*f35 VARCHAR(257),*/ NULL +); +Warnings: +Warning 1264 Out of range value for column 'f5' at row 1 +Warning 1264 Out of range value for column 'f24' at row 1 +Warning 1264 Out of range value for column 'f5' at row 2 +Warning 1264 Out of range value for column 'f24' at row 2 +Warning 1264 Out of range value for column 'f24' at row 3 + +** Sync slave with master ** +** Do selects from tables ** + +select * from t1 order by f3; +f1 f2 f3 f4 +2 2 2 second +3 3 3 next +5 5 5 second +6 6 6 next +8 8 8 second +9 9 9 next +11 11 11 second +12 12 12 next +14 14 14 second +15 15 15 next +17 17 17 second +18 18 18 next +20 20 20 second +21 21 21 next +23 23 23 second +24 24 24 next +26 26 26 second +27 27 27 next +29 29 29 second +30 30 30 next +31 31 31 second +32 32 32 second +33 33 33 second +34 34 34 second +35 35 35 second +36 36 36 second +37 37 37 second +38 38 38 second +39 39 39 second +40 40 40 second +41 41 41 second +42 42 42 second +43 43 43 second +44 44 44 second +45 45 45 second +46 46 46 second +47 47 47 second +48 48 48 second +49 49 49 second +50 50 50 second +select * from t2 order by f1; +f1 f2 f3 f4 +1 1 1 first +2 2 2 second +3 3 3 third +select * from t3 order by f1; +f1 f2 f3 f4 +1 1 1 first +select * from t4 order by f1; +f1 f2 f3 f4 +1 1 1 first +select * from t31 order by f1; +f1 f2 f3 f4 +1 1 5 fifth +1 1 3 third +1 1 1 first +1 1 6 sixth +1 1 2 second +1 1 4 fourth + +** Do updates master ** + +update t31 set f5=555555555555555 where f3=6; +update t31 set f2=2 where f3=2; +update t31 set f1=NULL where f3=1; +update t31 set f3=NULL, f27=NULL, f35='f35 new value' where f3=3; +Warnings: +Warning 1048 Column 'f3' cannot be null + +** Delete from Master ** + +delete from t1; +delete from t2; +delete from t3; +delete from t4; +delete from t31; + +** Check slave status ** + +select * from t31; +f1 f2 f3 f4 +show slave status;; +Slave_IO_State # +Master_Host 127.0.0.1 +Master_User root +Master_Port # +Connect_Retry 1 +Master_Log_File master-bin.000001 +Read_Master_Log_Pos # +Relay_Log_File # +Relay_Log_Pos # +Relay_Master_Log_File master-bin.000001 +Slave_IO_Running Yes +Slave_SQL_Running Yes +Replicate_Do_DB +Replicate_Ignore_DB +Replicate_Do_Table +Replicate_Ignore_Table +Replicate_Wild_Do_Table +Replicate_Wild_Ignore_Table +Last_Errno 0 +Last_Error +Skip_Counter 0 +Exec_Master_Log_Pos # +Relay_Log_Space # +Until_Condition None +Until_Log_File +Until_Log_Pos 0 +Master_SSL_Allowed No +Master_SSL_CA_File +Master_SSL_CA_Path +Master_SSL_Cert +Master_SSL_Cipher +Master_SSL_Key +Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No +Last_IO_Errno # +Last_IO_Error # +Last_SQL_Errno 0 +Last_SQL_Error + +**************************************** +* columns in master at middle of table * +* Expect: Proper error message * +**************************************** + +** Stop and Reset Slave ** + +STOP SLAVE; +RESET SLAVE; + +** create table slave side ** +CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5) +) ENGINE='NDB'; + +** Connect to master and create table ** + +CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233', +c CHAR(5), e INT DEFAULT '1')ENGINE='NDB'; +RESET MASTER; + +*** Start Slave *** +START SLAVE; + +*** Master Data Insert *** +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); +INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT), +(2,@b1,DEFAULT,'JOE',DEFAULT), +(3,@b1,DEFAULT,'QA',DEFAULT); + +******************************************** +*** Expect slave to fail with Error 1523 *** +******************************************** + +SHOW SLAVE STATUS; +Slave_IO_State # +Master_Host 127.0.0.1 +Master_User root +Master_Port # +Connect_Retry 1 +Master_Log_File master-bin.000001 +Read_Master_Log_Pos # +Relay_Log_File # +Relay_Log_Pos # +Relay_Master_Log_File master-bin.000001 +Slave_IO_Running Yes +Slave_SQL_Running No +Replicate_Do_DB +Replicate_Ignore_DB +Replicate_Do_Table +Replicate_Ignore_Table +Replicate_Wild_Do_Table +Replicate_Wild_Ignore_Table +Last_Errno 1532 +Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 +Skip_Counter 0 +Exec_Master_Log_Pos # +Relay_Log_Space # +Until_Condition None +Until_Log_File +Until_Log_Pos 0 +Master_SSL_Allowed No +Master_SSL_CA_File +Master_SSL_CA_Path +Master_SSL_Cert +Master_SSL_Cipher +Master_SSL_Key +Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No +Last_IO_Errno # +Last_IO_Error # +Last_SQL_Errno 1532 +Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; +START SLAVE; + +*** Drop t10 *** +DROP TABLE t10; + +********************************************* +* More columns in master at middle of table * +* Expect: Proper error message * +********************************************* + +*** Create t11 on slave *** +STOP SLAVE; +RESET SLAVE; +CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254) +) ENGINE='NDB'; + +*** Create t11 on Master *** +CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT, +c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='NDB'; +RESET MASTER; + +*** Start Slave *** +START SLAVE; + +*** Master Data Insert *** +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); +INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT), +(2,@b1,'Testing is cool','JOE',DEFAULT), +(3,@b1,DEFAULT,'QA',DEFAULT); + +******************************************** +*** Expect slave to fail with Error 1523 *** +******************************************** + +SHOW SLAVE STATUS; +Slave_IO_State # +Master_Host 127.0.0.1 +Master_User root +Master_Port # +Connect_Retry 1 +Master_Log_File master-bin.000001 +Read_Master_Log_Pos # +Relay_Log_File # +Relay_Log_Pos # +Relay_Master_Log_File master-bin.000001 +Slave_IO_Running Yes +Slave_SQL_Running No +Replicate_Do_DB +Replicate_Ignore_DB +Replicate_Do_Table +Replicate_Ignore_Table +Replicate_Wild_Do_Table +Replicate_Wild_Ignore_Table +Last_Errno 1532 +Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 +Skip_Counter 0 +Exec_Master_Log_Pos # +Relay_Log_Space # +Until_Condition None +Until_Log_File +Until_Log_Pos 0 +Master_SSL_Allowed No +Master_SSL_CA_File +Master_SSL_CA_Path +Master_SSL_Cert +Master_SSL_Cipher +Master_SSL_Key +Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No +Last_IO_Errno # +Last_IO_Error # +Last_SQL_Errno 1532 +Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 +SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; +START SLAVE; + +*** Drop t11 *** +DROP TABLE t11; + +********************************************* +* More columns in master at middle of table * +* Expect: This one should pass blob-text * +********************************************* + +*** Create t12 on slave *** +STOP SLAVE; +RESET SLAVE; +CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB +) ENGINE='NDB'; + +*** Create t12 on Master *** +CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT, +c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='NDB'; +RESET MASTER; + +*** Start Slave *** +START SLAVE; + +*** Master Data Insert *** +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); +INSERT INTO t12 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), +(2,@b1,'JOE',DEFAULT,DEFAULT), +(3,@b1,'QA',DEFAULT,DEFAULT); + +SELECT a,hex(b),f,c,e FROM t12 ORDER BY a; +a hex(b) f c e +1 62316231623162316231623162316231 Kyle test 1 +2 62316231623162316231623162316231 JOE test 1 +3 62316231623162316231623162316231 QA test 1 + +*** Select on Slave *** +SELECT a,hex(b),c FROM t12 ORDER BY a; +a hex(b) c +1 62316231623162316231623162316231 Kyle +2 62316231623162316231623162316231 JOE +3 62316231623162316231623162316231 QA + +*** Drop t12 *** +DROP TABLE t12; + +**************************************************** +* - Alter Master adding columns at middle of table * +* Expect: columns added * +**************************************************** + + +*** Create t14 on slave *** +STOP SLAVE; +RESET SLAVE; +CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) +) ENGINE='NDB'; + +*** Create t14 on Master *** +CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5), +c6 INT DEFAULT '1', +c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP +)ENGINE='NDB'; +RESET MASTER; + +*** Start Slave *** +START SLAVE; + +*** Master Data Insert *** +ALTER TABLE t14 ADD COLUMN c2 DECIMAL(8,2) AFTER c1; +ALTER TABLE t14 ADD COLUMN c3 TEXT AFTER c2; + +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); +INSERT INTO t14 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle',DEFAULT,DEFAULT), +(2,2.00,'This Test Should work',@b1,'JOE',DEFAULT,DEFAULT), +(3,3.00,'If is does not, I will open a bug',@b1,'QA',DEFAULT,DEFAULT); + +SELECT c1,c2,c3,hex(c4),c5,c6,c7 FROM t14 ORDER BY c1; +c1 c2 c3 hex(c4) c5 c6 c7 +1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP +2 2.00 This Test Should work 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP +3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP + +*** Select on Slave **** +SELECT c1,c2,c3,hex(c4),c5 FROM t14 ORDER BY c1; +c1 c2 c3 hex(c4) c5 +1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle +2 2.00 This Test Should work 62316231623162316231623162316231 JOE +3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA + +**************************************************** +* - Alter Master Dropping columns from the middle. * +* Expect: columns dropped * +**************************************************** + +*** connect to master and drop columns *** +ALTER TABLE t14 DROP COLUMN c2; +ALTER TABLE t14 DROP COLUMN c7; + +*** Select from Master *** +SELECT c1,c3,hex(c4),c5,c6 FROM t14 ORDER BY c1; +c1 c3 hex(c4) c5 c6 +1 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1 +2 This Test Should work 62316231623162316231623162316231 JOE 1 +3 If is does not, I will open a bug 62316231623162316231623162316231 QA 1 + +************ +* Bug30415 * +************ +SHOW SLAVE STATUS; +Slave_IO_State # +Master_Host 127.0.0.1 +Master_User root +Master_Port # +Connect_Retry 1 +Master_Log_File master-bin.000001 +Read_Master_Log_Pos # +Relay_Log_File # +Relay_Log_Pos # +Relay_Master_Log_File master-bin.000001 +Slave_IO_Running Yes +Slave_SQL_Running No +Replicate_Do_DB +Replicate_Ignore_DB +Replicate_Do_Table +Replicate_Ignore_Table +Replicate_Wild_Do_Table +Replicate_Wild_Ignore_Table +Last_Errno 1091 +Last_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7' +Skip_Counter 0 +Exec_Master_Log_Pos # +Relay_Log_Space # +Until_Condition None +Until_Log_File +Until_Log_Pos 0 +Master_SSL_Allowed No +Master_SSL_CA_File +Master_SSL_CA_Path +Master_SSL_Cert +Master_SSL_Cipher +Master_SSL_Key +Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No +Last_IO_Errno # +Last_IO_Error # +Last_SQL_Errno 1091 +Last_SQL_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7' +STOP SLAVE; +RESET SLAVE; + +*** Drop t14 *** +DROP TABLE t14; +DROP TABLE t14; +RESET MASTER; +START SLAVE; + +************************************************* +* - Alter Master adding columns at end of table * +* Expect: Error 1054 * +************************************************* + +*** Create t15 on slave *** +STOP SLAVE; +RESET SLAVE; +CREATE TABLE t15 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) +) ENGINE='NDB'; + +*** Create t15 on Master *** +CREATE TABLE t15 (c1 INT KEY, c4 BLOB, c5 CHAR(5), +c6 INT DEFAULT '1', +c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP +)ENGINE='NDB'; +RESET MASTER; + +*** Start Slave *** +START SLAVE; + +*** Master Data Insert *** +ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7; +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); +INSERT INTO t15 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT,3.00), +(2,@b1,'JOE',DEFAULT,DEFAULT,3.00), +(3,@b1,'QA',DEFAULT,DEFAULT,3.00); +SELECT c1,hex(c4),c5,c6,c7,c2 FROM t15 ORDER BY c1; +c1 hex(c4) c5 c6 c7 c2 +1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP 3.00 +2 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP 3.00 +3 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP 3.00 + +******************************************** +*** Expect slave to fail with Error 1054 *** +******************************************** + +SHOW SLAVE STATUS; +Slave_IO_State # +Master_Host 127.0.0.1 +Master_User root +Master_Port # +Connect_Retry 1 +Master_Log_File master-bin.000001 +Read_Master_Log_Pos # +Relay_Log_File # +Relay_Log_Pos # +Relay_Master_Log_File master-bin.000001 +Slave_IO_Running Yes +Slave_SQL_Running No +Replicate_Do_DB +Replicate_Ignore_DB +Replicate_Do_Table +Replicate_Ignore_Table +Replicate_Wild_Do_Table +Replicate_Wild_Ignore_Table +Last_Errno 1054 +Last_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7' +Skip_Counter 0 +Exec_Master_Log_Pos # +Relay_Log_Space # +Until_Condition None +Until_Log_File +Until_Log_Pos 0 +Master_SSL_Allowed No +Master_SSL_CA_File +Master_SSL_CA_Path +Master_SSL_Cert +Master_SSL_Cipher +Master_SSL_Key +Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No +Last_IO_Errno # +Last_IO_Error # +Last_SQL_Errno 1054 +Last_SQL_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7' +STOP SLAVE; +RESET SLAVE; + +*** Drop t15 *** +DROP TABLE t15; +DROP TABLE t15; +RESET MASTER; +START SLAVE; + +************************************************ +* - Create index on Master column not on slave * +* Expect:Warning * +************************************************ + +*** Create t16 on slave *** +STOP SLAVE; +RESET SLAVE; +CREATE TABLE t16 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) +) ENGINE='NDB'; + +*** Create t16 on Master *** +CREATE TABLE t16 (c1 INT KEY, c4 BLOB, c5 CHAR(5), +c6 INT DEFAULT '1', +c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP +)ENGINE='NDB'; +RESET MASTER; + +*** Start Slave *** +START SLAVE; + +*** Master Create Index and Data Insert *** +CREATE INDEX part_of_c6 ON t16 (c6); +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); +INSERT INTO t16 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), +(2,@b1,'JOE',2,DEFAULT), +(3,@b1,'QA',3,DEFAULT); +SELECT c1,hex(c4),c5,c6,c7 FROM t16 ORDER BY c1; +c1 hex(c4) c5 c6 c7 +1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP +2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP +3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP + +***************** +*** BUG 30434 *** +***************** + +SHOW SLAVE STATUS; +Slave_IO_State # +Master_Host 127.0.0.1 +Master_User root +Master_Port # +Connect_Retry 1 +Master_Log_File master-bin.000001 +Read_Master_Log_Pos # +Relay_Log_File # +Relay_Log_Pos # +Relay_Master_Log_File master-bin.000001 +Slave_IO_Running Yes +Slave_SQL_Running No +Replicate_Do_DB +Replicate_Ignore_DB +Replicate_Do_Table +Replicate_Ignore_Table +Replicate_Wild_Do_Table +Replicate_Wild_Ignore_Table +Last_Errno 1072 +Last_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)' +Skip_Counter 0 +Exec_Master_Log_Pos # +Relay_Log_Space # +Until_Condition None +Until_Log_File +Until_Log_Pos 0 +Master_SSL_Allowed No +Master_SSL_CA_File +Master_SSL_CA_Path +Master_SSL_Cert +Master_SSL_Cipher +Master_SSL_Key +Seconds_Behind_Master # +Master_SSL_Verify_Server_Cert No +Last_IO_Errno # +Last_IO_Error # +Last_SQL_Errno 1072 +Last_SQL_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)' +STOP SLAVE; +RESET SLAVE; + +*** Drop t16 *** +DROP TABLE t16; +DROP TABLE t16; +RESET MASTER; +START SLAVE; + +***************************************************** +* - Delete rows using column on Master not on slave * +* Expect: Rows Deleted * +***************************************************** + +*** Create t17 on slave *** +STOP SLAVE; +RESET SLAVE; +CREATE TABLE t17 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) +) ENGINE='NDB'; + +*** Create t17 on Master *** +CREATE TABLE t17 (c1 INT KEY, c4 BLOB, c5 CHAR(5), +c6 INT DEFAULT '1', +c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP +)ENGINE='NDB'; +RESET MASTER; + +*** Start Slave *** +START SLAVE; + +*** Master Data Insert *** +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); +INSERT INTO t17 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), +(2,@b1,'JOE',2,DEFAULT), +(3,@b1,'QA',3,DEFAULT); +SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1; +c1 hex(c4) c5 c6 c7 +1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP +2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP +3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP + +** Select * from Slave ** +SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1; +c1 hex(c4) c5 +1 62316231623162316231623162316231 Kyle +2 62316231623162316231623162316231 JOE +3 62316231623162316231623162316231 QA + +** Delete from master ** +DELETE FROM t17 WHERE c6 = 3; +SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1; +c1 hex(c4) c5 c6 c7 +1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP +2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP + +** Check slave ** +SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1; +c1 hex(c4) c5 +1 62316231623162316231623162316231 Kyle +2 62316231623162316231623162316231 JOE +DROP TABLE t17; + + +***************************************************** +* - Update row using column on Master not on slave * +* Expect: Rows updated * +***************************************************** + +** Bug30674 ** + +*** Create t18 on slave *** + +STOP SLAVE; +RESET SLAVE; +CREATE TABLE t18 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) +) ENGINE='NDB'; + +*** Create t18 on Master *** +CREATE TABLE t18 (c1 INT KEY, c4 BLOB, c5 CHAR(5), +c6 INT DEFAULT '1', +c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP +)ENGINE='NDB'; +RESET MASTER; + +*** Start Slave *** +START SLAVE; + +*** Master Data Insert *** +set @b1 = 'b1b1b1b1'; +set @b1 = concat(@b1,@b1); +INSERT INTO t18 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), +(2,@b1,'JOE',2,DEFAULT), +(3,@b1,'QA',3,DEFAULT); +SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1; +c1 hex(c4) c5 c6 c7 +1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP +2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP +3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP + +** Select * from Slave ** +SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1; +c1 hex(c4) c5 +1 62316231623162316231623162316231 Kyle +2 62316231623162316231623162316231 JOE +3 62316231623162316231623162316231 QA + +** update from master ** +SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1; +c1 hex(c4) c5 c6 c7 +1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP +2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP +3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP + +** Check slave ** +SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1; +c1 hex(c4) c5 +1 62316231623162316231623162316231 Kyle +2 62316231623162316231623162316231 JOE +3 62316231623162316231623162316231 QA +DROP TABLE t18; + + +***************************************************** +* - Insert UUID column on Master not on slave * +* Expect: Rows inserted * +***************************************************** + +*** Create t5 on slave *** +STOP SLAVE; +RESET SLAVE; +CREATE TABLE t5 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) +) ENGINE='NDB'; + +*** Create t5 on Master *** +CREATE TABLE t5 (c1 INT KEY, c4 BLOB, c5 CHAR(5), +c6 LONG, +c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP +)ENGINE='NDB'; +RESET MASTER; + +*** Start Slave *** +START SLAVE; + +*** Master Data Insert *** +set @b1 = 'b1b1b1b1'; +INSERT INTO t5 () VALUES(1,@b1,'Kyle',UUID(),DEFAULT), +(2,@b1,'JOE',UUID(),DEFAULT), +(3,@b1,'QA',UUID(),DEFAULT); +SELECT c1,hex(c4),c5,c6,c7 FROM t5 ORDER BY c1; +c1 hex(c4) c5 c6 c7 +1 6231623162316231 Kyle UUID TIME +2 6231623162316231 JOE UUID TIME +3 6231623162316231 QA UUID TIME + +** Select * from Slave ** +SELECT c1,hex(c4),c5 FROM t5 ORDER BY c1; +c1 hex(c4) c5 +1 6231623162316231 Kyle +2 6231623162316231 JOE +3 6231623162316231 QA +DROP TABLE t5; + diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_extraColMaster.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_extraColMaster.test new file mode 100644 index 00000000000..d78eda7eef1 --- /dev/null +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_extraColMaster.test @@ -0,0 +1,14 @@ +############################################################# +# Purpose: To test having extra columns on the master WL#3915 +############################################################# +-- source include/have_ndb.inc +-- source include/ndb_master-slave.inc +-- source include/have_binlog_format_mixed_or_row.inc + +let $engine_type = 'NDB'; + +set binlog_format=row; +-- source extra/rpl_tests/rpl_extraMaster_Col.test + +set binlog_format=mixed; +-- source extra/rpl_tests/rpl_extraMaster_Col.test From e54c56b26a4f7cf0b1798c1db0088d37ff3a6f3c Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 11 Oct 2007 14:54:05 +0200 Subject: [PATCH 35/49] ndb - bug#31525 Fix bug regarding node that missed 2 LCP's (that was not included in next LCP after SR) storage/ndb/src/kernel/blocks/ERROR_codes.txt: add new error codes for bug#31525 storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp: add new error codes for bug#31525 fix bug, i.e include missing_2 in LCP storage/ndb/test/ndbapi/testNodeRestart.cpp: add testcase for bug#31525 storage/ndb/test/run-test/daily-basic-tests.txt: add testcase for bug#31525 --- storage/ndb/src/kernel/blocks/ERROR_codes.txt | 5 +- .../ndb/src/kernel/blocks/dbdih/DbdihMain.cpp | 4 + storage/ndb/test/ndbapi/testNodeRestart.cpp | 77 +++++++++++++++++++ .../ndb/test/run-test/daily-basic-tests.txt | 4 + 4 files changed, 89 insertions(+), 1 deletion(-) diff --git a/storage/ndb/src/kernel/blocks/ERROR_codes.txt b/storage/ndb/src/kernel/blocks/ERROR_codes.txt index abb1d858082..deea98fc3a6 100644 --- a/storage/ndb/src/kernel/blocks/ERROR_codes.txt +++ b/storage/ndb/src/kernel/blocks/ERROR_codes.txt @@ -5,7 +5,7 @@ Next DBACC 3002 Next DBTUP 4029 Next DBLQH 5045 Next DBDICT 6007 -Next DBDIH 7186 +Next DBDIH 7193 Next DBTC 8054 Next CMVMI 9000 Next BACKUP 10038 @@ -155,6 +155,9 @@ And crash when all have "not" been sent 7027: Crash in master when changing state to LCP_TAB_SAVED 7018: Crash in master when changing state to LCP_TAB_SAVED +7191: Crash when receiving LCP_COMPLETE_REP +7192: Crash in setLcpActiveStatusStart - when dead node missed to LCP's + ERROR CODES FOR TESTING NODE FAILURE, FAILURE IN COPY FRAGMENT PROCESS: ----------------------------------------------------------------------- diff --git a/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp b/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp index f4433b9d264..217c6f38ade 100644 --- a/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp +++ b/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp @@ -10853,6 +10853,8 @@ void Dbdih::execLCP_COMPLETE_REP(Signal* signal) { jamEntry(); + CRASH_INSERTION(7191); + #if 0 g_eventLogger.info("LCP_COMPLETE_REP"); printLCP_COMPLETE_REP(stdout, @@ -13603,6 +13605,7 @@ void Dbdih::setLcpActiveStatusStart(Signal* signal) // It must be taken over with the copy fragment process after a system // crash. We indicate this by setting the active status to TAKE_OVER. /*-------------------------------------------------------------------*/ + c_lcpState.m_participatingLQH.set(nodePtr.i); nodePtr.p->activeStatus = Sysfile::NS_TakeOver; //break; // Fall through case Sysfile::NS_TakeOver:{ @@ -13645,6 +13648,7 @@ void Dbdih::setLcpActiveStatusStart(Signal* signal) break; case Sysfile::NS_ActiveMissed_2: jam(); + CRASH_INSERTION(7192); if ((nodePtr.p->nodeStatus == NodeRecord::ALIVE) && (!nodePtr.p->copyCompleted)) { jam(); diff --git a/storage/ndb/test/ndbapi/testNodeRestart.cpp b/storage/ndb/test/ndbapi/testNodeRestart.cpp index 66b9c6086da..4b80dd7aaef 100644 --- a/storage/ndb/test/ndbapi/testNodeRestart.cpp +++ b/storage/ndb/test/ndbapi/testNodeRestart.cpp @@ -1668,6 +1668,80 @@ runBug28717(NDBT_Context* ctx, NDBT_Step* step) return NDBT_OK; } +int +runBug31525(NDBT_Context* ctx, NDBT_Step* step) +{ + int result = NDBT_OK; + int loops = ctx->getNumLoops(); + int records = ctx->getNumRecords(); + Ndb* pNdb = GETNDB(step); + NdbRestarter res; + + if (res.getNumDbNodes() < 2) + { + return NDBT_OK; + } + + int nodes[2]; + nodes[0] = res.getMasterNodeId(); + nodes[1] = res.getNextMasterNodeId(nodes[0]); + + while (res.getNodeGroup(nodes[0]) != res.getNodeGroup(nodes[1])) + { + ndbout_c("Restarting %u as it not in same node group as %u", + nodes[1], nodes[0]); + if (res.restartOneDbNode(nodes[1], false, true, true)) + return NDBT_FAILED; + + if (res.waitNodesNoStart(nodes+1, 1)) + return NDBT_FAILED; + + if (res.startNodes(nodes+1, 1)) + return NDBT_FAILED; + + if (res.waitClusterStarted()) + return NDBT_FAILED; + + nodes[1] = res.getNextMasterNodeId(nodes[0]); + } + + ndbout_c("nodes[0]: %u nodes[1]: %u", nodes[0], nodes[1]); + + int val = DumpStateOrd::DihMinTimeBetweenLCP; + if (res.dumpStateAllNodes(&val, 1)) + return NDBT_FAILED; + + int val2[] = { DumpStateOrd::CmvmiSetRestartOnErrorInsert, 1 }; + if (res.dumpStateAllNodes(val2, 2)) + return NDBT_FAILED; + + if (res.insertErrorInAllNodes(932)) + return NDBT_FAILED; + + if (res.insertErrorInNode(nodes[1], 7192)) + return NDBT_FAILED; + + if (res.insertErrorInNode(nodes[0], 7191)) + return NDBT_FAILED; + + if (res.waitClusterNoStart()) + return NDBT_FAILED; + + if (res.startAll()) + return NDBT_FAILED; + + if (res.waitClusterStarted()) + return NDBT_FAILED; + + if (res.restartOneDbNode(nodes[1], false, false, true)) + return NDBT_FAILED; + + if (res.waitClusterStarted()) + return NDBT_FAILED; + + return NDBT_OK; +} + NDBT_TESTSUITE(testNodeRestart); TESTCASE("NoLoad", "Test that one node at a time can be stopped and then restarted "\ @@ -1991,6 +2065,9 @@ TESTCASE("Bug21271", STEP(runPkUpdateUntilStopped); FINALIZER(runClearTable); } +TESTCASE("Bug31525", ""){ + INITIALIZER(runBug31525); +} TESTCASE("Bug24717", ""){ INITIALIZER(runBug24717); } diff --git a/storage/ndb/test/run-test/daily-basic-tests.txt b/storage/ndb/test/run-test/daily-basic-tests.txt index 2c654a13bcf..da588430e80 100644 --- a/storage/ndb/test/run-test/daily-basic-tests.txt +++ b/storage/ndb/test/run-test/daily-basic-tests.txt @@ -934,3 +934,7 @@ max-time: 1500 cmd: testSystemRestart args: -n SR_DD_2b_LCP D2 +max-time: 600 +cmd: testNodeRestart +args: -n Bug31525 T1 + From 7de1ec1e2e1b7c1251408f39047baa10bc18151e Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 11 Oct 2007 15:28:10 +0200 Subject: [PATCH 36/49] ndb - decrease test time storage/ndb/test/run-test/daily-basic-tests.txt: decrease test time --- storage/ndb/test/run-test/daily-basic-tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/ndb/test/run-test/daily-basic-tests.txt b/storage/ndb/test/run-test/daily-basic-tests.txt index 4e937ee8933..fd8faf959ae 100644 --- a/storage/ndb/test/run-test/daily-basic-tests.txt +++ b/storage/ndb/test/run-test/daily-basic-tests.txt @@ -555,7 +555,7 @@ args: -n Bug25554 T1 max-time: 3000 cmd: testNodeRestart -args: -n Bug25984 +args: -n Bug25984 T1 max-time: 1000 cmd: testNodeRestart From 93bf76997b2b0fb97ff736bb0bde93456156ff0c Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 11 Oct 2007 23:46:25 -0700 Subject: [PATCH 37/49] Fixed header to reflect the implementation. Added accessor method to help out the NDB/Connectors. storage/ndb/include/ndbapi/NdbOperation.hpp: Added accessor method to help out the NDB/Connectors. storage/ndb/include/ndbapi/NdbPool.hpp: Fixed header to reflect the implementation. storage/ndb/include/ndbapi/NdbScanFilter.hpp: Added accessor method to help out the NDB/Connectors. storage/ndb/include/ndbapi/NdbTransaction.hpp: Added accessor method to help out the NDB/Connectors. storage/ndb/src/ndbapi/NdbOperation.cpp: Added accessor method to help out the NDB/Connectors. storage/ndb/src/ndbapi/NdbScanFilter.cpp: Added accessor method to help out the NDB/Connectors. --- storage/ndb/include/ndbapi/NdbOperation.hpp | 3 +++ storage/ndb/include/ndbapi/NdbPool.hpp | 3 ++- storage/ndb/include/ndbapi/NdbScanFilter.hpp | 1 + storage/ndb/include/ndbapi/NdbTransaction.hpp | 7 +++++++ storage/ndb/src/ndbapi/NdbOperation.cpp | 6 ++++++ storage/ndb/src/ndbapi/NdbScanFilter.cpp | 4 ++++ 6 files changed, 23 insertions(+), 1 deletion(-) diff --git a/storage/ndb/include/ndbapi/NdbOperation.hpp b/storage/ndb/include/ndbapi/NdbOperation.hpp index 06111941df4..063b414e520 100644 --- a/storage/ndb/include/ndbapi/NdbOperation.hpp +++ b/storage/ndb/include/ndbapi/NdbOperation.hpp @@ -842,6 +842,9 @@ protected: virtual ~NdbOperation(); void next(NdbOperation*); // Set next pointer NdbOperation* next(); // Get next pointer + + NdbTransation* getNdbTransaction(); + public: #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL const NdbOperation* next() const; diff --git a/storage/ndb/include/ndbapi/NdbPool.hpp b/storage/ndb/include/ndbapi/NdbPool.hpp index 1963bf26448..44b6d7488f0 100644 --- a/storage/ndb/include/ndbapi/NdbPool.hpp +++ b/storage/ndb/include/ndbapi/NdbPool.hpp @@ -17,7 +17,8 @@ class Ndb; class NdbPool; bool -create_instance(Uint32 max_ndb_objects, +create_instance(Ndb_cluster_connection* cc, + Uint32 max_ndb_objects, Uint32 no_conn_obj, Uint32 init_no_ndb_objects); diff --git a/storage/ndb/include/ndbapi/NdbScanFilter.hpp b/storage/ndb/include/ndbapi/NdbScanFilter.hpp index 02fcb6215ba..35cbccedfe5 100644 --- a/storage/ndb/include/ndbapi/NdbScanFilter.hpp +++ b/storage/ndb/include/ndbapi/NdbScanFilter.hpp @@ -191,6 +191,7 @@ public: */ const class NdbError & getNdbError() const; + NdbOperation * getNdbOperation(); private: #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL friend class NdbScanFilterImpl; diff --git a/storage/ndb/include/ndbapi/NdbTransaction.hpp b/storage/ndb/include/ndbapi/NdbTransaction.hpp index 20c9c709e51..7a06b182647 100644 --- a/storage/ndb/include/ndbapi/NdbTransaction.hpp +++ b/storage/ndb/include/ndbapi/NdbTransaction.hpp @@ -170,6 +170,13 @@ public: #endif }; + /** + * Convenience method to fetch this transactions Ndb* object + */ + Ndb * getNdb() { + return theNdb; + } + #ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED /** * Get an NdbOperation for a table. diff --git a/storage/ndb/src/ndbapi/NdbOperation.cpp b/storage/ndb/src/ndbapi/NdbOperation.cpp index 50531292e40..ddaf5d0b233 100644 --- a/storage/ndb/src/ndbapi/NdbOperation.cpp +++ b/storage/ndb/src/ndbapi/NdbOperation.cpp @@ -429,3 +429,9 @@ NdbOperation::getTable() const { return m_currentTable; } + +NdbTransaction* +NdbOperation::getNdbTransaction() +{ + return theNdbCon; +} diff --git a/storage/ndb/src/ndbapi/NdbScanFilter.cpp b/storage/ndb/src/ndbapi/NdbScanFilter.cpp index 624122b5c55..4c052110040 100644 --- a/storage/ndb/src/ndbapi/NdbScanFilter.cpp +++ b/storage/ndb/src/ndbapi/NdbScanFilter.cpp @@ -348,6 +348,10 @@ NdbScanFilter::isfalse(){ return 0; } +NdbOperation * +NdbScanFilter::getNdbOperation(){ + return m_impl.m_operation; +} #define action(x, y, z) From 83323285d8d9054c722d81f18def412ca1f3d05f Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 12 Oct 2007 00:10:07 -0700 Subject: [PATCH 38/49] Added SKIP_INTERNAL wrappers to mark new methods as not part of the public API. --- storage/ndb/include/ndbapi/NdbOperation.hpp | 3 +-- storage/ndb/include/ndbapi/NdbScanFilter.hpp | 3 ++- storage/ndb/include/ndbapi/NdbTransaction.hpp | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/storage/ndb/include/ndbapi/NdbOperation.hpp b/storage/ndb/include/ndbapi/NdbOperation.hpp index 063b414e520..9b528ef4949 100644 --- a/storage/ndb/include/ndbapi/NdbOperation.hpp +++ b/storage/ndb/include/ndbapi/NdbOperation.hpp @@ -843,10 +843,9 @@ protected: void next(NdbOperation*); // Set next pointer NdbOperation* next(); // Get next pointer - NdbTransation* getNdbTransaction(); - public: #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL + NdbTransation* getNdbTransaction(); const NdbOperation* next() const; const NdbRecAttr* getFirstRecAttr() const; #endif diff --git a/storage/ndb/include/ndbapi/NdbScanFilter.hpp b/storage/ndb/include/ndbapi/NdbScanFilter.hpp index 35cbccedfe5..4527012a6c4 100644 --- a/storage/ndb/include/ndbapi/NdbScanFilter.hpp +++ b/storage/ndb/include/ndbapi/NdbScanFilter.hpp @@ -190,8 +190,9 @@ public: * immediately. */ const class NdbError & getNdbError() const; - +#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL NdbOperation * getNdbOperation(); +#endif private: #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL friend class NdbScanFilterImpl; diff --git a/storage/ndb/include/ndbapi/NdbTransaction.hpp b/storage/ndb/include/ndbapi/NdbTransaction.hpp index 7a06b182647..6a057655398 100644 --- a/storage/ndb/include/ndbapi/NdbTransaction.hpp +++ b/storage/ndb/include/ndbapi/NdbTransaction.hpp @@ -170,12 +170,14 @@ public: #endif }; +#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL /** - * Convenience method to fetch this transactions Ndb* object + * Convenience method to fetch this transaction's Ndb* object */ Ndb * getNdb() { return theNdb; } +#endif #ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED /** From f0e5987061b33864ffb4170591ed23dce8aa91ff Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 12 Oct 2007 01:16:55 -0700 Subject: [PATCH 39/49] Fixed a typo. We have NdbTransactions not NdbTransations. --- storage/ndb/include/ndbapi/NdbOperation.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/ndb/include/ndbapi/NdbOperation.hpp b/storage/ndb/include/ndbapi/NdbOperation.hpp index 9b528ef4949..2f899d5b4bd 100644 --- a/storage/ndb/include/ndbapi/NdbOperation.hpp +++ b/storage/ndb/include/ndbapi/NdbOperation.hpp @@ -845,7 +845,7 @@ protected: public: #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL - NdbTransation* getNdbTransaction(); + NdbTransaction* getNdbTransaction(); const NdbOperation* next() const; const NdbRecAttr* getFirstRecAttr() const; #endif From eff940c7314fc72134cbfcafdb1e14040b99c8a9 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 14 Oct 2007 16:17:39 +0200 Subject: [PATCH 40/49] ndb - bug#29390: fix mem leak introduced in previous cset ndb/src/ndbapi/NdbScanFilter.cpp: fix mem leak on discarded scanfilter --- ndb/src/ndbapi/NdbScanFilter.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/ndb/src/ndbapi/NdbScanFilter.cpp b/ndb/src/ndbapi/NdbScanFilter.cpp index 624122b5c55..58e9f180119 100644 --- a/ndb/src/ndbapi/NdbScanFilter.cpp +++ b/ndb/src/ndbapi/NdbScanFilter.cpp @@ -22,6 +22,7 @@ #include #include #include "NdbApiSignal.hpp" +#include "NdbUtil.hpp" #ifdef VM_TRACE #include @@ -621,12 +622,43 @@ NdbScanFilterImpl::handle_filter_too_large() op->theStatus = m_initial_op_status; // reset interpreter state to initial + + NdbBranch* tBranch = op->theFirstBranch; + while (tBranch != NULL) { + NdbBranch* tmp = tBranch; + tBranch = tBranch->theNext; + op->theNdb->releaseNdbBranch(tmp); + } op->theFirstBranch = NULL; op->theLastBranch = NULL; + + NdbLabel* tLabel = op->theFirstLabel; + while (tLabel != NULL) { + NdbLabel* tmp = tLabel; + tLabel = tLabel->theNext; + op->theNdb->releaseNdbLabel(tmp); + } + op->theFirstLabel = NULL; + op->theLastLabel = NULL; + + NdbCall* tCall = op->theFirstCall; + while (tCall != NULL) { + NdbCall* tmp = tCall; + tCall = tCall->theNext; + op->theNdb->releaseNdbCall(tmp); + } op->theFirstCall = NULL; op->theLastCall = NULL; + + NdbSubroutine* tSubroutine = op->theFirstSubroutine; + while (tSubroutine != NULL) { + NdbSubroutine* tmp = tSubroutine; + tSubroutine = tSubroutine->theNext; + op->theNdb->releaseNdbSubroutine(tmp); + } op->theFirstSubroutine = NULL; op->theLastSubroutine = NULL; + op->theNoOfLabels = 0; op->theNoOfSubroutines = 0; From 4815760bd85c48e87cadbb084b9d167c19c571ba Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 14 Oct 2007 18:42:49 +0200 Subject: [PATCH 41/49] ndb - testScan -n InsertDelete fix testcase storage/ndb/test/ndbapi/testScan.cpp: fix testcase --- storage/ndb/test/ndbapi/testScan.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/ndb/test/ndbapi/testScan.cpp b/storage/ndb/test/ndbapi/testScan.cpp index 2561869fa5f..df6dbe2e550 100644 --- a/storage/ndb/test/ndbapi/testScan.cpp +++ b/storage/ndb/test/ndbapi/testScan.cpp @@ -579,7 +579,7 @@ int runScanUpdateUntilStopped(NDBT_Context* ctx, NDBT_Step* step){ para = myRandom48(239)+1; g_info << i << ": "; - if (hugoTrans.scanUpdateRecords(GETNDB(step), records, 0, para) == NDBT_FAILED){ + if (hugoTrans.scanUpdateRecords(GETNDB(step), 0, 0, para) == NDBT_FAILED){ return NDBT_FAILED; } i++; From 007e29e2bc04ab78dd1abc7240b5c22731d598d3 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 15 Oct 2007 09:10:14 +0200 Subject: [PATCH 42/49] ndb - bug#31482 (re)impl. simple-read (read that releases lock just before LQHKEYCONF) use simple-read for blobs storage/ndb/include/kernel/signaldata/TcKeyConf.hpp: rename bit storage/ndb/include/ndbapi/NdbOperation.hpp: add new lock-mode storage/ndb/src/common/debugger/signaldata/TcKeyConf.cpp: rename bit storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp: remove aggregate storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp: impl. simple-read = normal read + release lock just before LQHKEYCONF storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp: impl. simple-read = normal read + release lock just before LQHKEYCONF storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp: impl. simple-read = normal read + release lock just before LQHKEYCONF storage/ndb/src/ndbapi/NdbBlob.cpp: use simple read for blobs storage/ndb/src/ndbapi/NdbIndexOperation.cpp: no simple-read for ui (yet) storage/ndb/src/ndbapi/NdbOperationDefine.cpp: impl. simple-read storage/ndb/src/ndbapi/NdbOperationExec.cpp: impl. simple-read storage/ndb/src/ndbapi/NdbReceiver.cpp: impl. simple-read storage/ndb/src/ndbapi/NdbScanOperation.cpp: no simple-read for scan (yet) storage/ndb/src/ndbapi/NdbTransaction.cpp: rename bit storage/ndb/test/ndbapi/testBasic.cpp: add testcase for simlpe-read storage/ndb/test/run-test/daily-basic-tests.txt: add testcase storage/ndb/test/src/HugoOperations.cpp: add simple-read --- .../include/kernel/signaldata/TcKeyConf.hpp | 2 +- storage/ndb/include/ndbapi/NdbOperation.hpp | 3 +- .../common/debugger/signaldata/TcKeyConf.cpp | 4 +- storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp | 1 - .../ndb/src/kernel/blocks/dblqh/DblqhMain.cpp | 76 ++++--- storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp | 12 +- .../ndb/src/kernel/blocks/dbtc/DbtcMain.cpp | 199 ++++++++++-------- storage/ndb/src/ndbapi/NdbBlob.cpp | 2 +- storage/ndb/src/ndbapi/NdbIndexOperation.cpp | 3 + storage/ndb/src/ndbapi/NdbOperationDefine.cpp | 62 +++--- storage/ndb/src/ndbapi/NdbOperationExec.cpp | 17 +- storage/ndb/src/ndbapi/NdbReceiver.cpp | 2 +- storage/ndb/src/ndbapi/NdbScanOperation.cpp | 1 + storage/ndb/src/ndbapi/NdbTransaction.cpp | 6 +- storage/ndb/test/ndbapi/testBasic.cpp | 35 ++- .../ndb/test/run-test/daily-basic-tests.txt | 8 + storage/ndb/test/src/HugoOperations.cpp | 1 + 17 files changed, 236 insertions(+), 198 deletions(-) diff --git a/storage/ndb/include/kernel/signaldata/TcKeyConf.hpp b/storage/ndb/include/kernel/signaldata/TcKeyConf.hpp index b8562875ef5..fd8932c3c87 100644 --- a/storage/ndb/include/kernel/signaldata/TcKeyConf.hpp +++ b/storage/ndb/include/kernel/signaldata/TcKeyConf.hpp @@ -46,7 +46,7 @@ public: */ STATIC_CONST( StaticLength = 5 ); STATIC_CONST( OperationLength = 2 ); - STATIC_CONST( SimpleReadBit = (((Uint32)1) << 31) ); + STATIC_CONST( DirtyReadBit = (((Uint32)1) << 31) ); private: diff --git a/storage/ndb/include/ndbapi/NdbOperation.hpp b/storage/ndb/include/ndbapi/NdbOperation.hpp index 06111941df4..a927df521a9 100644 --- a/storage/ndb/include/ndbapi/NdbOperation.hpp +++ b/storage/ndb/include/ndbapi/NdbOperation.hpp @@ -93,8 +93,9 @@ public: ,LM_CommittedRead ///< Ignore locks, read last committed value #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL = 2, - LM_Dirty = 2 + LM_Dirty = 2, #endif + LM_SimpleRead = 3 ///< Read with shared lock, but release lock directly }; /** diff --git a/storage/ndb/src/common/debugger/signaldata/TcKeyConf.cpp b/storage/ndb/src/common/debugger/signaldata/TcKeyConf.cpp index 65589f8cd6e..377863f9446 100644 --- a/storage/ndb/src/common/debugger/signaldata/TcKeyConf.cpp +++ b/storage/ndb/src/common/debugger/signaldata/TcKeyConf.cpp @@ -51,11 +51,11 @@ printTCKEYCONF(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receive (TcKeyConf::getMarkerFlag(confInfo) == 0)?"false":"true"); fprintf(output, "Operations:\n"); for(i = 0; i < noOfOp; i++) { - if(sig->operations[i].attrInfoLen > TcKeyConf::SimpleReadBit) + if(sig->operations[i].attrInfoLen > TcKeyConf::DirtyReadBit) fprintf(output, " apiOperationPtr: H'%.8x, simplereadnode: %u\n", sig->operations[i].apiOperationPtr, - sig->operations[i].attrInfoLen & (~TcKeyConf::SimpleReadBit)); + sig->operations[i].attrInfoLen & (~TcKeyConf::DirtyReadBit)); else fprintf(output, " apiOperationPtr: H'%.8x, attrInfoLen: %u\n", diff --git a/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp b/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp index 6f8e5569831..1bed25fb5a8 100644 --- a/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp +++ b/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp @@ -2025,7 +2025,6 @@ public: Uint8 reclenAiLqhkey; Uint8 m_offset_current_keybuf; Uint8 replicaType; - Uint8 simpleRead; Uint8 seqNoReplica; Uint8 tcNodeFailrec; Uint8 m_disk_table; diff --git a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp index 43d49e791be..f511e00afaa 100644 --- a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp +++ b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp @@ -3496,7 +3496,6 @@ void Dblqh::execLQHKEYREQ(Signal* signal) regTcPtr->dirtyOp = LqhKeyReq::getDirtyFlag(Treqinfo); regTcPtr->opExec = LqhKeyReq::getInterpretedFlag(Treqinfo); regTcPtr->opSimple = LqhKeyReq::getSimpleFlag(Treqinfo); - regTcPtr->simpleRead = op == ZREAD && regTcPtr->opSimple; regTcPtr->seqNoReplica = LqhKeyReq::getSeqNoReplica(Treqinfo); UintR TreclenAiLqhkey = LqhKeyReq::getAIInLqhKeyReq(Treqinfo); regTcPtr->apiVersionNo = 0; @@ -3513,9 +3512,15 @@ void Dblqh::execLQHKEYREQ(Signal* signal) regTcPtr->lockType = op == ZREAD_EX ? ZUPDATE : (Operation_t) op == ZWRITE ? ZINSERT : (Operation_t) op; } + + if (regTcPtr->dirtyOp) + { + ndbrequire(regTcPtr->opSimple); + } - CRASH_INSERTION2(5041, regTcPtr->simpleRead && - refToNode(signal->senderBlockRef()) != cownNodeid); + CRASH_INSERTION2(5041, (op == ZREAD && + (regTcPtr->opSimple || regTcPtr->dirtyOp) && + refToNode(signal->senderBlockRef()) != cownNodeid)); regTcPtr->reclenAiLqhkey = TreclenAiLqhkey; regTcPtr->currReclenAi = TreclenAiLqhkey; @@ -3687,8 +3692,8 @@ void Dblqh::execLQHKEYREQ(Signal* signal) Uint8 TdistKey = LqhKeyReq::getDistributionKey(TtotReclenAi); if ((tfragDistKey != TdistKey) && (regTcPtr->seqNoReplica == 0) && - (regTcPtr->dirtyOp == ZFALSE) && - (regTcPtr->simpleRead == ZFALSE)) { + (regTcPtr->dirtyOp == ZFALSE)) + { /* ---------------------------------------------------------------------- * WE HAVE DIFFERENT OPINION THAN THE DIH THAT STARTED THE TRANSACTION. * THE REASON COULD BE THAT THIS IS AN OLD DISTRIBUTION WHICH IS NO LONGER @@ -4778,7 +4783,18 @@ void Dblqh::tupkeyConfLab(Signal* signal) TRACE_OP(regTcPtr, "TUPKEYCONF"); - if (regTcPtr->simpleRead) { + if (readLen != 0) + { + jam(); + + /* SET BIT 15 IN REQINFO */ + LqhKeyReq::setApplicationAddressFlag(regTcPtr->reqinfo, 1); + regTcPtr->readlenAi = readLen; + }//if + + if (regTcPtr->operation == ZREAD && + (regTcPtr->opSimple || regTcPtr->dirtyOp)) + { jam(); /* ---------------------------------------------------------------------- * THE OPERATION IS A SIMPLE READ. @@ -4792,14 +4808,6 @@ void Dblqh::tupkeyConfLab(Signal* signal) commitContinueAfterBlockedLab(signal); return; }//if - if (readLen != 0) - { - jam(); - - /* SET BIT 15 IN REQINFO */ - LqhKeyReq::setApplicationAddressFlag(regTcPtr->reqinfo, 1); - regTcPtr->readlenAi = readLen; - }//if regTcPtr->totSendlenAi = writeLen; ndbrequire(regTcPtr->totSendlenAi == regTcPtr->currTupAiLen); @@ -5178,12 +5186,15 @@ void Dblqh::packLqhkeyreqLab(Signal* signal) /* */ /* ------------------------------------------------------------------------- */ sendLqhkeyconfTc(signal, regTcPtr->tcBlockref); - if (regTcPtr->dirtyOp != ZTRUE) { + if (! (regTcPtr->dirtyOp || + (regTcPtr->operation == ZREAD && regTcPtr->opSimple))) + { jam(); regTcPtr->transactionState = TcConnectionrec::PREPARED; releaseOprec(signal); } else { jam(); + /*************************************************************>*/ /* DIRTY WRITES ARE USED IN TWO SITUATIONS. THE FIRST */ /* SITUATION IS WHEN THEY ARE USED TO UPDATE COUNTERS AND*/ @@ -6406,8 +6417,8 @@ void Dblqh::commitContinueAfterBlockedLab(Signal* signal) Ptr regTcPtr = tcConnectptr; Ptr regFragptr = fragptr; Uint32 operation = regTcPtr.p->operation; - Uint32 simpleRead = regTcPtr.p->simpleRead; Uint32 dirtyOp = regTcPtr.p->dirtyOp; + Uint32 opSimple = regTcPtr.p->opSimple; if (regTcPtr.p->activeCreat != Fragrecord::AC_IGNORED) { if (operation != ZREAD) { TupCommitReq * const tupCommitReq = @@ -6465,20 +6476,29 @@ void Dblqh::commitContinueAfterBlockedLab(Signal* signal) EXECUTE_DIRECT(acc, GSN_ACC_COMMITREQ, signal, 1); } - if (simpleRead) { + if (dirtyOp) + { jam(); -/* ------------------------------------------------------------------------- */ -/*THE OPERATION WAS A SIMPLE READ THUS THE COMMIT PHASE IS ONLY NEEDED TO */ -/*RELEASE THE LOCKS. AT THIS POINT IN THE CODE THE LOCKS ARE RELEASED AND WE */ -/*ARE IN A POSITION TO SEND LQHKEYCONF TO TC. WE WILL ALSO RELEASE ALL */ -/*RESOURCES BELONGING TO THIS OPERATION SINCE NO MORE WORK WILL BE */ -/*PERFORMED. */ -/* ------------------------------------------------------------------------- */ + /** + * The dirtyRead does not send anything but TRANSID_AI from LDM + */ fragptr = regFragptr; tcConnectptr = regTcPtr; cleanUp(signal); return; - }//if + } + + /** + * The simpleRead will send a LQHKEYCONF + * but have already released the locks + */ + if (opSimple) + { + fragptr = regFragptr; + tcConnectptr = regTcPtr; + packLqhkeyreqLab(signal); + return; + } } }//if jamEntry(); @@ -7088,7 +7108,7 @@ void Dblqh::abortStateHandlerLab(Signal* signal) /* ------------------------------------------------------------------------- */ return; }//if - if (regTcPtr->simpleRead) { + if (regTcPtr->opSimple) { jam(); /* ------------------------------------------------------------------------- */ /*A SIMPLE READ IS CURRENTLY RELEASING THE LOCKS OR WAITING FOR ACCESS TO */ @@ -7356,7 +7376,8 @@ void Dblqh::continueAbortLab(Signal* signal) void Dblqh::continueAfterLogAbortWriteLab(Signal* signal) { TcConnectionrec * const regTcPtr = tcConnectptr.p; - if (regTcPtr->simpleRead) { + if (regTcPtr->operation == ZREAD && regTcPtr->dirtyOp) + { jam(); TcKeyRef * const tcKeyRef = (TcKeyRef *) signal->getDataPtrSend(); @@ -19027,7 +19048,6 @@ Dblqh::execDUMP_STATE_ORD(Signal* signal) ndbout << " operation = " << tcRec.p->operation<getProperty("LockMode", NdbOperation::LM_Read); int i = 0; HugoTransactions hugoTrans(*ctx->getTab()); while (igetNumLoops(); - int records = ctx->getNumRecords(); - int batchSize = ctx->getProperty("BatchSize", 1); - int i = 0; - bool dirty = true; - HugoTransactions hugoTrans(*ctx->getTab()); - while (igetType() == NdbDictionary::Index::OrderedIndex && pIndexScanOp == 0) { From 67b31b0fdbcd6c38cf4185ff50c4f735e1cd1eb7 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 15 Oct 2007 09:17:15 +0200 Subject: [PATCH 43/49] ndb - reenable disabled testcases ndb_load ndb_dd_sql_features mysql-test/suite/ndb/t/disabled.def: reenable disabled testcases --- mysql-test/suite/ndb/t/disabled.def | 3 --- 1 file changed, 3 deletions(-) diff --git a/mysql-test/suite/ndb/t/disabled.def b/mysql-test/suite/ndb/t/disabled.def index 9c2dc80d5ee..f876039a042 100644 --- a/mysql-test/suite/ndb/t/disabled.def +++ b/mysql-test/suite/ndb/t/disabled.def @@ -9,9 +9,6 @@ # Do not use any TAB characters for whitespace. # ############################################################################## -ndb_dd_sql_features : Bug#29102 ndb_dd_sql_features fails in pushbuild -ndb_load : BUG#17233 2006-05-04 tomas failed load data from infile causes mysqld dbug_assert, binlog not flushed - partition_03ndb : BUG#16385 2006-03-24 mikael Partitions: crash when updating a range partitioned NDB table ndb_partition_error2 : HF is not sure if the test can work as internded on all the platforms From 78951216ff29b017e3cb98ecb34c954090beb020 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 18 Oct 2007 23:21:18 +0200 Subject: [PATCH 44/49] ndb - bug#31701 Node failure with repl. wo/ load, can lead to endless out of order buckets Correct check for buffer/no buffer storage/ndb/src/kernel/blocks/ERROR_codes.txt: new error code storage/ndb/src/kernel/blocks/suma/Suma.cpp: correct check for buffer/no buffer storage/ndb/test/ndbapi/test_event.cpp: test prg storage/ndb/test/run-test/daily-basic-tests.txt: test prg --- storage/ndb/src/kernel/blocks/ERROR_codes.txt | 2 +- storage/ndb/src/kernel/blocks/suma/Suma.cpp | 6 +- storage/ndb/test/ndbapi/test_event.cpp | 88 +++++++++++++++++++ .../ndb/test/run-test/daily-basic-tests.txt | 4 + 4 files changed, 97 insertions(+), 3 deletions(-) diff --git a/storage/ndb/src/kernel/blocks/ERROR_codes.txt b/storage/ndb/src/kernel/blocks/ERROR_codes.txt index deea98fc3a6..b58eeb730f3 100644 --- a/storage/ndb/src/kernel/blocks/ERROR_codes.txt +++ b/storage/ndb/src/kernel/blocks/ERROR_codes.txt @@ -11,7 +11,7 @@ Next CMVMI 9000 Next BACKUP 10038 Next DBUTIL 11002 Next DBTUX 12008 -Next SUMA 13001 +Next SUMA 13034 TESTING NODE FAILURE, ARBITRATION --------------------------------- diff --git a/storage/ndb/src/kernel/blocks/suma/Suma.cpp b/storage/ndb/src/kernel/blocks/suma/Suma.cpp index 717448ca03b..94df9a2b32e 100644 --- a/storage/ndb/src/kernel/blocks/suma/Suma.cpp +++ b/storage/ndb/src/kernel/blocks/suma/Suma.cpp @@ -3650,6 +3650,8 @@ Suma::execSUB_GCP_COMPLETE_REP(Signal* signal) if(m_gcp_complete_rep_count && !c_subscriber_nodes.isclear()) { + CRASH_INSERTION(13033); + NodeReceiverGroup rg(API_CLUSTERMGR, c_subscriber_nodes); sendSignal(rg, GSN_SUB_GCP_COMPLETE_REP, signal, SubGcpCompleteRep::SignalLength, JBB); @@ -3669,8 +3671,8 @@ Suma::execSUB_GCP_COMPLETE_REP(Signal* signal) { if(m_active_buckets.get(i)) continue; - - if(c_buckets[i].m_buffer_tail != RNIL) + + if (!c_subscriber_nodes.isclear()) { //Uint32* dst; get_buffer_ptr(signal, i, gci, 0); diff --git a/storage/ndb/test/ndbapi/test_event.cpp b/storage/ndb/test/ndbapi/test_event.cpp index 2083e235a3e..18825d734a4 100644 --- a/storage/ndb/test/ndbapi/test_event.cpp +++ b/storage/ndb/test/ndbapi/test_event.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #define GETNDB(ps) ((NDBT_NdbApiStep*)ps)->getNdb() @@ -1758,6 +1759,85 @@ runInsertDeleteUntilStopped(NDBT_Context* ctx, NDBT_Step* step) return NDBT_OK; } +int +runBug31701(NDBT_Context* ctx, NDBT_Step* step) +{ + int result = NDBT_OK; + + NdbRestarter restarter; + + if (restarter.getNumDbNodes() < 2){ + ctx->stopTest(); + return NDBT_OK; + } + // This should really wait for applier to start...10s is likely enough + NdbSleep_SecSleep(10); + + int nodeId = restarter.getDbNodeId(rand() % restarter.getNumDbNodes()); + + int val2[] = { DumpStateOrd::CmvmiSetRestartOnErrorInsert, 1 }; + if (restarter.dumpStateOneNode(nodeId, val2, 2)) + return NDBT_FAILED; + + restarter.insertErrorInNode(nodeId, 13033); + if (restarter.waitNodesNoStart(&nodeId, 1)) + return NDBT_FAILED; + + if (restarter.startNodes(&nodeId, 1)) + return NDBT_FAILED; + + if (restarter.waitClusterStarted()) + return NDBT_FAILED; + + + int records = ctx->getNumRecords(); + HugoTransactions hugoTrans(*ctx->getTab()); + + if(ctx->getPropertyWait("LastGCI", ~(Uint32)0)) + { + g_err << "FAIL " << __LINE__ << endl; + return NDBT_FAILED; + } + + hugoTrans.clearTable(GETNDB(step), 0); + + if (hugoTrans.loadTable(GETNDB(step), 3*records, 1, true, 1) != 0){ + g_err << "FAIL " << __LINE__ << endl; + return NDBT_FAILED; + } + + if (hugoTrans.pkDelRecords(GETNDB(step), 3*records, 1, true, 1) != 0){ + g_err << "FAIL " << __LINE__ << endl; + return NDBT_FAILED; + } + if (hugoTrans.loadTable(GETNDB(step), records, 1, true, 1) != 0){ + g_err << "FAIL " << __LINE__ << endl; + return NDBT_FAILED; + } + if (hugoTrans.pkUpdateRecords(GETNDB(step), records, 1, 1) != 0){ + g_err << "FAIL " << __LINE__ << endl; + return NDBT_FAILED; + } + if (hugoTrans.pkUpdateRecords(GETNDB(step), records, 1, 1) != 0){ + g_err << "FAIL " << __LINE__ << endl; + return NDBT_FAILED; + } + if (hugoTrans.pkUpdateRecords(GETNDB(step), records, 1, 1) != 0){ + g_err << "FAIL " << __LINE__ << endl; + return NDBT_FAILED; + } + + ctx->setProperty("LastGCI", hugoTrans.m_latest_gci); + if(ctx->getPropertyWait("LastGCI", ~(Uint32)0)) + { + g_err << "FAIL " << __LINE__ << endl; + return NDBT_FAILED; + } + + ctx->stopTest(); + return NDBT_OK; +} + NDBT_TESTSUITE(test_event); TESTCASE("BasicEventOperation", "Verify that we can listen to Events" @@ -1887,6 +1967,14 @@ TESTCASE("Bug27169", ""){ STEP(runRestarterLoop); FINALIZER(runDropEvent); } +TESTCASE("Bug31701", ""){ + INITIALIZER(runCreateEvent); + INITIALIZER(runCreateShadowTable); + STEP(runEventApplier); + STEP(runBug31701); + FINALIZER(runDropEvent); + FINALIZER(runDropShadowTable); +} NDBT_TESTSUITE_END(test_event); int main(int argc, const char** argv){ diff --git a/storage/ndb/test/run-test/daily-basic-tests.txt b/storage/ndb/test/run-test/daily-basic-tests.txt index da588430e80..ef5082ca30c 100644 --- a/storage/ndb/test/run-test/daily-basic-tests.txt +++ b/storage/ndb/test/run-test/daily-basic-tests.txt @@ -938,3 +938,7 @@ max-time: 600 cmd: testNodeRestart args: -n Bug31525 T1 +max-time: 300 +cmd: test_event +args: -n Bug31701 T1 + From c61548f18cdd4cbf232c77ed4f7e5d6845752059 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 23 Oct 2007 11:24:34 +0200 Subject: [PATCH 45/49] ndb - bug#26450 partial backport from 6.2 + add fix of bug storage/ndb/include/kernel/GlobalSignalNumbers.h: add prep_copy_frag storage/ndb/include/kernel/signaldata/AccScan.hpp: add new argument specifying which page to scan to storage/ndb/include/kernel/signaldata/CopyFrag.hpp: add new argument specifying which page to scan to storage/ndb/include/ndb_version.h.in: add versioning checks for prep_copy_frag storage/ndb/src/common/debugger/signaldata/SignalNames.cpp: add prep_copy_frag storage/ndb/src/kernel/blocks/ERROR_codes.txt: new error codes storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp: add new to-step storage/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp: add new to-step storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp: add new to-step storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp: add new to-step storage/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp: add new to-step storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp: add new to-step storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp: add new argument specifying which page to scan to storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp: add utility to get max page used by fragment storage/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp: add NR scan to > frag.noOfPages storage/ndb/test/ndbapi/testSystemRestart.cpp: add testcase storage/ndb/test/run-test/daily-basic-tests.txt: add testcase storage/ndb/test/src/NdbRestarts.cpp: add testcase --- .../ndb/include/kernel/GlobalSignalNumbers.h | 8 +- .../ndb/include/kernel/signaldata/AccScan.hpp | 1 + .../include/kernel/signaldata/CopyFrag.hpp | 41 ++++++- storage/ndb/include/ndb_version.h.in | 47 ++++++++ .../debugger/signaldata/SignalNames.cpp | 4 + storage/ndb/src/kernel/blocks/ERROR_codes.txt | 4 +- storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp | 7 +- .../ndb/src/kernel/blocks/dbdih/DbdihInit.cpp | 5 + .../ndb/src/kernel/blocks/dbdih/DbdihMain.cpp | 111 +++++++++++++++++- storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp | 1 + .../ndb/src/kernel/blocks/dblqh/DblqhInit.cpp | 3 + .../ndb/src/kernel/blocks/dblqh/DblqhMain.cpp | 93 ++++++++++++++- storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp | 3 + .../ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp | 19 +++ .../ndb/src/kernel/blocks/dbtup/DbtupScan.cpp | 68 +++++++++-- storage/ndb/test/ndbapi/testSystemRestart.cpp | 54 +++++++++ .../ndb/test/run-test/daily-basic-tests.txt | 4 + storage/ndb/test/src/NdbRestarts.cpp | 1 + 18 files changed, 452 insertions(+), 22 deletions(-) diff --git a/storage/ndb/include/kernel/GlobalSignalNumbers.h b/storage/ndb/include/kernel/GlobalSignalNumbers.h index aa0596f102a..9653c20260f 100644 --- a/storage/ndb/include/kernel/GlobalSignalNumbers.h +++ b/storage/ndb/include/kernel/GlobalSignalNumbers.h @@ -195,9 +195,11 @@ extern const GlobalSignalNumber NO_OF_SIGNAL_NAMES; /* 132 not unused */ /* 133 not unused */ #define GSN_CM_HEARTBEAT 134 /* distr. */ -/* 135 unused */ -/* 136 unused */ -/* 137 unused */ + +#define GSN_PREPARE_COPY_FRAG_REQ 135 +#define GSN_PREPARE_COPY_FRAG_REF 136 +#define GSN_PREPARE_COPY_FRAG_CONF 137 + #define GSN_CM_NODEINFOCONF 138 /* distr. */ #define GSN_CM_NODEINFOREF 139 /* distr. */ #define GSN_CM_NODEINFOREQ 140 /* distr. */ diff --git a/storage/ndb/include/kernel/signaldata/AccScan.hpp b/storage/ndb/include/kernel/signaldata/AccScan.hpp index 73d69825069..a0aa38c8d8e 100644 --- a/storage/ndb/include/kernel/signaldata/AccScan.hpp +++ b/storage/ndb/include/kernel/signaldata/AccScan.hpp @@ -49,6 +49,7 @@ private: Uint32 savePointId; Uint32 gci; }; + Uint32 maxPage; /** * Previously there where also a scan type diff --git a/storage/ndb/include/kernel/signaldata/CopyFrag.hpp b/storage/ndb/include/kernel/signaldata/CopyFrag.hpp index 06dd4070264..d985358dce4 100644 --- a/storage/ndb/include/kernel/signaldata/CopyFrag.hpp +++ b/storage/ndb/include/kernel/signaldata/CopyFrag.hpp @@ -29,7 +29,7 @@ class CopyFragReq { */ friend class Dblqh; public: - STATIC_CONST( SignalLength = 9 ); + STATIC_CONST( SignalLength = 10 ); private: Uint32 userPtr; @@ -42,6 +42,7 @@ private: Uint32 gci; Uint32 nodeCount; Uint32 nodeList[1]; + //Uint32 maxPage; is stored in nodeList[nodeCount] }; class CopyFragConf { @@ -95,4 +96,42 @@ struct UpdateFragDistKeyOrd STATIC_CONST( SignalLength = 3 ); }; +struct PrepareCopyFragReq +{ + STATIC_CONST( SignalLength = 6 ); + + Uint32 senderRef; + Uint32 senderData; + Uint32 tableId; + Uint32 fragId; + Uint32 copyNodeId; + Uint32 startingNodeId; +}; + +struct PrepareCopyFragRef +{ + Uint32 senderRef; + Uint32 senderData; + Uint32 tableId; + Uint32 fragId; + Uint32 copyNodeId; + Uint32 startingNodeId; + Uint32 errorCode; + + STATIC_CONST( SignalLength = 7 ); +}; + +struct PrepareCopyFragConf +{ + STATIC_CONST( SignalLength = 7 ); + + Uint32 senderRef; + Uint32 senderData; + Uint32 tableId; + Uint32 fragId; + Uint32 copyNodeId; + Uint32 startingNodeId; + Uint32 maxPageNo; +}; + #endif diff --git a/storage/ndb/include/ndb_version.h.in b/storage/ndb/include/ndb_version.h.in index 5405ad4d7aa..6a479433b3b 100644 --- a/storage/ndb/include/ndb_version.h.in +++ b/storage/ndb/include/ndb_version.h.in @@ -88,5 +88,52 @@ Uint32 ndbGetOwnVersion(); #define NDBD_NODE_VERSION_REP NDB_MAKE_VERSION(6,1,1) +#define NDBD_PREPARE_COPY_FRAG_VERSION NDB_MAKE_VERSION(6,2,1) +#define NDBD_PREPARE_COPY_FRAG_V2_51 NDB_MAKE_VERSION(5,1,23) +#define NDBD_PREPARE_COPY_FRAG_V2_62 NDB_MAKE_VERSION(6,2,8) +#define NDBD_PREPARE_COPY_FRAG_V2_63 NDB_MAKE_VERSION(6,3,6) + +/** + * 0 = NO PREP COPY FRAG SUPPORT + * 1 = NO MAX PAGE SUPPORT + * 2 = LATEST VERSION + */ +static +inline +int +ndb_check_prep_copy_frag_version(Uint32 version) +{ + if (version == NDB_VERSION_D) + return 2; + + const Uint32 major = (version >> 16) & 0xFF; + const Uint32 minor = (version >> 8) & 0xFF; + if (major >= 6) + { + if (minor == 2) + { + if (version >= NDBD_PREPARE_COPY_FRAG_V2_62) + return 2; + if (version >= NDBD_PREPARE_COPY_FRAG_VERSION) + return 1; + return 0; + } + else if (minor == 3) + { + if (version >= NDBD_PREPARE_COPY_FRAG_V2_63) + return 2; + return 1; + } + return 2; + } + else if (major == 5 && minor == 1) + { + if (version >= NDBD_PREPARE_COPY_FRAG_V2_51) + return 2; + } + + return 0; +} + #endif diff --git a/storage/ndb/src/common/debugger/signaldata/SignalNames.cpp b/storage/ndb/src/common/debugger/signaldata/SignalNames.cpp index 0d31cd5de7f..b4221cbec8e 100644 --- a/storage/ndb/src/common/debugger/signaldata/SignalNames.cpp +++ b/storage/ndb/src/common/debugger/signaldata/SignalNames.cpp @@ -640,5 +640,9 @@ const GsnName SignalNames [] = { ,{ GSN_ROUTE_ORD, "ROUTE_ORD" } ,{ GSN_NODE_VERSION_REP, "NODE_VERSION_REP" } + + ,{ GSN_PREPARE_COPY_FRAG_REQ, "PREPARE_COPY_FRAG_REQ" } + ,{ GSN_PREPARE_COPY_FRAG_REF, "PREPARE_COPY_FRAG_REF" } + ,{ GSN_PREPARE_COPY_FRAG_CONF, "PREPARE_COPY_FRAG_CONF" } }; const unsigned short NO_OF_SIGNAL_NAMES = sizeof(SignalNames)/sizeof(GsnName); diff --git a/storage/ndb/src/kernel/blocks/ERROR_codes.txt b/storage/ndb/src/kernel/blocks/ERROR_codes.txt index 5317d0e5c86..4d4d4fcafc4 100644 --- a/storage/ndb/src/kernel/blocks/ERROR_codes.txt +++ b/storage/ndb/src/kernel/blocks/ERROR_codes.txt @@ -3,7 +3,7 @@ Next NDBCNTR 1002 Next NDBFS 2000 Next DBACC 3002 Next DBTUP 4029 -Next DBLQH 5045 +Next DBLQH 5047 Next DBDICT 6008 Next DBDIH 7193 Next DBTC 8054 @@ -186,6 +186,8 @@ handling in DBTC to ensure that node failures are also well handled in time-out handling. They can also be used to test multiple node failure handling. +5045: Crash in PREPARE_COPY_FRAG_REQ +5046: Crash if LQHKEYREQ (NrCopy) comes when frag-state is incorrect ERROR CODES FOR TESTING TIME-OUT HANDLING IN DBLQH ------------------------------------------------- diff --git a/storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp b/storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp index 1177500bc27..21826df28f9 100644 --- a/storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp +++ b/storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp @@ -545,7 +545,8 @@ public: TO_WAIT_ENDING = 21, ENDING = 22, - STARTING_LOCAL_FRAGMENTS = 24 + STARTING_LOCAL_FRAGMENTS = 24, + PREPARE_COPY = 25 }; enum ToSlaveStatus { TO_SLAVE_IDLE = 0, @@ -556,6 +557,7 @@ public: TO_SLAVE_COPY_COMPLETED = 5 }; Uint32 startGci; + Uint32 maxPage; Uint32 toCopyNode; Uint32 toCurrentFragid; Uint32 toCurrentReplica; @@ -672,6 +674,8 @@ private: void execNODE_FAILREP(Signal *); void execCOPY_FRAGCONF(Signal *); void execCOPY_FRAGREF(Signal *); + void execPREPARE_COPY_FRAG_REF(Signal*); + void execPREPARE_COPY_FRAG_CONF(Signal*); void execDIADDTABREQ(Signal *); void execDIGETNODESREQ(Signal *); void execDIRELEASEREQ(Signal *); @@ -1114,6 +1118,7 @@ private: void sendStartTo(Signal *, Uint32 takeOverPtr); void startNextCopyFragment(Signal *, Uint32 takeOverPtr); void toCopyFragLab(Signal *, Uint32 takeOverPtr); + void toStartCopyFrag(Signal *, TakeOverRecordPtr); void startHsAddFragConfLab(Signal *); void prepareSendCreateFragReq(Signal *, Uint32 takeOverPtr); void sendUpdateTo(Signal *, Uint32 takeOverPtr, Uint32 updateState); diff --git a/storage/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp b/storage/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp index aff31d625f4..6ce281434c2 100644 --- a/storage/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp +++ b/storage/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp @@ -259,6 +259,11 @@ Dbdih::Dbdih(Block_context& ctx): addRecSignal(GSN_START_FRAGREF, &Dbdih::execSTART_FRAGREF); + + addRecSignal(GSN_PREPARE_COPY_FRAG_REF, + &Dbdih::execPREPARE_COPY_FRAG_REF); + addRecSignal(GSN_PREPARE_COPY_FRAG_CONF, + &Dbdih::execPREPARE_COPY_FRAG_CONF); apiConnectRecord = 0; connectRecord = 0; diff --git a/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp b/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp index dc35e6fba41..5403ac5cc38 100644 --- a/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp +++ b/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp @@ -3155,6 +3155,94 @@ void Dbdih::toCopyFragLab(Signal* signal, TakeOverRecordPtr takeOverPtr; RETURN_IF_TAKE_OVER_INTERRUPTED(takeOverPtrI, takeOverPtr); + /** + * Inform starting node that TakeOver is about to start + */ + Uint32 nodeId = takeOverPtr.p->toStartingNode; + + Uint32 version = getNodeInfo(nodeId).m_version; + if (ndb_check_prep_copy_frag_version(version)) + { + jam(); + TabRecordPtr tabPtr; + tabPtr.i = takeOverPtr.p->toCurrentTabref; + ptrCheckGuard(tabPtr, ctabFileSize, tabRecord); + + FragmentstorePtr fragPtr; + getFragstore(tabPtr.p, takeOverPtr.p->toCurrentFragid, fragPtr); + Uint32 nodes[MAX_REPLICAS]; + extractNodeInfo(fragPtr.p, nodes); + + PrepareCopyFragReq* req= (PrepareCopyFragReq*)signal->getDataPtrSend(); + req->senderRef = reference(); + req->senderData = takeOverPtrI; + req->tableId = takeOverPtr.p->toCurrentTabref; + req->fragId = takeOverPtr.p->toCurrentFragid; + req->copyNodeId = nodes[0]; // Src + req->startingNodeId = takeOverPtr.p->toStartingNode; // Dst + Uint32 ref = calcLqhBlockRef(takeOverPtr.p->toStartingNode); + + sendSignal(ref, GSN_PREPARE_COPY_FRAG_REQ, signal, + PrepareCopyFragReq::SignalLength, JBB); + + takeOverPtr.p->toMasterStatus = TakeOverRecord::PREPARE_COPY; + return; + } + + takeOverPtr.p->maxPage = RNIL; + toStartCopyFrag(signal, takeOverPtr); +} + +void +Dbdih::execPREPARE_COPY_FRAG_REF(Signal* signal) +{ + jamEntry(); + PrepareCopyFragRef ref = *(PrepareCopyFragRef*)signal->getDataPtr(); + + TakeOverRecordPtr takeOverPtr; + RETURN_IF_TAKE_OVER_INTERRUPTED(ref.senderData, takeOverPtr); + + ndbrequire(takeOverPtr.p->toMasterStatus == TakeOverRecord::PREPARE_COPY); + + /** + * Treat this as copy frag ref + */ + CopyFragRef * cfref = (CopyFragRef*)signal->getDataPtrSend(); + cfref->userPtr = ref.senderData; + cfref->startingNodeId = ref.startingNodeId; + cfref->errorCode = ref.errorCode; + cfref->tableId = ref.tableId; + cfref->fragId = ref.fragId; + cfref->sendingNodeId = ref.copyNodeId; + takeOverPtr.p->toMasterStatus = TakeOverRecord::COPY_FRAG; + execCOPY_FRAGREF(signal); +} + +void +Dbdih::execPREPARE_COPY_FRAG_CONF(Signal* signal) +{ + PrepareCopyFragConf conf = *(PrepareCopyFragConf*)signal->getDataPtr(); + + TakeOverRecordPtr takeOverPtr; + RETURN_IF_TAKE_OVER_INTERRUPTED(conf.senderData, takeOverPtr); + + Uint32 version = getNodeInfo(refToNode(conf.senderRef)).m_version; + if (ndb_check_prep_copy_frag_version(version) >= 2) + { + jam(); + takeOverPtr.p->maxPage = conf.maxPageNo; + } + else + { + jam(); + takeOverPtr.p->maxPage = RNIL; + } + toStartCopyFrag(signal, takeOverPtr); +} + +void +Dbdih::toStartCopyFrag(Signal* signal, TakeOverRecordPtr takeOverPtr) +{ CreateReplicaRecordPtr createReplicaPtr; createReplicaPtr.i = 0; ptrAss(createReplicaPtr, createReplicaRecord); @@ -3178,8 +3266,8 @@ void Dbdih::toCopyFragLab(Signal* signal, createReplicaPtr.p->hotSpareUse = true; createReplicaPtr.p->dataNodeId = takeOverPtr.p->toStartingNode; - prepareSendCreateFragReq(signal, takeOverPtrI); -}//Dbdih::toCopyFragLab() + prepareSendCreateFragReq(signal, takeOverPtr.i); +}//Dbdih::toStartCopy() void Dbdih::prepareSendCreateFragReq(Signal* signal, Uint32 takeOverPtrI) { @@ -3412,10 +3500,12 @@ void Dbdih::execCREATE_FRAGCONF(Signal* signal) copyFragReq->schemaVersion = tabPtr.p->schemaVersion; copyFragReq->distributionKey = fragPtr.p->distributionKey; copyFragReq->gci = gci; - copyFragReq->nodeCount = extractNodeInfo(fragPtr.p, - copyFragReq->nodeList); + Uint32 len = copyFragReq->nodeCount = + extractNodeInfo(fragPtr.p, + copyFragReq->nodeList); + copyFragReq->nodeList[len] = takeOverPtr.p->maxPage; sendSignal(ref, GSN_COPY_FRAGREQ, signal, - CopyFragReq::SignalLength + copyFragReq->nodeCount, JBB); + CopyFragReq::SignalLength + len, JBB); } else { ndbrequire(takeOverPtr.p->toMasterStatus == TakeOverRecord::COMMIT_CREATE); jam(); @@ -4576,13 +4666,22 @@ void Dbdih::checkTakeOverInMasterStartNodeFailure(Signal* signal, ok = true; jam(); //----------------------------------------------------------------------- - // The starting node will discover the problem. We will receive either + // The copying node will discover the problem. We will receive either // COPY_FRAGREQ or COPY_FRAGCONF and then we can release the take over // record and end the process. If the copying node should also die then // we will try to send prepare create fragment and will then discover // that the starting node has failed. //----------------------------------------------------------------------- break; + case TakeOverRecord::PREPARE_COPY: + ok = true; + jam(); + /** + * We're waiting for the starting node...which just died... + * endTakeOver + */ + endTakeOver(takeOverPtr.i); + break; case TakeOverRecord::COPY_ACTIVE: ok = true; jam(); diff --git a/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp b/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp index 1bed25fb5a8..95cad98b81c 100644 --- a/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp +++ b/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp @@ -2144,6 +2144,7 @@ private: void execSTORED_PROCCONF(Signal* signal); void execSTORED_PROCREF(Signal* signal); void execCOPY_FRAGREQ(Signal* signal); + void execPREPARE_COPY_FRAG_REQ(Signal* signal); void execUPDATE_FRAG_DIST_KEY_ORD(Signal*); void execCOPY_ACTIVEREQ(Signal* signal); void execCOPY_STATEREQ(Signal* signal); diff --git a/storage/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp b/storage/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp index d6411ee1cb9..db6d201575f 100644 --- a/storage/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp +++ b/storage/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp @@ -310,6 +310,9 @@ Dblqh::Dblqh(Block_context& ctx): addRecSignal(GSN_UPDATE_FRAG_DIST_KEY_ORD, &Dblqh::execUPDATE_FRAG_DIST_KEY_ORD); + addRecSignal(GSN_PREPARE_COPY_FRAG_REQ, + &Dblqh::execPREPARE_COPY_FRAG_REQ); + initData(); #ifdef VM_TRACE diff --git a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp index f511e00afaa..e0449e08ddd 100644 --- a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp +++ b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp @@ -3670,6 +3670,7 @@ void Dblqh::execLQHKEYREQ(Signal* signal) { ndbout_c("fragptr.p->fragStatus: %d", fragptr.p->fragStatus); + CRASH_INSERTION(5046); } ndbassert(fragptr.p->fragStatus == Fragrecord::ACTIVE_CREATION); fragptr.p->m_copy_started_state = Fragrecord::AC_NR_COPY; @@ -10083,6 +10084,86 @@ Dblqh::calculateHash(Uint32 tableId, const Uint32* src) return md5_hash(Tmp, keyLen); }//Dblqh::calculateHash() +/** + * PREPARE COPY FRAG REQ + */ +void +Dblqh::execPREPARE_COPY_FRAG_REQ(Signal* signal) +{ + jamEntry(); + PrepareCopyFragReq req = *(PrepareCopyFragReq*)signal->getDataPtr(); + + CRASH_INSERTION(5045); + + tabptr.i = req.tableId; + ptrCheckGuard(tabptr, ctabrecFileSize, tablerec); + + Uint32 max_page = RNIL; + + if (getOwnNodeId() != req.startingNodeId) + { + jam(); + /** + * This is currently dead code... + * but is provided so we can impl. a better scan+delete on + * starting node wo/ having to change running node + */ + ndbrequire(getOwnNodeId() == req.copyNodeId); + c_tup->get_frag_info(req.tableId, req.fragId, &max_page); + + PrepareCopyFragConf* conf = (PrepareCopyFragConf*)signal->getDataPtrSend(); + conf->senderData = req.senderData; + conf->senderRef = reference(); + conf->tableId = req.tableId; + conf->fragId = req.fragId; + conf->copyNodeId = req.copyNodeId; + conf->startingNodeId = req.startingNodeId; + conf->maxPageNo = max_page; + sendSignal(req.senderRef, GSN_PREPARE_COPY_FRAG_CONF, + signal, PrepareCopyFragConf::SignalLength, JBB); + + return; + } + + if (! DictTabInfo::isOrderedIndex(tabptr.p->tableType)) + { + jam(); + ndbrequire(getFragmentrec(signal, req.fragId)); + + /** + * + */ + if (cstartType == NodeState::ST_SYSTEM_RESTART) + { + jam(); + signal->theData[0] = fragptr.p->tabRef; + signal->theData[1] = fragptr.p->fragId; + sendSignal(DBACC_REF, GSN_EXPANDCHECK2, signal, 2, JBB); + } + + + /** + * + */ + fragptr.p->m_copy_started_state = Fragrecord::AC_IGNORED; + fragptr.p->fragStatus = Fragrecord::ACTIVE_CREATION; + fragptr.p->logFlag = Fragrecord::STATE_FALSE; + + c_tup->get_frag_info(req.tableId, req.fragId, &max_page); + } + + PrepareCopyFragConf* conf = (PrepareCopyFragConf*)signal->getDataPtrSend(); + conf->senderData = req.senderData; + conf->senderRef = reference(); + conf->tableId = req.tableId; + conf->fragId = req.fragId; + conf->copyNodeId = req.copyNodeId; + conf->startingNodeId = req.startingNodeId; + conf->maxPageNo = max_page; + sendSignal(req.senderRef, GSN_PREPARE_COPY_FRAG_CONF, + signal, PrepareCopyFragConf::SignalLength, JBB); +} + /* *************************************** */ /* COPY_FRAGREQ: Start copying a fragment */ /* *************************************** */ @@ -10118,6 +10199,13 @@ void Dblqh::execCOPY_FRAGREQ(Signal* signal) for (i = 0; inodeList[i]); } + Uint32 maxPage = copyFragReq->nodeList[nodeCount]; + Uint32 version = getNodeInfo(refToNode(userRef)).m_version; + if (ndb_check_prep_copy_frag_version(version) < 2) + { + jam(); + maxPage = RNIL; + } if (DictTabInfo::isOrderedIndex(tabptr.p->tableType)) { jam(); @@ -10193,14 +10281,15 @@ void Dblqh::execCOPY_FRAGREQ(Signal* signal) req->requestInfo = 0; AccScanReq::setLockMode(req->requestInfo, 0); AccScanReq::setReadCommittedFlag(req->requestInfo, 0); - AccScanReq::setNRScanFlag(req->requestInfo, gci ? 1 : 0); + AccScanReq::setNRScanFlag(req->requestInfo, 1); AccScanReq::setNoDiskScanFlag(req->requestInfo, 1); req->transId1 = tcConnectptr.p->transid[0]; req->transId2 = tcConnectptr.p->transid[1]; req->savePointId = tcConnectptr.p->savePointId; + req->maxPage = maxPage; sendSignal(scanptr.p->scanBlockref, GSN_ACC_SCANREQ, signal, - AccScanReq::SignalLength, JBB); + AccScanReq::SignalLength + 1, JBB); if (! nodemask.isclear()) { diff --git a/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp b/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp index 3db91c55849..45d124b8d7d 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp +++ b/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp @@ -518,6 +518,7 @@ typedef Ptr FragoperrecPtr; Uint32 m_savePointId; Uint32 m_scanGCI; }; + Uint32 m_endPage; // lock waited for or obtained and not yet passed to LQH Uint32 m_accLockOp; @@ -1576,6 +1577,8 @@ public: void nr_delete_page_callback(Signal*, Uint32 op, Uint32 page); void nr_delete_log_buffer_callback(Signal*, Uint32 op, Uint32 page); + + bool get_frag_info(Uint32 tableId, Uint32 fragId, Uint32* maxPage); private: BLOCK_DEFINES(Dbtup); diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp index c8df5f5154e..176efac8058 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp +++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp @@ -1464,3 +1464,22 @@ Dbtup::complete_restore_lcp(Uint32 tableId, Uint32 fragId) tabDesc += 2; } } + +bool +Dbtup::get_frag_info(Uint32 tableId, Uint32 fragId, Uint32* maxPage) +{ + jamEntry(); + TablerecPtr tabPtr; + tabPtr.i= tableId; + ptrCheckGuard(tabPtr, cnoOfTablerec, tablerec); + + FragrecordPtr fragPtr; + getFragmentrec(fragPtr, fragId, tabPtr.p); + + if (maxPage) + { + * maxPage = fragPtr.p->noOfPages; + } + + return true; +} diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp index a5f7d4be0a9..5e9306909b4 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp +++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp @@ -95,7 +95,23 @@ Dbtup::execACC_SCANREQ(Signal* signal) } } - bits |= AccScanReq::getNRScanFlag(req->requestInfo) ? ScanOp::SCAN_NR : 0; + if (AccScanReq::getNRScanFlag(req->requestInfo)) + { + jam(); + bits |= ScanOp::SCAN_NR; + scanPtr.p->m_endPage = req->maxPage; + if (req->maxPage != RNIL && req->maxPage > frag.noOfPages) + { + ndbout_c("%u %u endPage: %u (noOfPages: %u)", + tablePtr.i, fragId, + req->maxPage, fragPtr.p->noOfPages); + } + } + else + { + jam(); + scanPtr.p->m_endPage = RNIL; + } // set up scan op new (scanPtr.p) ScanOp(); @@ -540,7 +556,7 @@ Dbtup::scanFirst(Signal*, ScanOpPtr scanPtr) ptrCheckGuard(fragPtr, cnoOfFragrec, fragrecord); Fragrecord& frag = *fragPtr.p; // in the future should not pre-allocate pages - if (frag.noOfPages == 0) { + if (frag.noOfPages == 0 && ((bits & ScanOp::SCAN_NR) == 0)) { jam(); scan.m_state = ScanOp::Last; return; @@ -632,11 +648,23 @@ Dbtup::scanNext(Signal* signal, ScanOpPtr scanPtr) key.m_page_no++; if (key.m_page_no >= frag.noOfPages) { jam(); + + if ((bits & ScanOp::SCAN_NR) && (scan.m_endPage != RNIL)) + { + jam(); + if (key.m_page_no < scan.m_endPage) + { + jam(); + ndbout_c("scanning page %u", key.m_page_no); + goto cont; + } + } // no more pages, scan ends pos.m_get = ScanPos::Get_undef; scan.m_state = ScanOp::Last; return true; } + cont: key.m_page_idx = 0; pos.m_get = ScanPos::Get_page_mm; // clear cached value @@ -649,7 +677,13 @@ Dbtup::scanNext(Signal* signal, ScanOpPtr scanPtr) { if (pos.m_realpid_mm == RNIL) { jam(); - pos.m_realpid_mm = getRealpid(fragPtr.p, key.m_page_no); + if (key.m_page_no < frag.noOfPages) + pos.m_realpid_mm = getRealpid(fragPtr.p, key.m_page_no); + else + { + ndbassert(bits & ScanOp::SCAN_NR); + goto nopage; + } } PagePtr pagePtr; c_page_pool.getPtr(pagePtr, pos.m_realpid_mm); @@ -657,9 +691,18 @@ Dbtup::scanNext(Signal* signal, ScanOpPtr scanPtr) if (pagePtr.p->page_state == ZEMPTY_MM) { // skip empty page jam(); - pos.m_get = ScanPos::Get_next_page_mm; - break; // incr loop count + if (! (bits & ScanOp::SCAN_NR)) + { + pos.m_get = ScanPos::Get_next_page_mm; + break; // incr loop count + } + else + { + jam(); + pos.m_realpid_mm = RNIL; + } } + nopage: pos.m_page = pagePtr.p; pos.m_get = ScanPos::Get_tuple; } @@ -820,11 +863,11 @@ Dbtup::scanNext(Signal* signal, ScanOpPtr scanPtr) { pos.m_get = ScanPos::Get_next_tuple_fs; th = (Tuple_header*)&page->m_data[key.m_page_idx]; - thbits = th->m_header_bits; if (likely(! (bits & ScanOp::SCAN_NR))) { jam(); + thbits = th->m_header_bits; if (! (thbits & Tuple_header::FREE)) { goto found_tuple; @@ -832,7 +875,15 @@ Dbtup::scanNext(Signal* signal, ScanOpPtr scanPtr) } else { - if ((foundGCI = *th->get_mm_gci(tablePtr.p)) > scanGCI) + if (pos.m_realpid_mm == RNIL) + { + jam(); + foundGCI = 0; + goto found_deleted_rowid; + } + thbits = th->m_header_bits; + if ((foundGCI = *th->get_mm_gci(tablePtr.p)) > scanGCI || + foundGCI == 0) { if (! (thbits & Tuple_header::FREE)) { @@ -904,7 +955,8 @@ Dbtup::scanNext(Signal* signal, ScanOpPtr scanPtr) Fix_page *mmpage = (Fix_page*)c_page_pool.getPtr(pos.m_realpid_mm); th = (Tuple_header*)(mmpage->m_data + key_mm.m_page_idx); - if ((foundGCI = *th->get_mm_gci(tablePtr.p)) > scanGCI) + if ((foundGCI = *th->get_mm_gci(tablePtr.p)) > scanGCI || + foundGCI == 0) { if (! (thbits & Tuple_header::FREE)) break; diff --git a/storage/ndb/test/ndbapi/testSystemRestart.cpp b/storage/ndb/test/ndbapi/testSystemRestart.cpp index 3cd7a3798c5..89580c0cef8 100644 --- a/storage/ndb/test/ndbapi/testSystemRestart.cpp +++ b/storage/ndb/test/ndbapi/testSystemRestart.cpp @@ -1501,6 +1501,54 @@ int runSR_DD_2(NDBT_Context* ctx, NDBT_Step* step) return result; } +int +runBug27434(NDBT_Context* ctx, NDBT_Step* step) +{ + int result = NDBT_OK; + NdbRestarter restarter; + Ndb* pNdb = GETNDB(step); + const Uint32 nodeCount = restarter.getNumDbNodes(); + + if (nodeCount < 2) + return NDBT_OK; + + int args[] = { DumpStateOrd::DihMaxTimeBetweenLCP }; + int dump[] = { DumpStateOrd::DihStartLcpImmediately }; + + int filter[] = { 15, NDB_MGM_EVENT_CATEGORY_CHECKPOINT, 0 }; + NdbLogEventHandle handle = + ndb_mgm_create_logevent_handle(restarter.handle, filter); + + struct ndb_logevent event; + + do { + int node1 = restarter.getDbNodeId(rand() % nodeCount); + CHECK(restarter.restartOneDbNode(node1, false, true, true) == 0); + NdbSleep_SecSleep(3); + CHECK(restarter.waitNodesNoStart(&node1, 1) == 0); + + CHECK(restarter.dumpStateAllNodes(args, 1) == 0); + + for (Uint32 i = 0; i<3; i++) + { + CHECK(restarter.dumpStateAllNodes(dump, 1) == 0); + while(ndb_logevent_get_next(handle, &event, 0) >= 0 && + event.type != NDB_LE_LocalCheckpointStarted); + while(ndb_logevent_get_next(handle, &event, 0) >= 0 && + event.type != NDB_LE_LocalCheckpointCompleted); + } + + restarter.restartAll(false, true, true); + NdbSleep_SecSleep(3); + CHECK(restarter.waitClusterNoStart() == 0); + restarter.insertErrorInNode(node1, 5046); + restarter.startAll(); + CHECK(restarter.waitClusterStarted() == 0); + } while(false); + + return result; +} + NDBT_TESTSUITE(testSystemRestart); TESTCASE("SR1", "Basic system restart test. Focus on testing restart from REDO log.\n" @@ -1681,6 +1729,12 @@ TESTCASE("Bug24664", STEP(runBug24664); FINALIZER(runClearTable); } +TESTCASE("Bug27434", + "") +{ + INITIALIZER(runWaitStarted); + STEP(runBug27434); +} TESTCASE("SR_DD_1", "") { TC_PROPERTY("ALL", 1); diff --git a/storage/ndb/test/run-test/daily-basic-tests.txt b/storage/ndb/test/run-test/daily-basic-tests.txt index 845cd5c21bb..103675d8e35 100644 --- a/storage/ndb/test/run-test/daily-basic-tests.txt +++ b/storage/ndb/test/run-test/daily-basic-tests.txt @@ -880,6 +880,10 @@ max-time: 1000 cmd: testNodeRestart args: -n Bug27466 T1 +max-time: 1500 +cmd: testSystemRestart +args: -n Bug27434 T1 + max-time: 1000 cmd: test_event args: -l 10 -n Bug27169 T1 diff --git a/storage/ndb/test/src/NdbRestarts.cpp b/storage/ndb/test/src/NdbRestarts.cpp index 6ec520887b5..86e71f4b3fc 100644 --- a/storage/ndb/test/src/NdbRestarts.cpp +++ b/storage/ndb/test/src/NdbRestarts.cpp @@ -607,6 +607,7 @@ NFDuringNR_codes[] = { 5026, 7139, 7132, + 5045, //LCP 8000, From 07865679058ac3f97884d2ea1888b8f1540d6c22 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 25 Oct 2007 07:57:18 +0200 Subject: [PATCH 46/49] BUG#31761: Code for cluster is not safe for strict-alias optimization in new gcc Fix problem with AttributeHeader::init() seen with gcc 4.2.1. Using the same object as both Uint32 and class AttributeHeader violates strict aliasing rule. ndb/include/kernel/AttributeHeader.hpp: Fix problem with AttributeHeader::init() seen with gcc 4.2.1. Using the same object as both Uint32 and class AttributeHeader violates strict aliasing rule. ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp: Fix problem with AttributeHeader::init() seen with gcc 4.2.1. Using the same object as both Uint32 and class AttributeHeader violates strict aliasing rule. ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp: Fix problem with AttributeHeader::init() seen with gcc 4.2.1. Using the same object as both Uint32 and class AttributeHeader violates strict aliasing rule. ndb/src/kernel/blocks/dbutil/DbUtil.cpp: Fix problem with AttributeHeader::init() seen with gcc 4.2.1. Using the same object as both Uint32 and class AttributeHeader violates strict aliasing rule. ndb/src/ndbapi/NdbOperationDefine.cpp: Fix problem with AttributeHeader::init() seen with gcc 4.2.1. Using the same object as both Uint32 and class AttributeHeader violates strict aliasing rule. --- ndb/include/kernel/AttributeHeader.hpp | 10 +++++----- ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp | 5 +++-- ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp | 11 +++++------ ndb/src/kernel/blocks/dbutil/DbUtil.cpp | 5 ++--- ndb/src/ndbapi/NdbOperationDefine.cpp | 15 ++++++--------- 5 files changed, 21 insertions(+), 25 deletions(-) diff --git a/ndb/include/kernel/AttributeHeader.hpp b/ndb/include/kernel/AttributeHeader.hpp index 3cb432067eb..239b1e08db4 100644 --- a/ndb/include/kernel/AttributeHeader.hpp +++ b/ndb/include/kernel/AttributeHeader.hpp @@ -42,8 +42,7 @@ public: STATIC_CONST( FRAGMENT_MEMORY= 0xFFF9 ); /** Initialize AttributeHeader at location aHeaderPtr */ - static AttributeHeader& init(void* aHeaderPtr, Uint32 anAttributeId, - Uint32 aDataSize); + static void init(Uint32* aHeaderPtr, Uint32 anAttributeId, Uint32 aDataSize); /** Returns size of AttributeHeader (usually one or two words) */ Uint32 getHeaderSize() const; // In 32-bit words @@ -101,10 +100,11 @@ public: */ inline -AttributeHeader& AttributeHeader::init(void* aHeaderPtr, Uint32 anAttributeId, - Uint32 aDataSize) +void AttributeHeader::init(Uint32* aHeaderPtr, Uint32 anAttributeId, + Uint32 aDataSize) { - return * new (aHeaderPtr) AttributeHeader(anAttributeId, aDataSize); + AttributeHeader ah(anAttributeId, aDataSize); + *aHeaderPtr = ah.m_value; } inline diff --git a/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp b/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp index a94d2f70343..a20e6ca59d2 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp @@ -1578,8 +1578,8 @@ int Dbtup::interpreterNextLab(Signal* signal, Uint32 TdataForUpdate[3]; Uint32 Tlen; - AttributeHeader& ah = AttributeHeader::init(&TdataForUpdate[0], - TattrId, TattrNoOfWords); + AttributeHeader ah(TattrId, TattrNoOfWords); + TdataForUpdate[0] = ah.m_value; TdataForUpdate[1] = TregMemBuffer[theRegister + 2]; TdataForUpdate[2] = TregMemBuffer[theRegister + 3]; Tlen = TattrNoOfWords + 1; @@ -1595,6 +1595,7 @@ int Dbtup::interpreterNextLab(Signal* signal, // Write a NULL value into the attribute /* --------------------------------------------------------- */ ah.setNULL(); + TdataForUpdate[0] = ah.m_value; Tlen = 1; }//if int TnoDataRW= updateAttributes(pagePtr, diff --git a/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp b/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp index 8a55777ac05..7e617764645 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp @@ -677,8 +677,6 @@ bool Dbtup::checkUpdateOfPrimaryKey(Uint32* updateBuffer, Tablerec* const regTabPtr) { Uint32 keyReadBuffer[MAX_KEY_SIZE_IN_WORDS]; - Uint32 attributeHeader; - AttributeHeader* ahOut = (AttributeHeader*)&attributeHeader; AttributeHeader ahIn(*updateBuffer); Uint32 attributeId = ahIn.getAttributeId(); Uint32 attrDescriptorIndex = regTabPtr->tabDescriptor + (attributeId << ZAD_LOG_SIZE); @@ -701,16 +699,17 @@ Dbtup::checkUpdateOfPrimaryKey(Uint32* updateBuffer, Tablerec* const regTabPtr) ReadFunction f = regTabPtr->readFunctionArray[attributeId]; - AttributeHeader::init(&attributeHeader, attributeId, 0); + AttributeHeader attributeHeader(attributeId, 0); tOutBufIndex = 0; tMaxRead = MAX_KEY_SIZE_IN_WORDS; bool tmp = tXfrmFlag; tXfrmFlag = true; - ndbrequire((this->*f)(&keyReadBuffer[0], ahOut, attrDescriptor, attributeOffset)); + ndbrequire((this->*f)(&keyReadBuffer[0], &attributeHeader, attrDescriptor, + attributeOffset)); tXfrmFlag = tmp; - ndbrequire(tOutBufIndex == ahOut->getDataSize()); - if (ahIn.getDataSize() != ahOut->getDataSize()) { + ndbrequire(tOutBufIndex == attributeHeader.getDataSize()); + if (ahIn.getDataSize() != attributeHeader.getDataSize()) { ljam(); return true; }//if diff --git a/ndb/src/kernel/blocks/dbutil/DbUtil.cpp b/ndb/src/kernel/blocks/dbutil/DbUtil.cpp index 0f45c407d83..316f71ff24c 100644 --- a/ndb/src/kernel/blocks/dbutil/DbUtil.cpp +++ b/ndb/src/kernel/blocks/dbutil/DbUtil.cpp @@ -1169,9 +1169,7 @@ DbUtil::prepareOperation(Signal* signal, PreparePtr prepPtr) /************************************************************** * Attribute found - store in mapping (AttributeId, Position) **************************************************************/ - AttributeHeader & attrMap = - AttributeHeader::init(attrMappingIt.data, - attrDesc.AttributeId, // 1. Store AttrId + AttributeHeader attrMap(attrDesc.AttributeId, // 1. Store AttrId 0); if (attrDesc.AttributeKeyFlag) { @@ -1200,6 +1198,7 @@ DbUtil::prepareOperation(Signal* signal, PreparePtr prepPtr) return; } } + *(attrMappingIt.data) = attrMap.m_value; #if 0 ndbout << "BEFORE: attrLength: " << attrLength << endl; #endif diff --git a/ndb/src/ndbapi/NdbOperationDefine.cpp b/ndb/src/ndbapi/NdbOperationDefine.cpp index 835e33dfb40..f814f1c1d04 100644 --- a/ndb/src/ndbapi/NdbOperationDefine.cpp +++ b/ndb/src/ndbapi/NdbOperationDefine.cpp @@ -363,9 +363,8 @@ NdbOperation::getValue_impl(const NdbColumnImpl* tAttrInfo, char* aValue) return NULL; }//if }//if - Uint32 ah; - AttributeHeader::init(&ah, tAttrInfo->m_attrId, 0); - if (insertATTRINFO(ah) != -1) { + AttributeHeader ah(tAttrInfo->m_attrId, 0); + if (insertATTRINFO(ah.m_value) != -1) { // Insert Attribute Id into ATTRINFO part. /************************************************************************ @@ -496,12 +495,11 @@ NdbOperation::setValue( const NdbColumnImpl* tAttrInfo, tAttrId = tAttrInfo->m_attrId; const char *aValue = aValuePassed; - Uint32 ahValue; if (aValue == NULL) { if (tAttrInfo->m_nullable) { - AttributeHeader& ah = AttributeHeader::init(&ahValue, tAttrId, 0); + AttributeHeader ah(tAttrId, 0); ah.setNULL(); - insertATTRINFO(ahValue); + insertATTRINFO(ah.m_value); // Insert Attribute Id with the value // NULL into ATTRINFO part. DBUG_RETURN(0); @@ -534,9 +532,8 @@ NdbOperation::setValue( const NdbColumnImpl* tAttrInfo, }//if const Uint32 totalSizeInWords = (sizeInBytes + 3)/4; // Including bits in last word const Uint32 sizeInWords = sizeInBytes / 4; // Excluding bits in last word - AttributeHeader& ah = AttributeHeader::init(&ahValue, tAttrId, - totalSizeInWords); - insertATTRINFO( ahValue ); + AttributeHeader ah(tAttrId, totalSizeInWords); + insertATTRINFO( ah.m_value ); /*********************************************************************** * Check if the pointer of the value passed is aligned on a 4 byte boundary. From 34279339dce0ef944c706b28d3643aa728732325 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 25 Oct 2007 08:40:42 +0200 Subject: [PATCH 47/49] BUG#31810: Potential infinite loop with autoincrement failures in ndb Fix extra semicolon causing if-statement to be disabled. sql/ha_ndbcluster.cc: Fix extra semicolon causing if-statement to be disabled. --- sql/ha_ndbcluster.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index b74b04f4238..f5207f8ca03 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -2302,7 +2302,7 @@ int ha_ndbcluster::write_row(byte *record) auto_value, 1) == -1) { if (--retries && - ndb->getNdbError().status == NdbError::TemporaryError); + ndb->getNdbError().status == NdbError::TemporaryError) { my_sleep(retry_sleep); continue; @@ -4862,7 +4862,7 @@ ulonglong ha_ndbcluster::get_auto_increment() auto_value, cache_size, step, start)) { if (--retries && - ndb->getNdbError().status == NdbError::TemporaryError); + ndb->getNdbError().status == NdbError::TemporaryError) { my_sleep(retry_sleep); continue; From c70da572c4ffb3a8abaea1edb1157638e44924dd Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 26 Oct 2007 11:42:33 +0200 Subject: [PATCH 48/49] commit of WL#3686 test case already in 5.1 to get regression testing, no code committed mysql-test/suite/ndb/r/ndb_update_no_read.result: New BitKeeper file ``mysql-test/suite/ndb/r/ndb_update_no_read.result'' mysql-test/suite/ndb/t/ndb_update_no_read.test: New BitKeeper file ``mysql-test/suite/ndb/t/ndb_update_no_read.test'' --- .../suite/ndb/r/ndb_update_no_read.result | 75 ++++++++++++++++++ .../suite/ndb/t/ndb_update_no_read.test | 79 +++++++++++++++++++ 2 files changed, 154 insertions(+) create mode 100644 mysql-test/suite/ndb/r/ndb_update_no_read.result create mode 100644 mysql-test/suite/ndb/t/ndb_update_no_read.test diff --git a/mysql-test/suite/ndb/r/ndb_update_no_read.result b/mysql-test/suite/ndb/r/ndb_update_no_read.result new file mode 100644 index 00000000000..4373800d338 --- /dev/null +++ b/mysql-test/suite/ndb/r/ndb_update_no_read.result @@ -0,0 +1,75 @@ +DROP TABLE IF EXISTS t1; +create table t1 (a int not null primary key, b int not null, c int, +unique index_b (b) using hash) +engine ndb; +insert into t1 values (1,10,1),(2,9,1),(3,8,1),(4,7,1),(5,6,1),(6,5,2),(7,4,2),(8,3,2), +(9,2,2),(10,1,2); +update t1 set c = 111, b = 20 where a = 1; +select * from t1 where a = 1 order by a; +a b c +1 20 111 +delete from t1 where a = 1; +select * from t1 where a = 1 order by a; +a b c +update t1 set c = 12, b = 19 where b = 2; +select * from t1 where b = 2 order by a; +a b c +delete from t1 where b = 19; +select * from t1 where b = 19 order by a; +a b c +update t1 set c = 22 where a = 10 or a >= 10; +select * from t1 order by a; +a b c +2 9 1 +3 8 1 +4 7 1 +5 6 1 +6 5 2 +7 4 2 +8 3 2 +10 1 22 +update t1 set c = 23 where a in (8,10); +select * from t1 order by a; +a b c +2 9 1 +3 8 1 +4 7 1 +5 6 1 +6 5 2 +7 4 2 +8 3 23 +10 1 23 +update t1 set c = 23 where a in (7,8) or a >= 10; +select * from t1 order by a; +a b c +2 9 1 +3 8 1 +4 7 1 +5 6 1 +6 5 2 +7 4 23 +8 3 23 +10 1 23 +update t1 set c = 11 where a = 3 or b = 7; +select * from t1 where a = 3 or b = 7 order by a; +a b c +3 8 11 +4 7 11 +update t1 set a = 13, b = 20 where a = 3; +select * from t1 where a = 13 order by a; +a b c +13 20 11 +update t1 set a = 12, b = 19 where b = 7; +select * from t1 where b = 19 order by a; +a b c +12 19 11 +select * from t1 where b = 7 order by a; +a b c +update t1 set c = 12, b = 29 where a = 5 and b = 6; +select * from t1 where b = 19 order by a; +a b c +12 19 11 +delete from t1 where b = 6 and c = 12; +select * from t1 where b = 6 order by a; +a b c +drop table t1; diff --git a/mysql-test/suite/ndb/t/ndb_update_no_read.test b/mysql-test/suite/ndb/t/ndb_update_no_read.test new file mode 100644 index 00000000000..60bea53b7b5 --- /dev/null +++ b/mysql-test/suite/ndb/t/ndb_update_no_read.test @@ -0,0 +1,79 @@ +-- source include/have_ndb.inc +-- source include/not_embedded.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +# +# New test case for WL 3686 (which is not until CGE-6.3) +# but test is committed in 5.1 to verify consistant results. +# +# When only constant expressions in update statements and +# only PK or UK in WHERE clause. No extra WHERE parts are +# allowed. WL #3687 takes of more advanced variants of +# avoiding the read before the update/delete + +create table t1 (a int not null primary key, b int not null, c int, + unique index_b (b) using hash) +engine ndb; + +insert into t1 values (1,10,1),(2,9,1),(3,8,1),(4,7,1),(5,6,1),(6,5,2),(7,4,2),(8,3,2), + (9,2,2),(10,1,2); + +# These ones should use optimisation + +update t1 set c = 111, b = 20 where a = 1; + +select * from t1 where a = 1 order by a; + +delete from t1 where a = 1; + +select * from t1 where a = 1 order by a; + +update t1 set c = 12, b = 19 where b = 2; + +select * from t1 where b = 2 order by a; + +delete from t1 where b = 19; + +select * from t1 where b = 19 order by a; + +update t1 set c = 22 where a = 10 or a >= 10; + +select * from t1 order by a; + +update t1 set c = 23 where a in (8,10); + +select * from t1 order by a; + +update t1 set c = 23 where a in (7,8) or a >= 10; + +select * from t1 order by a; + +# These ones should not use optimisation + +update t1 set c = 11 where a = 3 or b = 7; + +select * from t1 where a = 3 or b = 7 order by a; + +update t1 set a = 13, b = 20 where a = 3; + +select * from t1 where a = 13 order by a; + +update t1 set a = 12, b = 19 where b = 7; + +select * from t1 where b = 19 order by a; + +select * from t1 where b = 7 order by a; + +update t1 set c = 12, b = 29 where a = 5 and b = 6; + +select * from t1 where b = 19 order by a; + +delete from t1 where b = 6 and c = 12; + +select * from t1 where b = 6 order by a; + +drop table t1; + From 4ce44da3d5351b29e8dd0ed65bf49faeac21254b Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 26 Oct 2007 11:43:05 +0200 Subject: [PATCH 49/49] correct unused code --- sql/sql_update.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/sql_update.cc b/sql/sql_update.cc index cb3f2fece89..7673126314f 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -679,7 +679,7 @@ int mysql_update(THD *thd, */ if (will_batch && ((error= table->file->exec_bulk_update(&dup_key_found)) || - !dup_key_found)) + dup_key_found)) { if (error) {