From 663d0bbdfbf4b60a59f8a53cce675e0210077b80 Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Thu, 25 Aug 2005 12:34:42 -0700 Subject: [PATCH 01/11] Fix crash in DES_DECRYPT(NULL). (Bug #12757) --- sql/item_strfunc.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index d0650a1ce11..6962ba7c4ac 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -472,11 +472,11 @@ String *Item_func_des_decrypt::val_str(String *str) struct st_des_keyblock keyblock; struct st_des_keyschedule keyschedule; String *res= args[0]->val_str(str); - uint length=res->length(),tail; + uint length,tail; - if ((null_value=args[0]->null_value)) + if ((null_value= args[0]->null_value)) return 0; - length=res->length(); + length= res->length(); if (length < 9 || (length % 8) != 1 || !((*res)[0] & 128)) return res; // Skip decryption if not encrypted From 0dc444ec4efc8d4adcf7124a276c86859a1b3bcb Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Tue, 30 Aug 2005 12:24:37 -0700 Subject: [PATCH 02/11] Fix incorrect spellings of "dropped" in source and tests. (Bug #12828) --- include/my_alloc.h | 2 +- mysql-test/t/rpl000009.test | 2 +- mysql-test/t/system_mysql_db_fix.test | 2 +- sql/sql_table.cc | 2 +- tests/mysql_client_test.c | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/my_alloc.h b/include/my_alloc.h index a3dd35d7ea3..1641b3acf3e 100644 --- a/include/my_alloc.h +++ b/include/my_alloc.h @@ -43,7 +43,7 @@ typedef struct st_mem_root unsigned int block_num; /* allocated blocks counter */ /* first free block in queue test counter (if it exceed - MAX_BLOCK_USAGE_BEFORE_DROP block will be droped in 'used' list) + MAX_BLOCK_USAGE_BEFORE_DROP block will be dropped in 'used' list) */ unsigned int first_block_usage; diff --git a/mysql-test/t/rpl000009.test b/mysql-test/t/rpl000009.test index a51a64979fa..81e9860c186 100644 --- a/mysql-test/t/rpl000009.test +++ b/mysql-test/t/rpl000009.test @@ -167,7 +167,7 @@ drop database mysqltest2; save_master_pos; connection slave; sync_with_master; -# These has to be droped on slave as they are not replicated +# These have to be dropped on slave because they are not replicated drop database mysqltest2; drop database mysqltest3; diff --git a/mysql-test/t/system_mysql_db_fix.test b/mysql-test/t/system_mysql_db_fix.test index 583ca293baa..dc3047a8564 100644 --- a/mysql-test/t/system_mysql_db_fix.test +++ b/mysql-test/t/system_mysql_db_fix.test @@ -81,7 +81,7 @@ DROP TABLE db, host, user, func, tables_priv, columns_priv, help_category, help_ -- enable_query_log -# check that we droped all system tables +# check that we dropped all system tables show tables; # End of 4.1 tests diff --git a/sql/sql_table.cc b/sql/sql_table.cc index b593aed1453..92db0143980 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -2948,7 +2948,7 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, Field **f_ptr,*field; for (f_ptr=table->field ; (field= *f_ptr) ; f_ptr++) { - /* Check if field should be droped */ + /* Check if field should be dropped */ Alter_drop *drop; drop_it.rewind(); while ((drop=drop_it++)) diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 64c5e7edaf9..ffcf5b6f34d 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -9177,7 +9177,7 @@ static void test_create_drop() rc= mysql_stmt_execute(stmt_drop); check_execute(stmt_drop, rc); if (!opt_silent) - fprintf(stdout, "droped %i\n", i); + fprintf(stdout, "dropped %i\n", i); rc= mysql_stmt_execute(stmt_create_select); check_execute(stmt_create, rc); @@ -9192,7 +9192,7 @@ static void test_create_drop() rc= mysql_stmt_execute(stmt_drop); check_execute(stmt_drop, rc); if (!opt_silent) - fprintf(stdout, "droped %i\n", i); + fprintf(stdout, "dropped %i\n", i); } mysql_stmt_close(stmt_create); From 6b4170ab1088de5390aa7c7a9f2888c5f0aaa29c Mon Sep 17 00:00:00 2001 From: "tomas@poseidon.ndb.mysql.com" <> Date: Wed, 31 Aug 2005 13:09:18 +0200 Subject: [PATCH 03/11] corrected some erroneous ndb error messages --- ndb/src/ndbapi/ndberror.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/ndb/src/ndbapi/ndberror.c b/ndb/src/ndbapi/ndberror.c index 6fdc75fbe7e..69fc47ff70c 100644 --- a/ndb/src/ndbapi/ndberror.c +++ b/ndb/src/ndbapi/ndberror.c @@ -55,9 +55,6 @@ typedef struct ErrorBundle { #define NI ndberror_cl_function_not_implemented #define UE ndberror_cl_unknown_error_code -static const char REDO_BUFFER_MSG[]= -"REDO log buffers overloaded, consult online manual (increase RedoBuffer, and|or decrease TimeBetweenLocalCheckpoints, and|or increase NoOfFragmentLogFiles)"; - static const char* empty_string = ""; /* @@ -164,8 +161,9 @@ ErrorBundle ErrorCodes[] = { { 830, TR, "Out of add fragment operation records" }, { 873, TR, "Out of attrinfo records for scan in tuple manager" }, { 1217, TR, "Out of operation records in local data manager (increase MaxNoOfLocalOperations)" }, - { 1220, TR, REDO_BUFFER_MSG }, + { 1220, TR, "REDO log files overloaded, consult online manual (decrease TimeBetweenLocalCheckpoints, and|or increase NoOfFragmentLogFiles)" }, { 1222, TR, "Out of transaction markers in LQH" }, + { 1224, TR, "Out of Send Buffer space in LQH" }, { 4021, TR, "Out of Send Buffer space in NDB API" }, { 4022, TR, "Out of Send Buffer space in NDB API" }, { 4032, TR, "Out of Send Buffer space in NDB API" }, @@ -194,10 +192,10 @@ ErrorBundle ErrorCodes[] = { /** * OverloadError */ - { 410, OL, REDO_BUFFER_MSG }, + { 410, OL, "REDO log files overloaded, consult online manual (decrease TimeBetweenLocalCheckpoints, and|or increase NoOfFragmentLogFiles)" }, { 677, OL, "Index UNDO buffers overloaded (increase UndoIndexBuffer)" }, { 891, OL, "Data UNDO buffers overloaded (increase UndoDataBuffer)" }, - { 1221, OL, REDO_BUFFER_MSG }, + { 1221, OL, "REDO buffers overloaded, consult online manual (increase RedoBuffer)" }, { 4006, OL, "Connect failure - out of connection objects (increase MaxNoOfConcurrentTransactions)" }, From 9aa5a86a801d6af6ed40e1ce16a8b7b1c83ea3e2 Mon Sep 17 00:00:00 2001 From: "heikki@hundin.mysql.fi" <> Date: Wed, 31 Aug 2005 14:17:05 +0300 Subject: [PATCH 04/11] ha_innodb.cc: Fix bug #12852 : do not increment the open handle count to a table if the table does not have an .ibd file and InnoDB decides to return an error from the ::open() function; then the table can be dropped even if the user has tried to open it --- sql/ha_innodb.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index e8279982da5..b4e5092ee4a 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -1651,6 +1651,8 @@ ha_innobase::open( my_free((char*) upd_buff, MYF(0)); my_errno = ENOENT; + dict_table_decrement_handle_count(ib_table); + DBUG_RETURN(1); } @@ -5439,6 +5441,19 @@ ha_innobase::store_lock( if (lock_type != TL_IGNORE && lock.type == TL_UNLOCK) { + if (lock_type == TL_READ && thd->in_lock_tables) { + /* We come here if MySQL is processing LOCK TABLES + ... READ LOCAL. MyISAM under that table lock type + reads the table as it was at the time the lock was + granted (new inserts are allowed, but not seen by the + reader). To get a similar effect on an InnoDB table, + we must use LOCK TABLES ... READ. We convert the lock + type here, so that for InnoDB, READ LOCAL is + equivalent to READ. */ + + lock_type = TL_READ_NO_INSERT; + } + /* If we are not doing a LOCK TABLE or DISCARD/IMPORT TABLESPACE, then allow multiple writers */ From 183feee465e1c159840ff157919649962b2a221e Mon Sep 17 00:00:00 2001 From: "heikki@hundin.mysql.fi" <> Date: Wed, 31 Aug 2005 14:27:44 +0300 Subject: [PATCH 05/11] ha_innodb.cc: Fix bug #12410 : InnoDB was too permissive with LOCK TABLE ... READ LOCAL, and alowed new inserts to the table; we now make READ LOCAL equivalent to READ for InnoDB; note that this will cause slightly more locking in mysqldump, but makes the InnoDB table dumps consistent with MyISAM table dumps; note that the real code change patch was accidentally pushed with my another patch 5 minutes ago --- sql/ha_innodb.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index b4e5092ee4a..b30ddfe8227 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -5449,7 +5449,9 @@ ha_innobase::store_lock( reader). To get a similar effect on an InnoDB table, we must use LOCK TABLES ... READ. We convert the lock type here, so that for InnoDB, READ LOCAL is - equivalent to READ. */ + equivalent to READ. This will change the InnoDB + behavior in mysqldump, so that dumps of InnoDB tables + are consistent with dumps of MyISAM tables. */ lock_type = TL_READ_NO_INSERT; } From 2b11fdba342d88713b2dbc05cf578e2270f404ca Mon Sep 17 00:00:00 2001 From: "tomas@poseidon.ndb.mysql.com" <> Date: Wed, 31 Aug 2005 16:15:03 +0200 Subject: [PATCH 06/11] improved error message printing on filesystem refuse signals --- ndb/include/kernel/signaldata/FsRef.hpp | 22 +----- ndb/src/kernel/blocks/backup/BackupInit.cpp | 8 +-- ndb/src/kernel/blocks/dbacc/Dbacc.hpp | 5 -- ndb/src/kernel/blocks/dbacc/DbaccInit.cpp | 5 -- ndb/src/kernel/blocks/dbacc/DbaccMain.cpp | 42 ----------- ndb/src/kernel/blocks/dbdict/Dbdict.cpp | 46 +++++------- ndb/src/kernel/blocks/dbdict/Dbdict.hpp | 2 - ndb/src/kernel/blocks/dbdih/DbdihInit.cpp | 8 +-- ndb/src/kernel/blocks/dbdih/DbdihMain.cpp | 66 +++++++++++------ ndb/src/kernel/blocks/dblqh/Dblqh.hpp | 3 - ndb/src/kernel/blocks/dblqh/DblqhInit.cpp | 7 +- ndb/src/kernel/blocks/dblqh/DblqhMain.cpp | 71 +++---------------- ndb/src/kernel/blocks/dbtup/Dbtup.hpp | 5 -- ndb/src/kernel/blocks/dbtup/DbtupGen.cpp | 30 -------- ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp | 7 -- ndb/src/kernel/blocks/ndbcntr/Ndbcntr.hpp | 1 - ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp | 1 - ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp | 12 ++-- ndb/src/kernel/vm/SimulatedBlock.cpp | 63 ++++++++++++++++ ndb/src/kernel/vm/SimulatedBlock.hpp | 9 +++ 20 files changed, 158 insertions(+), 255 deletions(-) diff --git a/ndb/include/kernel/signaldata/FsRef.hpp b/ndb/include/kernel/signaldata/FsRef.hpp index 650f6520fb5..2f7038de4ec 100644 --- a/ndb/include/kernel/signaldata/FsRef.hpp +++ b/ndb/include/kernel/signaldata/FsRef.hpp @@ -31,25 +31,7 @@ * SENDER: Ndbfs * RECIVER: */ -class FsRef { - /** - * Reciver(s) - */ - friend class Dbdict; - friend class Backup; - - /** - * Sender(s) - */ - friend class Ndbfs; - friend class VoidFs; - - /** - * For printing - */ - friend bool printFSREF(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo); - -public: +struct FsRef { /** * Enum type for errorCode */ @@ -73,8 +55,6 @@ public: */ STATIC_CONST( SignalLength = 4 ); -private: - /** * DATA VARIABLES */ diff --git a/ndb/src/kernel/blocks/backup/BackupInit.cpp b/ndb/src/kernel/blocks/backup/BackupInit.cpp index eae72f43db5..2c36896e34c 100644 --- a/ndb/src/kernel/blocks/backup/BackupInit.cpp +++ b/ndb/src/kernel/blocks/backup/BackupInit.cpp @@ -150,16 +150,16 @@ Backup::Backup(const Configuration & conf) : addRecSignal(GSN_DI_FCOUNTCONF, &Backup::execDI_FCOUNTCONF); addRecSignal(GSN_DIGETPRIMCONF, &Backup::execDIGETPRIMCONF); - addRecSignal(GSN_FSOPENREF, &Backup::execFSOPENREF); + addRecSignal(GSN_FSOPENREF, &Backup::execFSOPENREF, true); addRecSignal(GSN_FSOPENCONF, &Backup::execFSOPENCONF); - addRecSignal(GSN_FSCLOSEREF, &Backup::execFSCLOSEREF); + addRecSignal(GSN_FSCLOSEREF, &Backup::execFSCLOSEREF, true); addRecSignal(GSN_FSCLOSECONF, &Backup::execFSCLOSECONF); - addRecSignal(GSN_FSAPPENDREF, &Backup::execFSAPPENDREF); + addRecSignal(GSN_FSAPPENDREF, &Backup::execFSAPPENDREF, true); addRecSignal(GSN_FSAPPENDCONF, &Backup::execFSAPPENDCONF); - addRecSignal(GSN_FSREMOVEREF, &Backup::execFSREMOVEREF); + addRecSignal(GSN_FSREMOVEREF, &Backup::execFSREMOVEREF, true); addRecSignal(GSN_FSREMOVECONF, &Backup::execFSREMOVECONF); /*****/ diff --git a/ndb/src/kernel/blocks/dbacc/Dbacc.hpp b/ndb/src/kernel/blocks/dbacc/Dbacc.hpp index 246afc5ceb8..ea866aafff9 100644 --- a/ndb/src/kernel/blocks/dbacc/Dbacc.hpp +++ b/ndb/src/kernel/blocks/dbacc/Dbacc.hpp @@ -949,17 +949,12 @@ private: void execACC_TO_REQ(Signal* signal); void execACC_LOCKREQ(Signal* signal); void execFSOPENCONF(Signal* signal); - void execFSOPENREF(Signal* signal); void execFSCLOSECONF(Signal* signal); - void execFSCLOSEREF(Signal* signal); void execFSWRITECONF(Signal* signal); - void execFSWRITEREF(Signal* signal); void execFSREADCONF(Signal* signal); - void execFSREADREF(Signal* signal); void execNDB_STTOR(Signal* signal); void execDROP_TAB_REQ(Signal* signal); void execFSREMOVECONF(Signal* signal); - void execFSREMOVEREF(Signal* signal); void execREAD_CONFIG_REQ(Signal* signal); void execSET_VAR_REQ(Signal* signal); void execDUMP_STATE_ORD(Signal* signal); diff --git a/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp b/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp index 95b336a0a65..c98c072cc89 100644 --- a/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp +++ b/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp @@ -187,17 +187,12 @@ Dbacc::Dbacc(const class Configuration & conf): addRecSignal(GSN_ACC_TO_REQ, &Dbacc::execACC_TO_REQ); addRecSignal(GSN_ACC_LOCKREQ, &Dbacc::execACC_LOCKREQ); addRecSignal(GSN_FSOPENCONF, &Dbacc::execFSOPENCONF); - addRecSignal(GSN_FSOPENREF, &Dbacc::execFSOPENREF); addRecSignal(GSN_FSCLOSECONF, &Dbacc::execFSCLOSECONF); - addRecSignal(GSN_FSCLOSEREF, &Dbacc::execFSCLOSEREF); addRecSignal(GSN_FSWRITECONF, &Dbacc::execFSWRITECONF); - addRecSignal(GSN_FSWRITEREF, &Dbacc::execFSWRITEREF); addRecSignal(GSN_FSREADCONF, &Dbacc::execFSREADCONF); - addRecSignal(GSN_FSREADREF, &Dbacc::execFSREADREF); addRecSignal(GSN_NDB_STTOR, &Dbacc::execNDB_STTOR); addRecSignal(GSN_DROP_TAB_REQ, &Dbacc::execDROP_TAB_REQ); addRecSignal(GSN_FSREMOVECONF, &Dbacc::execFSREMOVECONF); - addRecSignal(GSN_FSREMOVEREF, &Dbacc::execFSREMOVEREF); addRecSignal(GSN_READ_CONFIG_REQ, &Dbacc::execREAD_CONFIG_REQ, true); addRecSignal(GSN_SET_VAR_REQ, &Dbacc::execSET_VAR_REQ); diff --git a/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp b/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp index 1f0053e209a..a3880e2df1d 100644 --- a/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp +++ b/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp @@ -248,15 +248,6 @@ void Dbacc::execFSCLOSECONF(Signal* signal) return; }//Dbacc::execFSCLOSECONF() -/* ******************--------------------------------------------------------------- */ -/* FSCLOSEREF OPENFILE CONF */ -/* ******************------------------------------+ */ -/* SENDER: FS, LEVEL B */ -void Dbacc::execFSCLOSEREF(Signal* signal) -{ - jamEntry(); - ndbrequire(false); -}//Dbacc::execFSCLOSEREF() /* ******************--------------------------------------------------------------- */ /* FSOPENCONF OPENFILE CONF */ @@ -304,15 +295,6 @@ void Dbacc::execFSOPENCONF(Signal* signal) return; }//Dbacc::execFSOPENCONF() -/* ******************--------------------------------------------------------------- */ -/* FSOPENREF OPENFILE REF */ -/* ******************------------------------------+ */ -/* SENDER: FS, LEVEL B */ -void Dbacc::execFSOPENREF(Signal* signal) -{ - jamEntry(); - ndbrequire(false); -}//Dbacc::execFSOPENREF() /* ******************--------------------------------------------------------------- */ /* FSREADCONF OPENFILE CONF */ @@ -366,16 +348,6 @@ void Dbacc::execFSREADCONF(Signal* signal) return; }//Dbacc::execFSREADCONF() -/* ******************--------------------------------------------------------------- */ -/* FSREADRREF OPENFILE CONF */ -/* ******************------------------------------+ */ -/* SENDER: FS, LEVEL B */ -void Dbacc::execFSREADREF(Signal* signal) -{ - jamEntry(); - progError(0, __LINE__, "Read of file refused"); - return; -}//Dbacc::execFSREADREF() /* ******************--------------------------------------------------------------- */ /* FSWRITECONF OPENFILE CONF */ @@ -479,16 +451,6 @@ void Dbacc::execFSWRITECONF(Signal* signal) return; }//Dbacc::execFSWRITECONF() -/* ******************--------------------------------------------------------------- */ -/* FSWRITEREF OPENFILE CONF */ -/* ******************------------------------------+ */ -/* SENDER: FS, LEVEL B */ -void Dbacc::execFSWRITEREF(Signal* signal) -{ - jamEntry(); - progError(0, __LINE__, "Write to file refused"); - return; -}//Dbacc::execFSWRITEREF() /* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */ @@ -1425,10 +1387,6 @@ void Dbacc::execFSREMOVECONF(Signal* signal) tabPtr.p->tabUserRef = 0; }//Dbacc::execFSREMOVECONF() -void Dbacc::execFSREMOVEREF(Signal* signal) -{ - ndbrequire(false); -}//Dbacc::execFSREMOVEREF() /* -------------------------------------------------------------------------- */ /* ADDFRAGTOTAB */ diff --git a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp index 9eec1d35cdb..3d5eb0c52aa 100644 --- a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp +++ b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp @@ -379,14 +379,6 @@ void Dbdict::execFSCLOSECONF(Signal* signal) }//switch }//execFSCLOSECONF() -/* ---------------------------------------------------------------- */ -// A close file was refused. -/* ---------------------------------------------------------------- */ -void Dbdict::execFSCLOSEREF(Signal* signal) -{ - jamEntry(); - progError(0, 0); -}//execFSCLOSEREF() /* ---------------------------------------------------------------- */ // A file was successfully opened. @@ -449,17 +441,21 @@ void Dbdict::execFSOPENREF(Signal* signal) c_fsConnectRecordPool.getPtr(fsPtr, fsRef->userPointer); switch (fsPtr.p->fsState) { case FsConnectRecord::OPEN_READ_SCHEMA1: + jam(); openReadSchemaRef(signal, fsPtr); - break; + return; case FsConnectRecord::OPEN_READ_TAB_FILE1: jam(); openReadTableRef(signal, fsPtr); - break; + return; default: - jamLine((fsPtr.p->fsState & 0xFFF)); - ndbrequire(false); break; }//switch + { + char msg[100]; + sprintf(msg, "File system open failed during FsConnectRecord state %d", (Uint32)fsPtr.p->fsState); + fsRefError(signal,__LINE__,msg); + } }//execFSOPENREF() /* ---------------------------------------------------------------- */ @@ -499,17 +495,21 @@ void Dbdict::execFSREADREF(Signal* signal) c_fsConnectRecordPool.getPtr(fsPtr, fsRef->userPointer); switch (fsPtr.p->fsState) { case FsConnectRecord::READ_SCHEMA1: + jam(); readSchemaRef(signal, fsPtr); - break; + return; case FsConnectRecord::READ_TAB_FILE1: jam(); readTableRef(signal, fsPtr); - break; + return; default: - jamLine((fsPtr.p->fsState & 0xFFF)); - ndbrequire(false); break; }//switch + { + char msg[100]; + sprintf(msg, "File system read failed during FsConnectRecord state %d", (Uint32)fsPtr.p->fsState); + fsRefError(signal,__LINE__,msg); + } }//execFSREADREF() /* ---------------------------------------------------------------- */ @@ -536,14 +536,6 @@ void Dbdict::execFSWRITECONF(Signal* signal) }//switch }//execFSWRITECONF() -/* ---------------------------------------------------------------- */ -// A write file was refused. -/* ---------------------------------------------------------------- */ -void Dbdict::execFSWRITEREF(Signal* signal) -{ - jamEntry(); - progError(0, 0); -}//execFSWRITEREF() /* ---------------------------------------------------------------- */ // Routines to handle Read/Write of Table Files @@ -1181,13 +1173,11 @@ Dbdict::Dbdict(const class Configuration & conf): addRecSignal(GSN_DICTSTARTREQ, &Dbdict::execDICTSTARTREQ); addRecSignal(GSN_READ_NODESCONF, &Dbdict::execREAD_NODESCONF); addRecSignal(GSN_FSOPENCONF, &Dbdict::execFSOPENCONF); - addRecSignal(GSN_FSOPENREF, &Dbdict::execFSOPENREF); + addRecSignal(GSN_FSOPENREF, &Dbdict::execFSOPENREF, true); addRecSignal(GSN_FSCLOSECONF, &Dbdict::execFSCLOSECONF); - addRecSignal(GSN_FSCLOSEREF, &Dbdict::execFSCLOSEREF); addRecSignal(GSN_FSWRITECONF, &Dbdict::execFSWRITECONF); - addRecSignal(GSN_FSWRITEREF, &Dbdict::execFSWRITEREF); addRecSignal(GSN_FSREADCONF, &Dbdict::execFSREADCONF); - addRecSignal(GSN_FSREADREF, &Dbdict::execFSREADREF); + addRecSignal(GSN_FSREADREF, &Dbdict::execFSREADREF, true); addRecSignal(GSN_LQHFRAGCONF, &Dbdict::execLQHFRAGCONF); addRecSignal(GSN_LQHADDATTCONF, &Dbdict::execLQHADDATTCONF); addRecSignal(GSN_LQHADDATTREF, &Dbdict::execLQHADDATTREF); diff --git a/ndb/src/kernel/blocks/dbdict/Dbdict.hpp b/ndb/src/kernel/blocks/dbdict/Dbdict.hpp index 77a44d0ad24..abe253bcaa7 100644 --- a/ndb/src/kernel/blocks/dbdict/Dbdict.hpp +++ b/ndb/src/kernel/blocks/dbdict/Dbdict.hpp @@ -458,13 +458,11 @@ private: void execSCHEMA_INFOCONF(Signal* signal); void execREAD_NODESCONF(Signal* signal); void execFSCLOSECONF(Signal* signal); - void execFSCLOSEREF(Signal* signal); void execFSOPENCONF(Signal* signal); void execFSOPENREF(Signal* signal); void execFSREADCONF(Signal* signal); void execFSREADREF(Signal* signal); void execFSWRITECONF(Signal* signal); - void execFSWRITEREF(Signal* signal); void execNDB_STTOR(Signal* signal); void execREAD_CONFIG_REQ(Signal* signal); void execSTTOR(Signal* signal); diff --git a/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp b/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp index 9a5efebc56e..1c14163fe76 100644 --- a/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp +++ b/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp @@ -206,13 +206,13 @@ Dbdih::Dbdih(const class Configuration & config): addRecSignal(GSN_ADD_FRAGCONF, &Dbdih::execADD_FRAGCONF); addRecSignal(GSN_ADD_FRAGREF, &Dbdih::execADD_FRAGREF); addRecSignal(GSN_FSOPENCONF, &Dbdih::execFSOPENCONF); - addRecSignal(GSN_FSOPENREF, &Dbdih::execFSOPENREF); + addRecSignal(GSN_FSOPENREF, &Dbdih::execFSOPENREF, true); addRecSignal(GSN_FSCLOSECONF, &Dbdih::execFSCLOSECONF); - addRecSignal(GSN_FSCLOSEREF, &Dbdih::execFSCLOSEREF); + addRecSignal(GSN_FSCLOSEREF, &Dbdih::execFSCLOSEREF, true); addRecSignal(GSN_FSREADCONF, &Dbdih::execFSREADCONF); - addRecSignal(GSN_FSREADREF, &Dbdih::execFSREADREF); + addRecSignal(GSN_FSREADREF, &Dbdih::execFSREADREF, true); addRecSignal(GSN_FSWRITECONF, &Dbdih::execFSWRITECONF); - addRecSignal(GSN_FSWRITEREF, &Dbdih::execFSWRITEREF); + addRecSignal(GSN_FSWRITEREF, &Dbdih::execFSWRITEREF, true); addRecSignal(GSN_SET_VAR_REQ, &Dbdih::execSET_VAR_REQ); addRecSignal(GSN_START_INFOREQ, diff --git a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp index 94426c8be3f..669be2b48f0 100644 --- a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp +++ b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp @@ -782,29 +782,36 @@ void Dbdih::execFSCLOSEREF(Signal* signal) filePtr.p->reqStatus = FileRecord::IDLE; switch (status) { case FileRecord::CLOSING_GCP: - ndbrequire(false); + jam(); break; case FileRecord::CLOSING_GCP_CRASH: jam(); closingGcpCrashLab(signal, filePtr); - break; + return; case FileRecord::CLOSING_TABLE_CRASH: jam(); closingTableCrashLab(signal, filePtr); - break; + return; case FileRecord::CLOSING_TABLE_SR: - ndbrequire(false); + jam(); break; case FileRecord::TABLE_CLOSE: - ndbrequire(false); + jam(); break; case FileRecord::TABLE_CLOSE_DELETE: - ndbrequire(false); + jam(); break; default: - ndbrequire(false); + jam(); break; + }//switch + { + char msg[100]; + sprintf(msg, "File system close failed during FileRecord status %d", (Uint32)status); + fsRefError(signal,__LINE__,msg); + } + return; }//Dbdih::execFSCLOSEREF() @@ -868,34 +875,39 @@ void Dbdih::execFSOPENREF(Signal* signal) /* WE DID NOT MANAGE TO CREATE A GLOBAL CHECKPOINT FILE. SERIOUS ERROR */ /* WHICH CAUSES A SYSTEM RESTART. */ /* --------------------------------------------------------------------- */ - ndbrequire(false); + jam(); break; case FileRecord::OPENING_COPY_GCI: jam(); openingCopyGciErrorLab(signal, filePtr); - break; + return; case FileRecord::CREATING_COPY_GCI: - ndbrequire(false); + jam(); break; case FileRecord::OPENING_GCP: jam(); openingGcpErrorLab(signal, filePtr); - break; + return; case FileRecord::OPENING_TABLE: jam(); openingTableErrorLab(signal, filePtr); - break; + return; case FileRecord::TABLE_CREATE: - ndbrequire(false); + jam(); break; case FileRecord::TABLE_OPEN_FOR_DELETE: jam(); tableDeleteLab(signal, filePtr); - break; + return; default: - ndbrequire(false); + jam(); break; }//switch + { + char msg[100]; + sprintf(msg, "File system open failed during FileRecord status %d", (Uint32)status); + fsRefError(signal,__LINE__,msg); + } return; }//Dbdih::execFSOPENREF() @@ -935,16 +947,19 @@ void Dbdih::execFSREADREF(Signal* signal) case FileRecord::READING_GCP: jam(); readingGcpErrorLab(signal, filePtr); - break; + return; case FileRecord::READING_TABLE: jam(); readingTableErrorLab(signal, filePtr); - break; + return; default: - ndbrequire(false); break; }//switch - return; + { + char msg[100]; + sprintf(msg, "File system read failed during FileRecord status %d", (Uint32)status); + fsRefError(signal,__LINE__,msg); + } }//Dbdih::execFSREADREF() void Dbdih::execFSWRITECONF(Signal* signal) @@ -989,22 +1004,27 @@ void Dbdih::execFSWRITEREF(Signal* signal) /* EVEN CREATING THE FILE DID NOT WORK. WE WILL THEN CRASH. */ /* ERROR IN WRITING FILE. WE WILL NOT CONTINUE FROM HERE. */ /* --------------------------------------------------------------------- */ - ndbrequire(false); + jam(); break; case FileRecord::WRITE_INIT_GCP: /* --------------------------------------------------------------------- */ /* AN ERROR OCCURRED IN WRITING A GCI FILE WHICH IS A SERIOUS ERROR */ /* THAT CAUSE A SYSTEM RESTART. */ /* --------------------------------------------------------------------- */ - ndbrequire(false); + jam(); break; case FileRecord::TABLE_WRITE: - ndbrequire(false); + jam(); break; default: - ndbrequire(false); + jam(); break; }//switch + { + char msg[100]; + sprintf(msg, "File system write failed during FileRecord status %d", (Uint32)status); + fsRefError(signal,__LINE__,msg); + } return; }//Dbdih::execFSWRITEREF() diff --git a/ndb/src/kernel/blocks/dblqh/Dblqh.hpp b/ndb/src/kernel/blocks/dblqh/Dblqh.hpp index 19e055a3011..836fc9398e5 100644 --- a/ndb/src/kernel/blocks/dblqh/Dblqh.hpp +++ b/ndb/src/kernel/blocks/dblqh/Dblqh.hpp @@ -2175,9 +2175,7 @@ private: void execTUP_SRREF(Signal* signal); void execGCP_SAVEREQ(Signal* signal); void execFSOPENCONF(Signal* signal); - void execFSOPENREF(Signal* signal); void execFSCLOSECONF(Signal* signal); - void execFSCLOSEREF(Signal* signal); void execFSWRITECONF(Signal* signal); void execFSWRITEREF(Signal* signal); void execFSREADCONF(Signal* signal); @@ -2186,7 +2184,6 @@ private: void execSET_VAR_REQ(Signal* signal); void execTIME_SIGNAL(Signal* signal); void execFSSYNCCONF(Signal* signal); - void execFSSYNCREF(Signal* signal); void execALTER_TAB_REQ(Signal* signal); void execALTER_TAB_CONF(Signal* signal); diff --git a/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp b/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp index ec29489180c..f9dd63e782d 100644 --- a/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp +++ b/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp @@ -311,18 +311,15 @@ Dblqh::Dblqh(const class Configuration & conf): addRecSignal(GSN_TUP_SRREF, &Dblqh::execTUP_SRREF); addRecSignal(GSN_GCP_SAVEREQ, &Dblqh::execGCP_SAVEREQ); addRecSignal(GSN_FSOPENCONF, &Dblqh::execFSOPENCONF); - addRecSignal(GSN_FSOPENREF, &Dblqh::execFSOPENREF); addRecSignal(GSN_FSCLOSECONF, &Dblqh::execFSCLOSECONF); - addRecSignal(GSN_FSCLOSEREF, &Dblqh::execFSCLOSEREF); addRecSignal(GSN_FSWRITECONF, &Dblqh::execFSWRITECONF); - addRecSignal(GSN_FSWRITEREF, &Dblqh::execFSWRITEREF); + addRecSignal(GSN_FSWRITEREF, &Dblqh::execFSWRITEREF, true); addRecSignal(GSN_FSREADCONF, &Dblqh::execFSREADCONF); - addRecSignal(GSN_FSREADREF, &Dblqh::execFSREADREF); + addRecSignal(GSN_FSREADREF, &Dblqh::execFSREADREF, true); addRecSignal(GSN_ACC_ABORTCONF, &Dblqh::execACC_ABORTCONF); addRecSignal(GSN_SET_VAR_REQ, &Dblqh::execSET_VAR_REQ); addRecSignal(GSN_TIME_SIGNAL, &Dblqh::execTIME_SIGNAL); addRecSignal(GSN_FSSYNCCONF, &Dblqh::execFSSYNCCONF); - addRecSignal(GSN_FSSYNCREF, &Dblqh::execFSSYNCREF); addRecSignal(GSN_REMOVE_MARKER_ORD, &Dblqh::execREMOVE_MARKER_ORD); //addRecSignal(GSN_DROP_TAB_REQ, &Dblqh::execDROP_TAB_REQ); diff --git a/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp b/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp index 05d76f5fb25..5e2e6dc392c 100644 --- a/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp +++ b/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp @@ -11718,14 +11718,6 @@ Dblqh::execFSSYNCCONF(Signal* signal) ccurrentGcprec = RNIL; }//Dblqh::execFSSYNCCONF() -void -Dblqh::execFSSYNCREF(Signal* signal) -{ - jamEntry(); - systemErrorLab(signal); - return; -}//Dblqh::execFSSYNCREF() - /* ######################################################################### */ /* ####### FILE HANDLING MODULE ####### */ @@ -11796,16 +11788,6 @@ void Dblqh::execFSCLOSECONF(Signal* signal) }//switch }//Dblqh::execFSCLOSECONF() -/* ************>> */ -/* FSCLOSEREF > */ -/* ************>> */ -void Dblqh::execFSCLOSEREF(Signal* signal) -{ - jamEntry(); - terrorCode = signal->theData[1]; - systemErrorLab(signal); - return; -}//Dblqh::execFSCLOSEREF() /* ************>> */ /* FSOPENCONF > */ @@ -11894,16 +11876,6 @@ void Dblqh::execFSOPENCONF(Signal* signal) }//switch }//Dblqh::execFSOPENCONF() -/* ************> */ -/* FSOPENREF > */ -/* ************> */ -void Dblqh::execFSOPENREF(Signal* signal) -{ - jamEntry(); - terrorCode = signal->theData[1]; - systemErrorLab(signal); - return; -}//Dblqh::execFSOPENREF() /* ************>> */ /* FSREADCONF > */ @@ -11981,60 +11953,43 @@ void Dblqh::execFSREADREF(Signal* signal) jamEntry(); lfoPtr.i = signal->theData[0]; ptrCheckGuard(lfoPtr, clfoFileSize, logFileOperationRecord); - terrorCode = signal->theData[1]; switch (lfoPtr.p->lfoState) { case LogFileOperationRecord::READ_SR_LAST_MBYTE: jam(); - systemErrorLab(signal); - return; break; case LogFileOperationRecord::READ_SR_FRONTPAGE: jam(); - systemErrorLab(signal); - return; break; case LogFileOperationRecord::READ_SR_LAST_FILE: jam(); - systemErrorLab(signal); - return; break; case LogFileOperationRecord::READ_SR_NEXT_FILE: jam(); - systemErrorLab(signal); - return; break; case LogFileOperationRecord::READ_EXEC_SR: jam(); - systemErrorLab(signal); - return; break; case LogFileOperationRecord::READ_EXEC_LOG: jam(); - systemErrorLab(signal); - return; break; case LogFileOperationRecord::READ_SR_FOURTH_PHASE: jam(); - systemErrorLab(signal); - return; break; case LogFileOperationRecord::READ_SR_FOURTH_ZERO: jam(); - systemErrorLab(signal); - return; break; case LogFileOperationRecord::READ_SR_INVALIDATE_PAGES: jam() - systemErrorLab(signal); - return; break; default: jam(); - systemErrorLab(signal); - return; break; }//switch - return; + { + char msg[100]; + sprintf(msg, "File system read failed during LogFileOperationRecord state %d", (Uint32)lfoPtr.p->lfoState); + fsRefError(signal,__LINE__,msg); + } }//Dblqh::execFSREADREF() /* *************** */ @@ -12115,49 +12070,43 @@ void Dblqh::execFSWRITEREF(Signal* signal) switch (lfoPtr.p->lfoState) { case LogFileOperationRecord::WRITE_PAGE_ZERO: jam(); - systemErrorLab(signal); break; case LogFileOperationRecord::LAST_WRITE_IN_FILE: jam(); - systemErrorLab(signal); break; case LogFileOperationRecord::INIT_WRITE_AT_END: jam(); - systemErrorLab(signal); break; case LogFileOperationRecord::INIT_FIRST_PAGE: jam(); - systemErrorLab(signal); break; case LogFileOperationRecord::WRITE_GCI_ZERO: jam(); - systemErrorLab(signal); break; case LogFileOperationRecord::WRITE_DIRTY: jam(); - systemErrorLab(signal); break; case LogFileOperationRecord::WRITE_INIT_MBYTE: jam(); - systemErrorLab(signal); break; case LogFileOperationRecord::ACTIVE_WRITE_LOG: jam(); - systemErrorLab(signal); break; case LogFileOperationRecord::FIRST_PAGE_WRITE_IN_LOGFILE: jam(); - systemErrorLab(signal); break; case LogFileOperationRecord::WRITE_SR_INVALIDATE_PAGES: jam(); systemErrorLab(signal); - break; default: jam(); - systemErrorLab(signal); break; }//switch + { + char msg[100]; + sprintf(msg, "File system write failed during LogFileOperationRecord state %d", (Uint32)lfoPtr.p->lfoState); + fsRefError(signal,__LINE__,msg); + } }//Dblqh::execFSWRITEREF() diff --git a/ndb/src/kernel/blocks/dbtup/Dbtup.hpp b/ndb/src/kernel/blocks/dbtup/Dbtup.hpp index 06cfd420eac..dffafc1ab66 100644 --- a/ndb/src/kernel/blocks/dbtup/Dbtup.hpp +++ b/ndb/src/kernel/blocks/dbtup/Dbtup.hpp @@ -1051,20 +1051,15 @@ private: void execTUP_SRREQ(Signal* signal); void execTUP_PREPLCPREQ(Signal* signal); void execFSOPENCONF(Signal* signal); - void execFSOPENREF(Signal* signal); void execFSCLOSECONF(Signal* signal); - void execFSCLOSEREF(Signal* signal); void execFSWRITECONF(Signal* signal); - void execFSWRITEREF(Signal* signal); void execFSREADCONF(Signal* signal); - void execFSREADREF(Signal* signal); void execNDB_STTOR(Signal* signal); void execREAD_CONFIG_REQ(Signal* signal); void execSET_VAR_REQ(Signal* signal); void execDROP_TAB_REQ(Signal* signal); void execALTER_TAB_REQ(Signal* signal); void execFSREMOVECONF(Signal* signal); - void execFSREMOVEREF(Signal* signal); void execTUP_ALLOCREQ(Signal* signal); void execTUP_DEALLOCREQ(Signal* signal); void execTUP_WRITELOG_REQ(Signal* signal); diff --git a/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp b/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp index 27f817d8abc..af516d53a24 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include @@ -117,13 +116,9 @@ Dbtup::Dbtup(const class Configuration & conf) addRecSignal(GSN_TUP_SRREQ, &Dbtup::execTUP_SRREQ); addRecSignal(GSN_TUP_PREPLCPREQ, &Dbtup::execTUP_PREPLCPREQ); addRecSignal(GSN_FSOPENCONF, &Dbtup::execFSOPENCONF); - addRecSignal(GSN_FSOPENREF, &Dbtup::execFSOPENREF); addRecSignal(GSN_FSCLOSECONF, &Dbtup::execFSCLOSECONF); - addRecSignal(GSN_FSCLOSEREF, &Dbtup::execFSCLOSEREF); addRecSignal(GSN_FSWRITECONF, &Dbtup::execFSWRITECONF); - addRecSignal(GSN_FSWRITEREF, &Dbtup::execFSWRITEREF); addRecSignal(GSN_FSREADCONF, &Dbtup::execFSREADCONF); - addRecSignal(GSN_FSREADREF, &Dbtup::execFSREADREF); addRecSignal(GSN_NDB_STTOR, &Dbtup::execNDB_STTOR); addRecSignal(GSN_READ_CONFIG_REQ, &Dbtup::execREAD_CONFIG_REQ, true); addRecSignal(GSN_SET_VAR_REQ, &Dbtup::execSET_VAR_REQ); @@ -133,7 +128,6 @@ Dbtup::Dbtup(const class Configuration & conf) addRecSignal(GSN_DROP_TRIG_REQ, &Dbtup::execDROP_TRIG_REQ); addRecSignal(GSN_DROP_TAB_REQ, &Dbtup::execDROP_TAB_REQ); - addRecSignal(GSN_FSREMOVEREF, &Dbtup::execFSREMOVEREF); addRecSignal(GSN_FSREMOVECONF, &Dbtup::execFSREMOVECONF); addRecSignal(GSN_TUP_ALLOCREQ, &Dbtup::execTUP_ALLOCREQ); @@ -263,12 +257,6 @@ void Dbtup::execFSCLOSECONF(Signal* signal) releasePendingFileOpenInfoRecord(pfoPtr); }//Dbtup::execFSCLOSECONF() -void Dbtup::execFSCLOSEREF(Signal* signal) -{ - ljamEntry(); - ndbrequire(false); -}//Dbtup::execFSCLOSEREF() - void Dbtup::execFSOPENCONF(Signal* signal) { PendingFileOpenInfoPtr pfoPtr; @@ -363,12 +351,6 @@ void Dbtup::execFSOPENCONF(Signal* signal) releasePendingFileOpenInfoRecord(pfoPtr); }//Dbtup::execFSOPENCONF() -void Dbtup::execFSOPENREF(Signal* signal) -{ - ljamEntry(); - ndbrequire(false); -}//Dbtup::execFSOPENREF() - void Dbtup::execFSREADCONF(Signal* signal) { DiskBufferSegmentInfoPtr dbsiPtr; @@ -424,12 +406,6 @@ void Dbtup::execFSREADCONF(Signal* signal) }//switch }//Dbtup::execFSREADCONF() -void Dbtup::execFSREADREF(Signal* signal) -{ - ljamEntry(); - ndbrequire(false); -}//Dbtup::execFSREADREF() - void Dbtup::execFSWRITECONF(Signal* signal) { DiskBufferSegmentInfoPtr dbsiPtr; @@ -478,12 +454,6 @@ void Dbtup::execFSWRITECONF(Signal* signal) return; }//Dbtup::execFSWRITECONF() -void Dbtup::execFSWRITEREF(Signal* signal) -{ - ljamEntry(); - ndbrequire(false); -}//Dbtup::execFSWRITEREF() - void Dbtup::execCONTINUEB(Signal* signal) { ljamEntry(); diff --git a/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp b/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp index 405f790954e..c6e33bdc92b 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp @@ -687,10 +687,3 @@ void Dbtup::execFSREMOVECONF(Signal* signal) initTab(tabPtr.p); }//Dbtup::execFSREMOVECONF() -void Dbtup::execFSREMOVEREF(Signal* signal) -{ - ljamEntry(); - ndbrequire(false); -}//Dbtup::execFSREMOVEREF() - - diff --git a/ndb/src/kernel/blocks/ndbcntr/Ndbcntr.hpp b/ndb/src/kernel/blocks/ndbcntr/Ndbcntr.hpp index 639d300d6df..657133bda36 100644 --- a/ndb/src/kernel/blocks/ndbcntr/Ndbcntr.hpp +++ b/ndb/src/kernel/blocks/ndbcntr/Ndbcntr.hpp @@ -309,7 +309,6 @@ private: Uint32 c_fsRemoveCount; Uint32 c_nodeGroup; void clearFilesystem(Signal* signal); - void execFSREMOVEREF(Signal* signal); void execFSREMOVECONF(Signal* signal); NdbNodeBitmask c_allDefinedNodes; diff --git a/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp b/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp index c7b472fc91a..97ca3f44b3a 100644 --- a/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp +++ b/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp @@ -100,7 +100,6 @@ Ndbcntr::Ndbcntr(const class Configuration & conf): addRecSignal(GSN_STTORRY, &Ndbcntr::execSTTORRY); addRecSignal(GSN_READ_CONFIG_CONF, &Ndbcntr::execREAD_CONFIG_CONF); - addRecSignal(GSN_FSREMOVEREF, &Ndbcntr::execFSREMOVEREF); addRecSignal(GSN_FSREMOVECONF, &Ndbcntr::execFSREMOVECONF); initData(); diff --git a/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp b/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp index c80891548cf..2e2c834ad9c 100644 --- a/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp +++ b/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp @@ -144,6 +144,7 @@ void Ndbcntr::execSYSTEM_ERROR(Signal* signal) const SystemError * const sysErr = (SystemError *)signal->getDataPtr(); char buf[100]; int killingNode = refToNode(sysErr->errorRef); + Uint32 data1 = sysErr->data1; jamEntry(); switch (sysErr->errorCode){ @@ -178,8 +179,9 @@ void Ndbcntr::execSYSTEM_ERROR(Signal* signal) case SystemError::CopyFragRefError: BaseString::snprintf(buf, sizeof(buf), "Node %d killed this node because " - "it could not copy a fragment during node restart", - killingNode); + "it could not copy a fragment during node restart. " + "Copy fragment error code: %u.", + killingNode, data1); break; default: @@ -2395,12 +2397,6 @@ Ndbcntr::clearFilesystem(Signal* signal){ c_fsRemoveCount++; } -void -Ndbcntr::execFSREMOVEREF(Signal* signal){ - jamEntry(); - ndbrequire(0); -} - void Ndbcntr::execFSREMOVECONF(Signal* signal){ jamEntry(); diff --git a/ndb/src/kernel/vm/SimulatedBlock.cpp b/ndb/src/kernel/vm/SimulatedBlock.cpp index 94fd5769406..9b52ac65331 100644 --- a/ndb/src/kernel/vm/SimulatedBlock.cpp +++ b/ndb/src/kernel/vm/SimulatedBlock.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include #include "LongSignal.hpp" @@ -140,6 +141,13 @@ SimulatedBlock::installSimulatedBlockFunctions(){ a[GSN_UTIL_UNLOCK_REF] = &SimulatedBlock::execUTIL_UNLOCK_REF; a[GSN_UTIL_UNLOCK_CONF] = &SimulatedBlock::execUTIL_UNLOCK_CONF; a[GSN_READ_CONFIG_REQ] = &SimulatedBlock::execREAD_CONFIG_REQ; + a[GSN_FSOPENREF] = &SimulatedBlock::execFSOPENREF; + a[GSN_FSCLOSEREF] = &SimulatedBlock::execFSCLOSEREF; + a[GSN_FSWRITEREF] = &SimulatedBlock::execFSWRITEREF; + a[GSN_FSREADREF] = &SimulatedBlock::execFSREADREF; + a[GSN_FSREMOVEREF] = &SimulatedBlock::execFSREMOVEREF; + a[GSN_FSSYNCREF] = &SimulatedBlock::execFSSYNCREF; + a[GSN_FSAPPENDREF] = &SimulatedBlock::execFSAPPENDREF; } void @@ -1781,6 +1789,61 @@ SimulatedBlock::execUPGRADE(Signal* signal){ } } +void +SimulatedBlock::fsRefError(Signal* signal, Uint32 line, const char *msg) +{ + const FsRef *fsRef = (FsRef*)signal->getDataPtr(); + Uint32 errorCode = fsRef->errorCode; + Uint32 osErrorCode = fsRef->osErrorCode; + char msg2[100]; + + sprintf(msg2, "%s: %s. OS errno: %u", getBlockName(number()), msg, osErrorCode); + + progError(line, errorCode, msg2); +} + +void +SimulatedBlock::execFSWRITEREF(Signal* signal) +{ + fsRefError(signal, __LINE__, "File system write failed"); +} + +void +SimulatedBlock::execFSREADREF(Signal* signal) +{ + fsRefError(signal, __LINE__, "File system read failed"); +} + +void +SimulatedBlock::execFSCLOSEREF(Signal* signal) +{ + fsRefError(signal, __LINE__, "File system close failed"); +} + +void +SimulatedBlock::execFSOPENREF(Signal* signal) +{ + fsRefError(signal, __LINE__, "File system open failed"); +} + +void +SimulatedBlock::execFSREMOVEREF(Signal* signal) +{ + fsRefError(signal, __LINE__, "File system remove failed"); +} + +void +SimulatedBlock::execFSSYNCREF(Signal* signal) +{ + fsRefError(signal, __LINE__, "File system sync failed"); +} + +void +SimulatedBlock::execFSAPPENDREF(Signal* signal) +{ + fsRefError(signal, __LINE__, "File system append failed"); +} + #ifdef VM_TRACE void SimulatedBlock::clear_global_variables(){ diff --git a/ndb/src/kernel/vm/SimulatedBlock.hpp b/ndb/src/kernel/vm/SimulatedBlock.hpp index 787d14ca5cb..81b4fe7413e 100644 --- a/ndb/src/kernel/vm/SimulatedBlock.hpp +++ b/ndb/src/kernel/vm/SimulatedBlock.hpp @@ -487,6 +487,15 @@ private: protected: void execUPGRADE(Signal* signal); + void fsRefError(Signal* signal, Uint32 line, const char *msg); + void execFSWRITEREF(Signal* signal); + void execFSREADREF(Signal* signal); + void execFSOPENREF(Signal* signal); + void execFSCLOSEREF(Signal* signal); + void execFSREMOVEREF(Signal* signal); + void execFSSYNCREF(Signal* signal); + void execFSAPPENDREF(Signal* signal); + // Variable for storing inserted errors, see pc.H ERROR_INSERT_VARIABLE; From f1fb30a15f6de6260337beae8e4c6a4230ef4a29 Mon Sep 17 00:00:00 2001 From: "evgen@moonbone.local" <> Date: Wed, 31 Aug 2005 18:26:50 +0400 Subject: [PATCH 07/11] Fix bug #12861 client hang with group_concat insubquery FROM DUAL. Item_func_group_concat::fix_fields() set maybe_null flag to 0, and set it to 1 only if some of it's arguments may be null. When used in subquery in tmp table created field which can't be null. When no data retireved result field have to be set to null and error mentioned in bug report occurs. Also this bug can occur if selecting from not null field in empty table. Function group_concat now marked maybe_null from the very beginning not only if some of it's argument may be null. --- mysql-test/r/func_gconcat.result | 3 +++ mysql-test/t/func_gconcat.test | 5 +++++ sql/item_sum.cc | 4 +--- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result index 9faee3cbc01..a6c25fcd26c 100644 --- a/mysql-test/r/func_gconcat.result +++ b/mysql-test/r/func_gconcat.result @@ -548,3 +548,6 @@ FROM t1 JOIN t2 ON t1.bID = t2.bID; COUNT(*) GROUP_CONCAT(DISTINCT t2.somename SEPARATOR ' |') 2 test DROP TABLE t1,t2; +select * from (select group_concat('c') from DUAL) t; +group_concat('c') +NULL diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test index 9793d0d0a2c..827a2813718 100644 --- a/mysql-test/t/func_gconcat.test +++ b/mysql-test/t/func_gconcat.test @@ -343,4 +343,9 @@ SELECT COUNT(*), GROUP_CONCAT(DISTINCT t2.somename SEPARATOR ' |') DROP TABLE t1,t2; +# +# Bug #12861 hang with group_concat insubquery FROM DUAL +# +select * from (select group_concat('c') from DUAL) t; + # End of 4.1 tests diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 74a7fee113e..000dcdb4997 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -1916,7 +1916,7 @@ Item_func_group_concat::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) } thd->allow_sum_func= 0; - maybe_null= 0; + maybe_null= 1; item_thd= thd; /* @@ -1929,8 +1929,6 @@ Item_func_group_concat::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) args[i]->fix_fields(thd, tables, args + i)) || args[i]->check_cols(1)) return 1; - if (i < arg_count_field) - maybe_null|= args[i]->maybe_null; } if (agg_item_charsets(collation, func_name(), From 9a9136899714b64e8c021715e9633340eed8271b Mon Sep 17 00:00:00 2001 From: "tomas@poseidon.ndb.mysql.com" <> Date: Wed, 31 Aug 2005 23:08:58 +0200 Subject: [PATCH 08/11] improved the ndb redo log reader --- .../blocks/dblqh/redoLogReader/records.cpp | 11 + .../blocks/dblqh/redoLogReader/records.hpp | 2 + .../dblqh/redoLogReader/redoLogFileReader.cpp | 260 +++++++----------- 3 files changed, 107 insertions(+), 166 deletions(-) diff --git a/ndb/src/kernel/blocks/dblqh/redoLogReader/records.cpp b/ndb/src/kernel/blocks/dblqh/redoLogReader/records.cpp index 63c271d6b80..ba6d65ca838 100644 --- a/ndb/src/kernel/blocks/dblqh/redoLogReader/records.cpp +++ b/ndb/src/kernel/blocks/dblqh/redoLogReader/records.cpp @@ -239,6 +239,17 @@ bool PageHeader::check() { return true; } +bool PageHeader::lastPage() +{ + return m_next_page == 0xffffff00; +} + +Uint32 PageHeader::lastWord() +{ + return m_current_page_index; +} + + NdbOut& operator<<(NdbOut& no, const PageHeader& ph) { no << "------------PAGE HEADER------------------------" << endl << endl; ndbout_c("%-30s%-12s%-12s\n", "", "Decimal", "Hex"); diff --git a/ndb/src/kernel/blocks/dblqh/redoLogReader/records.hpp b/ndb/src/kernel/blocks/dblqh/redoLogReader/records.hpp index 27f2399abbe..11b8dc4a6fa 100644 --- a/ndb/src/kernel/blocks/dblqh/redoLogReader/records.hpp +++ b/ndb/src/kernel/blocks/dblqh/redoLogReader/records.hpp @@ -132,6 +132,8 @@ class PageHeader { public: bool check(); Uint32 getLogRecordSize(); + bool lastPage(); + Uint32 lastWord(); protected: Uint32 m_checksum; Uint32 m_lap; diff --git a/ndb/src/kernel/blocks/dblqh/redoLogReader/redoLogFileReader.cpp b/ndb/src/kernel/blocks/dblqh/redoLogReader/redoLogFileReader.cpp index cea05aebc64..aa8b1d25e4e 100644 --- a/ndb/src/kernel/blocks/dblqh/redoLogReader/redoLogFileReader.cpp +++ b/ndb/src/kernel/blocks/dblqh/redoLogReader/redoLogFileReader.cpp @@ -35,7 +35,6 @@ #define FROM_BEGINNING 0 void usage(const char * prg); -Uint32 readRecordOverPageBoundary (Uint32 *, Uint32 , Uint32 , Uint32); Uint32 readFromFile(FILE * f, Uint32 *toPtr, Uint32 sizeInWords); void readArguments(int argc, const char** argv); void doExit(); @@ -54,8 +53,8 @@ Uint32 startAtPageIndex = 0; Uint32 *redoLogPage; NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read a redo log file", 16384) { - Uint32 pageIndex = 0; - Uint32 oldPageIndex = 0; + int wordIndex = 0; + int oldWordIndex = 0; Uint32 recordType = 1234567890; PageHeader *thePageHeader; @@ -83,48 +82,47 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read } redoLogPage = new Uint32[PAGESIZE*NO_PAGES_IN_MBYTE]; + Uint32 words_from_previous_page = 0; // Loop for every mbyte. - for (Uint32 j = startAtMbyte; j < NO_MBYTE_IN_FILE; j++) { + bool lastPage = false; + for (Uint32 j = startAtMbyte; j < NO_MBYTE_IN_FILE && !lastPage; j++) { + readFromFile(f, redoLogPage, PAGESIZE*NO_PAGES_IN_MBYTE); - - if (firstLap) { - pageIndex = startAtPageIndex; - firstLap = false; - } else - pageIndex = 0; + + words_from_previous_page = 0; // Loop for every page. - for (int i = startAtPage; i < NO_PAGES_IN_MBYTE; i++) { - - if (pageIndex == 0) { - thePageHeader = (PageHeader *) &redoLogPage[i*PAGESIZE]; - // Print out mbyte number, page number and page index. - ndbout << j << ":" << i << ":" << pageIndex << endl - << " " << j*32 + i << ":" << pageIndex << " "; - if (thePrintFlag) ndbout << (*thePageHeader); - if (theCheckFlag) { - if(!thePageHeader->check()) { - ndbout << "Error in thePageHeader->check()" << endl; - doExit(); - } - - Uint32 checkSum = 37; - for (int ps = 1; ps < PAGESIZE; ps++) - checkSum = redoLogPage[i*PAGESIZE+ps] ^ checkSum; - - if (checkSum != redoLogPage[i*PAGESIZE]){ - ndbout << "WRONG CHECKSUM: checksum = " << redoLogPage[i*PAGESIZE] - << " expected = " << checkSum << endl; - doExit(); - } - else - ndbout << "expected checksum: " << checkSum << endl; - + for (int i = 0; i < NO_PAGES_IN_MBYTE; i++) { + wordIndex = 0; + thePageHeader = (PageHeader *) &redoLogPage[i*PAGESIZE]; + // Print out mbyte number, page number and page index. + ndbout << j << ":" << i << ":" << wordIndex << endl + << " " << j*32 + i << ":" << wordIndex << " "; + if (thePrintFlag) ndbout << (*thePageHeader); + if (theCheckFlag) { + if(!thePageHeader->check()) { + ndbout << "Error in thePageHeader->check()" << endl; + doExit(); } - pageIndex += thePageHeader->getLogRecordSize(); + + Uint32 checkSum = 37; + for (int ps = 1; ps < PAGESIZE; ps++) + checkSum = redoLogPage[i*PAGESIZE+ps] ^ checkSum; + + if (checkSum != redoLogPage[i*PAGESIZE]){ + ndbout << "WRONG CHECKSUM: checksum = " << redoLogPage[i*PAGESIZE] + << " expected = " << checkSum << endl; + doExit(); + } + else + ndbout << "expected checksum: " << checkSum << endl; + } + lastPage = i != 0 && thePageHeader->lastPage(); + Uint32 lastWord = thePageHeader->lastWord(); + if (onlyMbyteHeaders) { // Show only the first page header in every mbyte of the file. break; @@ -132,18 +130,40 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read if (onlyPageHeaders) { // Show only page headers. Continue with the next page in this for loop. - pageIndex = 0; continue; } + + wordIndex = thePageHeader->getLogRecordSize() - words_from_previous_page; + Uint32 *redoLogPagePos = redoLogPage + i*PAGESIZE; + if (words_from_previous_page) + { + memmove(redoLogPagePos + wordIndex , + redoLogPagePos - words_from_previous_page, + words_from_previous_page*4); + } + do { - // Print out mbyte number, page number and page index. - ndbout << j << ":" << i << ":" << pageIndex << endl - << " " << j*32 + i << ":" << pageIndex << " "; - recordType = redoLogPage[i*PAGESIZE + pageIndex]; + if (words_from_previous_page) + { + // Print out mbyte number, page number and word index. + ndbout << j << ":" << i-1 << ":" << PAGESIZE-words_from_previous_page << endl + << j << ":" << i << ":" << wordIndex+words_from_previous_page << endl + << " " << j*32 + i-1 << ":" << PAGESIZE-words_from_previous_page << " "; + words_from_previous_page = 0; + } + else + { + // Print out mbyte number, page number and word index. + ndbout << j << ":" << i << ":" << wordIndex << endl + << " " << j*32 + i << ":" << wordIndex << " "; + } + redoLogPagePos = redoLogPage + i*PAGESIZE + wordIndex; + oldWordIndex = wordIndex; + recordType = *redoLogPagePos; switch(recordType) { case ZFD_TYPE: - fdRecord = (FileDescriptor *) &redoLogPage[i*PAGESIZE + pageIndex]; + fdRecord = (FileDescriptor *) redoLogPagePos; if (thePrintFlag) ndbout << (*fdRecord); if (theCheckFlag) { if(!fdRecord->check()) { @@ -155,13 +175,13 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read delete [] redoLogPage; exit(RETURN_OK); } - pageIndex += fdRecord->getLogRecordSize(); + wordIndex += fdRecord->getLogRecordSize(); break; case ZNEXT_LOG_RECORD_TYPE: - nlRecord = (NextLogRecord *) (&redoLogPage[i*PAGESIZE] + pageIndex); - pageIndex += nlRecord->getLogRecordSize(pageIndex); - if (pageIndex <= PAGESIZE) { + nlRecord = (NextLogRecord *) redoLogPagePos; + wordIndex += nlRecord->getLogRecordSize(wordIndex); + if (wordIndex <= PAGESIZE) { if (thePrintFlag) ndbout << (*nlRecord); if (theCheckFlag) { if(!nlRecord->check()) { @@ -173,9 +193,9 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read break; case ZCOMPLETED_GCI_TYPE: - cGCIrecord = (CompletedGCIRecord *) &redoLogPage[i*PAGESIZE + pageIndex]; - pageIndex += cGCIrecord->getLogRecordSize(); - if (pageIndex <= PAGESIZE) { + cGCIrecord = (CompletedGCIRecord *) redoLogPagePos; + wordIndex += cGCIrecord->getLogRecordSize(); + if (wordIndex <= PAGESIZE) { if (thePrintFlag) ndbout << (*cGCIrecord); if (theCheckFlag) { if(!cGCIrecord->check()) { @@ -187,9 +207,9 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read break; case ZPREP_OP_TYPE: - poRecord = (PrepareOperationRecord *) &redoLogPage[i*PAGESIZE + pageIndex]; - pageIndex += poRecord->getLogRecordSize(); - if (pageIndex <= PAGESIZE) { + poRecord = (PrepareOperationRecord *) redoLogPagePos; + wordIndex += poRecord->getLogRecordSize(); + if (wordIndex <= PAGESIZE) { if (thePrintFlag) ndbout << (*poRecord); if (theCheckFlag) { if(!poRecord->check()) { @@ -198,15 +218,12 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read } } } - else { - oldPageIndex = pageIndex - poRecord->getLogRecordSize(); - } break; case ZCOMMIT_TYPE: - ctRecord = (CommitTransactionRecord *) &redoLogPage[i*PAGESIZE + pageIndex]; - pageIndex += ctRecord->getLogRecordSize(); - if (pageIndex <= PAGESIZE) { + ctRecord = (CommitTransactionRecord *) redoLogPagePos; + wordIndex += ctRecord->getLogRecordSize(); + if (wordIndex <= PAGESIZE) { if (thePrintFlag) ndbout << (*ctRecord); if (theCheckFlag) { if(!ctRecord->check()) { @@ -215,15 +232,12 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read } } } - else { - oldPageIndex = pageIndex - ctRecord->getLogRecordSize(); - } break; case ZINVALID_COMMIT_TYPE: - ictRecord = (InvalidCommitTransactionRecord *) &redoLogPage[i*PAGESIZE + pageIndex]; - pageIndex += ictRecord->getLogRecordSize(); - if (pageIndex <= PAGESIZE) { + ictRecord = (InvalidCommitTransactionRecord *) redoLogPagePos; + wordIndex += ictRecord->getLogRecordSize(); + if (wordIndex <= PAGESIZE) { if (thePrintFlag) ndbout << (*ictRecord); if (theCheckFlag) { if(!ictRecord->check()) { @@ -232,21 +246,18 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read } } } - else { - oldPageIndex = pageIndex - ictRecord->getLogRecordSize(); - } break; case ZNEXT_MBYTE_TYPE: - nmRecord = (NextMbyteRecord *) &redoLogPage[i*PAGESIZE + pageIndex]; + nmRecord = (NextMbyteRecord *) redoLogPagePos; if (thePrintFlag) ndbout << (*nmRecord); i = NO_PAGES_IN_MBYTE; break; case ZABORT_TYPE: - atRecord = (AbortTransactionRecord *) &redoLogPage[i*PAGESIZE + pageIndex]; - pageIndex += atRecord->getLogRecordSize(); - if (pageIndex <= PAGESIZE) { + atRecord = (AbortTransactionRecord *) redoLogPagePos; + wordIndex += atRecord->getLogRecordSize(); + if (wordIndex <= PAGESIZE) { if (thePrintFlag) ndbout << (*atRecord); if (theCheckFlag) { if(!atRecord->check()) { @@ -266,7 +277,7 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read ndbout << " ------ERROR: UNKNOWN RECORD TYPE------" << endl; // Print out remaining data in this page - for (int j = pageIndex; j < PAGESIZE; j++){ + for (int j = wordIndex; j < PAGESIZE; j++){ Uint32 unknown = redoLogPage[i*PAGESIZE + j]; ndbout_c("%-30d%-12u%-12x", j, unknown, unknown); @@ -274,14 +285,18 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read doExit(); } - } while(pageIndex < PAGESIZE && i < NO_PAGES_IN_MBYTE); + } while(wordIndex < lastWord && i < NO_PAGES_IN_MBYTE); - if (pageIndex > PAGESIZE) { - // The last record overlapped page boundary. Must redo that record. - pageIndex = readRecordOverPageBoundary(&redoLogPage[i*PAGESIZE], - pageIndex, oldPageIndex, recordType); + + if (lastPage) + break; + + if (wordIndex > PAGESIZE) { + words_from_previous_page = PAGESIZE - oldWordIndex; + ndbout << " ----------- Record continues on next page -----------" << endl; } else { - pageIndex = 0; + wordIndex = 0; + words_from_previous_page = 0; } ndbout << endl; }//for @@ -310,93 +325,6 @@ Uint32 readFromFile(FILE * f, Uint32 *toPtr, Uint32 sizeInWords) { } -//---------------------------------------------------------------- -// -//---------------------------------------------------------------- - -Uint32 readRecordOverPageBoundary(Uint32 *pagePtr, Uint32 pageIndex, Uint32 oldPageIndex, Uint32 recordType) { - Uint32 pageHeader[PAGEHEADERSIZE]; - Uint32 tmpPages[PAGESIZE*10]; - PageHeader *thePageHeader; - Uint32 recordSize = 0; - - PrepareOperationRecord *poRecord; - CommitTransactionRecord *ctRecord; - InvalidCommitTransactionRecord *ictRecord; - - memcpy(pageHeader, pagePtr + PAGESIZE, PAGEHEADERSIZE*sizeof(Uint32)); - memcpy(tmpPages, pagePtr + oldPageIndex, (PAGESIZE - oldPageIndex)*sizeof(Uint32)); - memcpy(tmpPages + PAGESIZE - oldPageIndex , - (pagePtr + PAGESIZE + PAGEHEADERSIZE), - (PAGESIZE - PAGEHEADERSIZE)*sizeof(Uint32)); - - switch(recordType) { - case ZPREP_OP_TYPE: - poRecord = (PrepareOperationRecord *) tmpPages; - recordSize = poRecord->getLogRecordSize(); - if (recordSize < (PAGESIZE - PAGEHEADERSIZE)) { - if (theCheckFlag) { - if(!poRecord->check()) { - ndbout << "Error in poRecord->check() (readRecordOverPageBoundary)" << endl; - doExit(); - } - } - if (thePrintFlag) ndbout << (*poRecord); - } else { - ndbout << "Error: Record greater than a Page" << endl; - } - break; - - case ZCOMMIT_TYPE: - ctRecord = (CommitTransactionRecord *) tmpPages; - recordSize = ctRecord->getLogRecordSize(); - if (recordSize < (PAGESIZE - PAGEHEADERSIZE)) { - if (theCheckFlag) { - if(!ctRecord->check()) { - ndbout << "Error in ctRecord->check() (readRecordOverPageBoundary)" << endl; - doExit(); - } - } - if (thePrintFlag) ndbout << (*ctRecord); - } else { - ndbout << endl << "Error: Record greater than a Page" << endl; - } - break; - - case ZINVALID_COMMIT_TYPE: - ictRecord = (InvalidCommitTransactionRecord *) tmpPages; - recordSize = ictRecord->getLogRecordSize(); - if (recordSize < (PAGESIZE - PAGEHEADERSIZE)) { - if (theCheckFlag) { - if(!ictRecord->check()) { - ndbout << "Error in ictRecord->check() (readRecordOverPageBoundary)" << endl; - doExit(); - } - } - if (thePrintFlag) ndbout << (*ictRecord); - } else { - ndbout << endl << "Error: Record greater than a Page" << endl; - } - break; - - case ZNEW_PREP_OP_TYPE: - case ZABORT_TYPE: - case ZFRAG_SPLIT_TYPE: - case ZNEXT_MBYTE_TYPE: - ndbout << endl << "Record type = " << recordType << " not implemented." << endl; - return 0; - - default: - ndbout << endl << "Error: Unknown record type. Record type = " << recordType << endl; - return 0; - } - - thePageHeader = (PageHeader *) (pagePtr + PAGESIZE); - if (thePrintFlag) ndbout << (*thePageHeader); - - return PAGEHEADERSIZE - PAGESIZE + oldPageIndex + recordSize; -} - //---------------------------------------------------------------- // //---------------------------------------------------------------- From ce91c0f1c8938af9c1174def4c7d86789737f34f Mon Sep 17 00:00:00 2001 From: "tomas@poseidon.ndb.mysql.com" <> Date: Wed, 31 Aug 2005 23:24:50 +0200 Subject: [PATCH 09/11] added make of ndb sys file printer --- ndb/src/kernel/blocks/dbdih/Makefile.am | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ndb/src/kernel/blocks/dbdih/Makefile.am b/ndb/src/kernel/blocks/dbdih/Makefile.am index d6ad380b806..3b5ae716a63 100644 --- a/ndb/src/kernel/blocks/dbdih/Makefile.am +++ b/ndb/src/kernel/blocks/dbdih/Makefile.am @@ -1,10 +1,16 @@ noinst_LIBRARIES = libdbdih.a +EXTRA_PROGRAMS = ndbd_sysfile_reader libdbdih_a_SOURCES = DbdihInit.cpp DbdihMain.cpp +ndbd_sysfile_reader_SOURCES = printSysfile/printSysfile.cpp include $(top_srcdir)/ndb/config/common.mk.am include $(top_srcdir)/ndb/config/type_kernel.mk.am +LDADD += \ + $(top_builddir)/ndb/src/common/util/libgeneral.la \ + $(top_builddir)/ndb/src/common/portlib/libportlib.la + # Don't update the files from bitkeeper %::SCCS/s.% From 29dc269678b4e55b48dd67a2d1eeb7ab94ab077e Mon Sep 17 00:00:00 2001 From: "tomas@poseidon.ndb.mysql.com" <> Date: Wed, 31 Aug 2005 23:56:02 +0200 Subject: [PATCH 10/11] Bug#12833 corrected parsing of CLUSTERLOG command in ndb_mgm --- ndb/src/mgmclient/CommandInterpreter.cpp | 83 +++++++++++++----------- 1 file changed, 45 insertions(+), 38 deletions(-) diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp index e1619917de5..124c5c18748 100644 --- a/ndb/src/mgmclient/CommandInterpreter.cpp +++ b/ndb/src/mgmclient/CommandInterpreter.cpp @@ -1909,47 +1909,54 @@ CommandInterpreter::executeEventReporting(int processId, return; } BaseString tmp(parameters); - Vector spec; - tmp.split(spec, "="); - if(spec.size() != 2){ - ndbout << "Invalid loglevel specification: " << parameters << endl; - return; - } + Vector specs; + tmp.split(specs, " "); - spec[0].trim().ndb_toupper(); - int category = ndb_mgm_match_event_category(spec[0].c_str()); - if(category == NDB_MGM_ILLEGAL_EVENT_CATEGORY){ - if(!convert(spec[0].c_str(), category) || - category < NDB_MGM_MIN_EVENT_CATEGORY || - category > NDB_MGM_MAX_EVENT_CATEGORY){ - ndbout << "Unknown category: \"" << spec[0].c_str() << "\"" << endl; - return; + for (int i=0; i < specs.size(); i++) + { + Vector spec; + specs[i].split(spec, "="); + if(spec.size() != 2){ + ndbout << "Invalid loglevel specification: " << specs[i] << endl; + continue; + } + + spec[0].trim().ndb_toupper(); + int category = ndb_mgm_match_event_category(spec[0].c_str()); + if(category == NDB_MGM_ILLEGAL_EVENT_CATEGORY){ + if(!convert(spec[0].c_str(), category) || + category < NDB_MGM_MIN_EVENT_CATEGORY || + category > NDB_MGM_MAX_EVENT_CATEGORY){ + ndbout << "Unknown category: \"" << spec[0].c_str() << "\"" << endl; + continue; + } + } + + int level; + if (!convert(spec[1].c_str(),level)) + { + ndbout << "Invalid level: " << spec[1].c_str() << endl; + continue; + } + + ndbout << "Executing CLUSTERLOG " << spec[0] << "=" << spec[1] + << " on node " << processId << flush; + + struct ndb_mgm_reply reply; + int result; + result = ndb_mgm_set_loglevel_clusterlog(m_mgmsrv, + processId, + (ndb_mgm_event_category)category, + level, + &reply); + + if (result != 0) { + ndbout_c(" failed."); + printError(); + } else { + ndbout_c(" OK!"); } } - - int level; - if (!convert(spec[1].c_str(),level)) - { - ndbout << "Invalid level: " << spec[1].c_str() << endl; - return; - } - - ndbout << "Executing CLUSTERLOG on node " << processId << flush; - - struct ndb_mgm_reply reply; - int result; - result = ndb_mgm_set_loglevel_clusterlog(m_mgmsrv, - processId, - (ndb_mgm_event_category)category, - level, - &reply); - - if (result != 0) { - ndbout_c(" failed."); - printError(); - } else { - ndbout_c(" OK!"); - } } /***************************************************************************** From e0f3c5c0fb936fd0ebeee54c07ae16265e9537b9 Mon Sep 17 00:00:00 2001 From: "tomas@poseidon.ndb.mysql.com" <> Date: Thu, 1 Sep 2005 00:13:01 +0200 Subject: [PATCH 11/11] Bug #12043, do not core on misconfig unless debug compiled --- ndb/src/mgmsrv/ConfigInfo.cpp | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/ndb/src/mgmsrv/ConfigInfo.cpp b/ndb/src/mgmsrv/ConfigInfo.cpp index bc078b711dc..cface035174 100644 --- a/ndb/src/mgmsrv/ConfigInfo.cpp +++ b/ndb/src/mgmsrv/ConfigInfo.cpp @@ -2136,7 +2136,17 @@ const int ConfigInfo::m_NoOfParams = sizeof(m_ParamInfo) / sizeof(ParamInfo); /**************************************************************************** * Ctor ****************************************************************************/ -static void require(bool v) { if(!v) abort();} +static void require(bool v) +{ + if(!v) + { +#ifndef DBUG_OFF + abort(); +#else + exit(-1); +#endif + } +} ConfigInfo::ConfigInfo() : m_info(true), m_systemDefaults(true) @@ -2277,7 +2287,7 @@ ConfigInfo::ConfigInfo() ****************************************************************************/ inline void warning(const char * src, const char * arg){ ndbout << "Illegal call to ConfigInfo::" << src << "() - " << arg << endl; - abort(); + require(false); } const Properties * @@ -3394,7 +3404,7 @@ fixDepricated(InitConfigFileParser::Context & ctx, const char * data){ } case PropertiesType_Properties: default: - abort(); + ::require(false); } } return true; @@ -3406,7 +3416,7 @@ static bool saveInConfigValues(InitConfigFileParser::Context & ctx, const char * data){ const Properties * sec; if(!ctx.m_currentInfo->get(ctx.fname, &sec)){ - abort(); + require(false); return false; } @@ -3477,7 +3487,7 @@ saveInConfigValues(InitConfigFileParser::Context & ctx, const char * data){ break; } default: - abort(); + require(false); } require(ok); }