From 120dd92b03e1eb95826f0f353e7e4fdf40da6cdc Mon Sep 17 00:00:00 2001 From: "ramil@mysql.com" <> Date: Fri, 26 Aug 2005 13:23:32 +0500 Subject: [PATCH 1/4] workaround (bug #9613: Some read-only variables are selectable, others are not). --- mysql-test/r/variables.result | 3 +++ mysql-test/t/variables.test | 7 +++++++ sql/set_var.cc | 10 ++++++++++ 3 files changed, 20 insertions(+) diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index 14260cd04f9..efcc3d21144 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -491,3 +491,6 @@ SHOW VARIABLES LIKE 'table_cache'; Variable_name Value table_cache 1 SET GLOBAL table_cache=DEFAULT; +select @@have_innodb; +@@have_innodb +# diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index 7743b70d0cd..f888541f17a 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -381,3 +381,10 @@ SHOW VARIABLES LIKE 'table_cache'; SET GLOBAL table_cache=DEFAULT; # End of 4.1 tests + +# +# Bug #9613: @@have_innodb +# + +--replace_column 1 # +select @@have_innodb; diff --git a/sql/set_var.cc b/sql/set_var.cc index 1b66b68b349..be99a402dc7 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -118,6 +118,7 @@ static KEY_CACHE *create_key_cache(const char *name, uint length); void fix_sql_mode_var(THD *thd, enum_var_type type); static byte *get_error_count(THD *thd); static byte *get_warning_count(THD *thd); +static byte *get_have_innodb(THD *thd); /* Variable definition list @@ -484,6 +485,8 @@ sys_var_thd_time_zone sys_time_zone("time_zone"); /* Read only variables */ sys_var_const_str sys_os("version_compile_os", SYSTEM_TYPE); +sys_var_readonly sys_have_innodb("have_innodb", OPT_GLOBAL, + SHOW_CHAR, get_have_innodb); /* Global read-only variable describing server license */ sys_var_const_str sys_license("license", STRINGIFY_ARG(LICENSE)); @@ -529,6 +532,7 @@ sys_var *sys_variables[]= &sys_ft_boolean_syntax, &sys_foreign_key_checks, &sys_group_concat_max_len, + &sys_have_innodb, &sys_identity, &sys_init_connect, &sys_init_slave, @@ -2614,6 +2618,12 @@ static byte *get_error_count(THD *thd) } +static byte *get_have_innodb(THD *thd) +{ + return (byte*) show_comp_option_name[have_innodb]; +} + + /**************************************************************************** Main handling of variables: - Initialisation From 60df5fffb31961139f8eed38e4700f2380bd34b1 Mon Sep 17 00:00:00 2001 From: "tomas@poseidon.ndb.mysql.com" <> Date: Mon, 29 Aug 2005 18:23:53 +0200 Subject: [PATCH 2/4] updated ndb redo file reader with schemaversion in commit rcord instead of prepare record --- ndb/src/kernel/blocks/dblqh/redoLogReader/records.cpp | 4 ++-- ndb/src/kernel/blocks/dblqh/redoLogReader/records.hpp | 4 ++-- .../blocks/dblqh/redoLogReader/redoLogFileReader.cpp | 11 +++++++++++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/ndb/src/kernel/blocks/dblqh/redoLogReader/records.cpp b/ndb/src/kernel/blocks/dblqh/redoLogReader/records.cpp index 092b7840c20..63c271d6b80 100644 --- a/ndb/src/kernel/blocks/dblqh/redoLogReader/records.cpp +++ b/ndb/src/kernel/blocks/dblqh/redoLogReader/records.cpp @@ -79,6 +79,7 @@ NdbOut& operator<<(NdbOut& no, const CommitTransactionRecord& ctr) { no << "----------COMMIT TRANSACTION RECORD------------" << endl << endl; printOut("Record type:", ctr.m_recordType); printOut("TableId", ctr.m_tableId); + printOut("SchemaVersion:", ctr.m_schemaVersion); printOut("FfragmentId", ctr.m_fragmentId); printOut("File no. of Prep. Op.", ctr.m_fileNumberOfPrepareOperation); printOut("Start page no. of Prep. Op.", ctr.m_startPageNumberOfPrepareOperation); @@ -127,7 +128,7 @@ bool PrepareOperationRecord::check() { if (m_operationType == 3 && m_attributeLength != 0) return false; - if (m_logRecordSize != (m_attributeLength + m_keyLength + 7)) + if (m_logRecordSize != (m_attributeLength + m_keyLength + 6)) return false; return true; @@ -142,7 +143,6 @@ NdbOut& operator<<(NdbOut& no, const PrepareOperationRecord& por) { printOut("Record type:", por.m_recordType); printOut("logRecordSize:", por.m_logRecordSize); printOut("hashValue:", por.m_hashValue); - printOut("schemaVersion:", por.m_schemaVersion); switch (por.m_operationType) { case 0: ndbout_c("%-30s%-12u%-6s", "operationType:", diff --git a/ndb/src/kernel/blocks/dblqh/redoLogReader/records.hpp b/ndb/src/kernel/blocks/dblqh/redoLogReader/records.hpp index e73986e4d73..27f2399abbe 100644 --- a/ndb/src/kernel/blocks/dblqh/redoLogReader/records.hpp +++ b/ndb/src/kernel/blocks/dblqh/redoLogReader/records.hpp @@ -36,7 +36,7 @@ #define NO_PAGES_IN_MBYTE 32 #define NO_MBYTE_IN_FILE 16 -#define COMMITTRANSACTIONRECORDSIZE 8 +#define COMMITTRANSACTIONRECORDSIZE 9 #define COMPLETEDGCIRECORDSIZE 2 #define PAGEHEADERSIZE 32 #define FILEDESCRIPTORHEADERSIZE 3 @@ -89,7 +89,6 @@ protected: Uint32 m_recordType; Uint32 m_logRecordSize; Uint32 m_hashValue; - Uint32 m_schemaVersion; Uint32 m_operationType; // 0 READ, 1 UPDATE, 2 INSERT, 3 DELETE Uint32 m_attributeLength; Uint32 m_keyLength; @@ -190,6 +189,7 @@ public: protected: Uint32 m_recordType; Uint32 m_tableId; + Uint32 m_schemaVersion; Uint32 m_fragmentId; Uint32 m_fileNumberOfPrepareOperation; Uint32 m_startPageNumberOfPrepareOperation; diff --git a/ndb/src/kernel/blocks/dblqh/redoLogReader/redoLogFileReader.cpp b/ndb/src/kernel/blocks/dblqh/redoLogReader/redoLogFileReader.cpp index 67e59c48ea6..cea05aebc64 100644 --- a/ndb/src/kernel/blocks/dblqh/redoLogReader/redoLogFileReader.cpp +++ b/ndb/src/kernel/blocks/dblqh/redoLogReader/redoLogFileReader.cpp @@ -105,6 +105,7 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read if (thePrintFlag) ndbout << (*thePageHeader); if (theCheckFlag) { if(!thePageHeader->check()) { + ndbout << "Error in thePageHeader->check()" << endl; doExit(); } @@ -146,6 +147,7 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read if (thePrintFlag) ndbout << (*fdRecord); if (theCheckFlag) { if(!fdRecord->check()) { + ndbout << "Error in fdRecord->check()" << endl; doExit(); } } @@ -163,6 +165,7 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read if (thePrintFlag) ndbout << (*nlRecord); if (theCheckFlag) { if(!nlRecord->check()) { + ndbout << "Error in nlRecord->check()" << endl; doExit(); } } @@ -176,6 +179,7 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read if (thePrintFlag) ndbout << (*cGCIrecord); if (theCheckFlag) { if(!cGCIrecord->check()) { + ndbout << "Error in cGCIrecord->check()" << endl; doExit(); } } @@ -189,6 +193,7 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read if (thePrintFlag) ndbout << (*poRecord); if (theCheckFlag) { if(!poRecord->check()) { + ndbout << "Error in poRecord->check()" << endl; doExit(); } } @@ -205,6 +210,7 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read if (thePrintFlag) ndbout << (*ctRecord); if (theCheckFlag) { if(!ctRecord->check()) { + ndbout << "Error in ctRecord->check()" << endl; doExit(); } } @@ -221,6 +227,7 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read if (thePrintFlag) ndbout << (*ictRecord); if (theCheckFlag) { if(!ictRecord->check()) { + ndbout << "Error in ictRecord->check()" << endl; doExit(); } } @@ -243,6 +250,7 @@ NDB_COMMAND(redoLogFileReader, "redoLogFileReader", "redoLogFileReader", "Read if (thePrintFlag) ndbout << (*atRecord); if (theCheckFlag) { if(!atRecord->check()) { + ndbout << "Error in atRecord->check()" << endl; doExit(); } } @@ -329,6 +337,7 @@ Uint32 readRecordOverPageBoundary(Uint32 *pagePtr, Uint32 pageIndex, Uint32 old if (recordSize < (PAGESIZE - PAGEHEADERSIZE)) { if (theCheckFlag) { if(!poRecord->check()) { + ndbout << "Error in poRecord->check() (readRecordOverPageBoundary)" << endl; doExit(); } } @@ -344,6 +353,7 @@ Uint32 readRecordOverPageBoundary(Uint32 *pagePtr, Uint32 pageIndex, Uint32 old if (recordSize < (PAGESIZE - PAGEHEADERSIZE)) { if (theCheckFlag) { if(!ctRecord->check()) { + ndbout << "Error in ctRecord->check() (readRecordOverPageBoundary)" << endl; doExit(); } } @@ -359,6 +369,7 @@ Uint32 readRecordOverPageBoundary(Uint32 *pagePtr, Uint32 pageIndex, Uint32 old if (recordSize < (PAGESIZE - PAGEHEADERSIZE)) { if (theCheckFlag) { if(!ictRecord->check()) { + ndbout << "Error in ictRecord->check() (readRecordOverPageBoundary)" << endl; doExit(); } } From 9f45c8f2fe77a557e4bc523f306cfec5e1561984 Mon Sep 17 00:00:00 2001 From: "pgalbraith@mysql.com" <> Date: Mon, 29 Aug 2005 21:22:06 +0200 Subject: [PATCH 3/4] ha_blackhole.cc: Added missing DBUG enter, compiled and tested on production with debug-max build (my regular build missed the previous errors friday) Changeset: Added missing DBUG_ENTER, compiled and tested on production with debug-max build! --- sql/ha_blackhole.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/sql/ha_blackhole.cc b/sql/ha_blackhole.cc index b8ae92e3d10..ccfbadf6a91 100644 --- a/sql/ha_blackhole.cc +++ b/sql/ha_blackhole.cc @@ -133,6 +133,7 @@ THR_LOCK_DATA **ha_blackhole::store_lock(THD *thd, THR_LOCK_DATA **to, enum thr_lock_type lock_type) { + DBUG_ENTER("ha_blackhole::store_lock"); DBUG_RETURN(to); } From 162353250ea998b0c942f54ba936a1992cea878e Mon Sep 17 00:00:00 2001 From: "pgalbraith@mysql.com" <> Date: Tue, 30 Aug 2005 02:46:03 +0200 Subject: [PATCH 4/4] ha_blackhole.cc: Found one more missing DBUG_ENTER. compile-pentium-debug-max does not enable blackhole on 4.1! --- sql/ha_blackhole.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/sql/ha_blackhole.cc b/sql/ha_blackhole.cc index ccfbadf6a91..9ac4ba2da15 100644 --- a/sql/ha_blackhole.cc +++ b/sql/ha_blackhole.cc @@ -126,6 +126,7 @@ int ha_blackhole::external_lock(THD *thd, int lock_type) uint ha_blackhole::lock_count(void) const { + DBUG_ENTER("ha_blackhole::lock_count"); DBUG_RETURN(0); }