From 2fd0748ce67e8f6dc805c0ec3efa1948079afddd Mon Sep 17 00:00:00 2001 From: Luis Soares Date: Thu, 24 Jun 2010 19:03:23 +0100 Subject: BUG#54509: rpl_show_slave_running crashes the server sporadically Problem: SQL and IO thread were racing for the IO_CACHE. The former to flush it, the latter to close it. In some cases this would cause the SQL thread to lock an invalid IO_CACHE mutex (it had been destroyed by IO thread). This would happen when SQL thread was initializing the master.info Solution: We solve this by locking the log and checking if it is hot. If it is we keep the log while seeking. Otherwise we release it right away, because a log can get from hot to cold, but not from cold to hot. --- sql/rpl_mi.cc | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/sql/rpl_mi.cc b/sql/rpl_mi.cc index 9b0450b3f02..443af94e0d0 100644 --- a/sql/rpl_mi.cc +++ b/sql/rpl_mi.cc @@ -164,7 +164,29 @@ int init_master_info(Master_info* mi, const char* master_info_fname, */ if (thread_mask & SLAVE_SQL) { + bool hot_log= FALSE; + /* + my_b_seek does an implicit flush_io_cache, so we need to: + + 1. check if this log is active (hot) + 2. if it is we keep log_lock until the seek ends, otherwise + release it right away. + + If we did not take log_lock, SQL thread might race with IO + thread for the IO_CACHE mutex. + + */ + mysql_mutex_t *log_lock= mi->rli.relay_log.get_log_lock(); + mysql_mutex_lock(log_lock); + hot_log= mi->rli.relay_log.is_active(mi->rli.linfo.log_file_name); + + if (!hot_log) + mysql_mutex_unlock(log_lock); + my_b_seek(mi->rli.cur_log, (my_off_t) 0); + + if (hot_log) + mysql_mutex_unlock(log_lock); } DBUG_RETURN(0); } -- cgit v1.2.1 From e0ece40b6415876a4e230a733958b9fc0be1f9f7 Mon Sep 17 00:00:00 2001 From: Luis Soares Date: Tue, 29 Jun 2010 11:54:58 +0100 Subject: BUG#54842: DROP TEMPORARY TABLE not binlogged after manual switching binlog format to ROW BUG 52616 fixed the case which the user would switch from STMT to ROW binlog format, but the server would silently ignore it. After that fix thd->is_current_stmt_binlog_format_row() reports correct value at logging time and events are logged in ROW (as expected) instead of STMT as they were previously and wrongly logged. However, the fix was only partially complete, because on disconnect, at THD cleanup, the implicit logging of temporary tables is conditionally performed. If the binlog_format==ROW and thd->is_current_stmt_binlog_format_row() is true then DROPs are not logged. Given that the user can switch from STMT to ROW, this is wrong because the server cannot tell, just by relying on the ROW binlog format, that the tables have been dropped before. This is effectively similar to the MIXED scenario when a switch from STMT to ROW is triggered. We fix this by removing this condition from close_temporary_tables. mysql-test/extra/binlog_tests/drop_temp_table.test: Added binlog test case. mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result: Result changes because: - there is a missing drop on three temporary tables - it now contains results for the test added mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result: Result now contains the implicit drop for the temporary table. mysql-test/suite/binlog/r/binlog_stm_drop_tmp_tbl.result: Result file changed because it now contains results for added test case. mysql-test/suite/rpl/r/rpl_drop_temp.result: Result file changed because it now contains results for added test case. mysql-test/suite/rpl/t/rpl_drop_temp.test: Added replication test case. sql/sql_base.cc: Removed the condition that would make the server to skip logging implicit drops when ROW binary log format mode was in use. Additionally, deployed DBUG_ENTER/RETURN macros. --- mysql-test/extra/binlog_tests/drop_temp_table.test | 30 ++++++++++++++++++++++ .../suite/binlog/r/binlog_row_drop_tmp_tbl.result | 19 ++++++++++++++ .../binlog/r/binlog_row_mix_innodb_myisam.result | 1 + .../suite/binlog/r/binlog_stm_drop_tmp_tbl.result | 19 ++++++++++++++ mysql-test/suite/rpl/r/rpl_drop_temp.result | 21 +++++++++++++++ mysql-test/suite/rpl/t/rpl_drop_temp.test | 28 ++++++++++++++++++++ sql/sql_base.cc | 9 ++++--- 7 files changed, 123 insertions(+), 4 deletions(-) diff --git a/mysql-test/extra/binlog_tests/drop_temp_table.test b/mysql-test/extra/binlog_tests/drop_temp_table.test index 63833c10c14..c852ee4c8a0 100644 --- a/mysql-test/extra/binlog_tests/drop_temp_table.test +++ b/mysql-test/extra/binlog_tests/drop_temp_table.test @@ -69,4 +69,34 @@ let $VERSION=`SELECT VERSION()`; source include/show_binlog_events.inc; DROP DATABASE `drop-temp+table-test`; + +# +# Bug #54842: DROP TEMPORARY TABLE not binlogged after manual switching binlog format to ROW +# +# Sanity test. Checking that implicit DROP event is logged. +# +# After BUG#52616, the switch to ROW mode becomes effective even +# if there are open temporary tables. As such the implicit drop +# for temporary tables on session closing must be logged. +# + +RESET MASTER; + +CREATE TABLE t1 ( i text ); + +--connect(con1,localhost,root,,) +CREATE TEMPORARY TABLE ttmp1 ( i text ); +SET @@session.binlog_format=ROW; +INSERT INTO t1 VALUES ('1'); +SELECT @@session.binlog_format; +--disconnect con1 + +-- connection default +--let $wait_binlog_event= DROP +--source include/wait_for_binlog_event.inc +-- source include/show_binlog_events.inc +RESET MASTER; + +DROP TABLE t1; + # End of 4.1 tests diff --git a/mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result b/mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result index a43ed03b774..24e779eee8e 100644 --- a/mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result +++ b/mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result @@ -33,4 +33,23 @@ master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE I master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TABLE IF EXISTS `t` /* generated by server */ master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS `tmp2` /* generated by server */ master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TABLE IF EXISTS tmp2, t +master-bin.000001 # Query # # use `drop-temp+table-test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `shortn2`,`table:name`,`shortn1` DROP DATABASE `drop-temp+table-test`; +RESET MASTER; +CREATE TABLE t1 ( i text ); +CREATE TEMPORARY TABLE ttmp1 ( i text ); +SET @@session.binlog_format=ROW; +INSERT INTO t1 VALUES ('1'); +SELECT @@session.binlog_format; +@@session.binlog_format +ROW +show binlog events from ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 ( i text ) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `ttmp1` +RESET MASTER; +DROP TABLE t1; diff --git a/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result b/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result index 86da7468892..699c824844f 100644 --- a/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result +++ b/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result @@ -297,6 +297,7 @@ master-bin.000001 # Table_map # # table_id: # (test.t0) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; create table t2 (n int) engine=innodb +master-bin.000001 # Query # # use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`,`ti` do release_lock("lock1"); drop table t0,t2; set autocommit=0; diff --git a/mysql-test/suite/binlog/r/binlog_stm_drop_tmp_tbl.result b/mysql-test/suite/binlog/r/binlog_stm_drop_tmp_tbl.result index 19ddcf49080..79f09b2d1ee 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_drop_tmp_tbl.result +++ b/mysql-test/suite/binlog/r/binlog_stm_drop_tmp_tbl.result @@ -42,3 +42,22 @@ master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TABLE IF EXISTS t master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TABLE IF EXISTS tmp2, t master-bin.000001 # Query # # use `drop-temp+table-test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `shortn2`,`table:name`,`shortn1` DROP DATABASE `drop-temp+table-test`; +RESET MASTER; +CREATE TABLE t1 ( i text ); +CREATE TEMPORARY TABLE ttmp1 ( i text ); +SET @@session.binlog_format=ROW; +INSERT INTO t1 VALUES ('1'); +SELECT @@session.binlog_format; +@@session.binlog_format +ROW +show binlog events from ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 ( i text ) +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE ttmp1 ( i text ) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `ttmp1` +RESET MASTER; +DROP TABLE t1; diff --git a/mysql-test/suite/rpl/r/rpl_drop_temp.result b/mysql-test/suite/rpl/r/rpl_drop_temp.result index 03fbaa2256f..726b8f2fe54 100644 --- a/mysql-test/suite/rpl/r/rpl_drop_temp.result +++ b/mysql-test/suite/rpl/r/rpl_drop_temp.result @@ -26,3 +26,24 @@ CREATE TEMPORARY TABLE tmp3 (a int); DROP TEMPORARY TABLE tmp3; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE; +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; +CREATE TABLE t1 ( i INT ); +SHOW STATUS LIKE 'Slave_open_temp_tables'; +Variable_name Value +Slave_open_temp_tables 0 +CREATE TEMPORARY TABLE ttmp1 ( i INT ); +SET SESSION binlog_format=ROW; +SHOW STATUS LIKE 'Slave_open_temp_tables'; +Variable_name Value +Slave_open_temp_tables 0 +show binlog events from ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 ( i INT ) +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE ttmp1 ( i INT ) +master-bin.000001 # Query # # use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `ttmp1` +DROP TABLE t1; diff --git a/mysql-test/suite/rpl/t/rpl_drop_temp.test b/mysql-test/suite/rpl/t/rpl_drop_temp.test index f2a4dd70da6..7bc55c53447 100644 --- a/mysql-test/suite/rpl/t/rpl_drop_temp.test +++ b/mysql-test/suite/rpl/t/rpl_drop_temp.test @@ -66,4 +66,32 @@ START SLAVE; connection master; sync_slave_with_master; + +# +# BUG#54842: DROP TEMPORARY TABLE not binlogged after manual switching binlog format to ROW +# + +-- connection master +-- source include/master-slave-reset.inc +-- connection master + +CREATE TABLE t1 ( i INT ); +--sync_slave_with_master +SHOW STATUS LIKE 'Slave_open_temp_tables'; + +--connect(con1,localhost,root,,) +CREATE TEMPORARY TABLE ttmp1 ( i INT ); +SET SESSION binlog_format=ROW; +--disconnect con1 + +-- connection master +--let $wait_binlog_event= DROP +--source include/wait_for_binlog_event.inc +--sync_slave_with_master +SHOW STATUS LIKE 'Slave_open_temp_tables'; + +--connection master +--source include/show_binlog_events.inc +DROP TABLE t1; + # End of 4.1 tests diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 78862985e97..a83c0b1c1fd 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -1636,6 +1636,7 @@ static inline uint tmpkeyval(THD *thd, TABLE *table) void close_temporary_tables(THD *thd) { + DBUG_ENTER("close_temporary_tables"); TABLE *table; TABLE *next= NULL; TABLE *prev_table; @@ -1643,10 +1644,9 @@ void close_temporary_tables(THD *thd) bool was_quote_show= TRUE; if (!thd->temporary_tables) - return; + DBUG_VOID_RETURN; - if (!mysql_bin_log.is_open() || - (thd->is_current_stmt_binlog_format_row() && thd->variables.binlog_format == BINLOG_FORMAT_ROW)) + if (!mysql_bin_log.is_open()) { TABLE *tmp_next; for (table= thd->temporary_tables; table; table= tmp_next) @@ -1655,7 +1655,7 @@ void close_temporary_tables(THD *thd) close_temporary(table, 1, 1); } thd->temporary_tables= 0; - return; + DBUG_VOID_RETURN; } /* Better add "if exists", in case a RESET MASTER has been done */ @@ -1771,6 +1771,7 @@ void close_temporary_tables(THD *thd) if (!was_quote_show) thd->variables.option_bits&= ~OPTION_QUOTE_SHOW_CREATE; /* restore option */ thd->temporary_tables=0; + DBUG_VOID_RETURN; } /* -- cgit v1.2.1 From a849e86070bd7f0ce8d340cc30e139c0b3cd53df Mon Sep 17 00:00:00 2001 From: Alexander Nozdrin Date: Wed, 30 Jun 2010 13:27:38 +0400 Subject: Disable lowercase_table3.test due to Bug 54845. Sort disabled.def. --- mysql-test/t/disabled.def | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index 7b14c332233..62d11e35922 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -10,9 +10,10 @@ # ############################################################################## kill : Bug#37780 2008-12-03 HHunger need some changes to be robust enough for pushbuild. -query_cache_28249 : Bug#43861 2009-03-25 main.query_cache_28249 fails sporadically -sp_sync : Bug#48157 2010-02-06 5.5-m3 demands a differnt solution -plugin_load : Bug#42144 2009-12-21 alik plugin_load fails -partition_innodb_plugin : Bug#53307 2010-04-30 VasilDimov valgrind warnings +lowercase_table3 : Bug#54845 2010-06-30 alik main.lowercase_table3 on Mac OSX mysqlhotcopy_myisam : bug#54129 2010-06-04 Horst mysqlhotcopy_archive : bug#54129 2010-06-04 Horst +plugin_load : Bug#42144 2009-12-21 alik plugin_load fails +partition_innodb_plugin : Bug#53307 2010-04-30 VasilDimov valgrind warnings +query_cache_28249 : Bug#43861 2009-03-25 main.query_cache_28249 fails sporadically +sp_sync : Bug#48157 2010-02-06 5.5-m3 demands a differnt solution -- cgit v1.2.1 From 1134fe2fdb97b3e408a8f5d79e4bed469063cdb0 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Wed, 30 Jun 2010 14:10:29 +0200 Subject: Bug #52850: mysqld-debug.pdb doesn't match mysqld-debug.exe in 5.5.3 on windows Fix: - Do not rename PDB, install mysqld.pdb matching mysqld-debug.exe into bin\debug subdirectory - Stack tracing code will now additionally look in debug subdirectory of the application directory for debug symbols. - Small cleanup in stacktracing code: link with dbghelp rather than load functions dynamically at runtime, since dbghelp.dll is always present. - Install debug binaries with WiX cmake/install_macros.cmake: Add optional COMPONENT and PDB_DESTINATION to INSTALL_DEBUG_TARGET mysys/stacktrace.c: If binary is build with DBUG, also look in debug subdirectory of executable directory. Packaging will put some PDBs there (e.g bin\mysqld-debug.exe will have corresponding pdb in bin\debug) Also some cleanup: do not load dbghelp dynamically, instead link with it. dbghelp is present on all Windows starting with XP. packaging/WiX/CPackWixConfig.cmake: Install debug binaries sql/CMakeLists.txt: Do not rename PDB for mysqld-debug.exe, install it in debug subdirectory --- cmake/install_macros.cmake | 22 ++++-- mysys/stacktrace.c | 153 +++++++++++++------------------------ packaging/WiX/CPackWixConfig.cmake | 9 ++- sql/CMakeLists.txt | 5 +- 4 files changed, 81 insertions(+), 108 deletions(-) diff --git a/cmake/install_macros.cmake b/cmake/install_macros.cmake index 07aa4500188..56a540fde89 100644 --- a/cmake/install_macros.cmake +++ b/cmake/install_macros.cmake @@ -250,7 +250,7 @@ SET(DEBUGBUILDDIR "${BINARY_PARENTDIR}/debug" CACHE INTERNAL "Directory of debug FUNCTION(INSTALL_DEBUG_TARGET target) CMAKE_PARSE_ARGUMENTS(ARG - "DESTINATION;RENAME" + "DESTINATION;RENAME;PDB_DESTINATION;COMPONENT" "" ${ARGN} ) @@ -269,6 +269,9 @@ FUNCTION(INSTALL_DEBUG_TARGET target) ELSE() STRING(REPLACE "${CMAKE_CFG_INTDIR}" "Debug" debug_target_location "${target_location}" ) ENDIF() + IF(NOT ARG_COMPONENT) + SET(ARG_COMPONENT DebugBinaries) + ENDIF() # Define permissions # For executable files @@ -305,19 +308,26 @@ FUNCTION(INSTALL_DEBUG_TARGET target) ${RENAME_PARAM} ${PERMISSIONS_${target_type}} CONFIGURATIONS Release RelWithDebInfo + COMPONENT ${ARG_COMPONENT} OPTIONAL) IF(MSVC) GET_FILENAME_COMPONENT(ext ${debug_target_location} EXT) STRING(REPLACE "${ext}" ".pdb" debug_pdb_target_location "${debug_target_location}" ) - IF(RENAME_PARAM) - STRING(REPLACE "${ext}" ".pdb" "${ARG_RENAME}" pdb_rename) - SET(PDB_RENAME_PARAM RENAME ${pdb_rename}) + IF (RENAME_PARAM) + IF(NOT ARG_PDB_DESTINATION) + STRING(REPLACE "${ext}" ".pdb" "${ARG_RENAME}" pdb_rename) + SET(PDB_RENAME_PARAM RENAME "${pdb_rename}") + ENDIF() + ENDIF() + IF(NOT ARG_PDB_DESTINATION) + SET(ARG_PDB_DESTINATION "${ARG_DESTINATION}") ENDIF() INSTALL(FILES ${debug_pdb_target_location} - DESTINATION ${ARG_DESTINATION} - ${RPDB_RENAME_PARAM} + DESTINATION ${ARG_PDB_DESTINATION} + ${PDB_RENAME_PARAM} CONFIGURATIONS Release RelWithDebInfo + COMPONENT ${ARG_COMPONENT} OPTIONAL) ENDIF() ENDFUNCTION() diff --git a/mysys/stacktrace.c b/mysys/stacktrace.c index f1b96cd03da..675910d2b20 100644 --- a/mysys/stacktrace.c +++ b/mysys/stacktrace.c @@ -334,44 +334,9 @@ void my_write_core(int sig) #include #include - -/* - Stack tracing on Windows is implemented using Debug Helper library(dbghelp.dll) - We do not redistribute dbghelp and the one comes with older OS (up to Windows 2000) - is missing some important functions like functions StackWalk64 or MinidumpWriteDump. - Hence, we have to load functions at runtime using LoadLibrary/GetProcAddress. -*/ - -typedef DWORD (WINAPI *SymSetOptions_FctType)(DWORD dwOptions); -typedef BOOL (WINAPI *SymGetModuleInfo64_FctType) - (HANDLE,DWORD64,PIMAGEHLP_MODULE64) ; -typedef BOOL (WINAPI *SymGetSymFromAddr64_FctType) - (HANDLE,DWORD64,PDWORD64,PIMAGEHLP_SYMBOL64) ; -typedef BOOL (WINAPI *SymGetLineFromAddr64_FctType) - (HANDLE,DWORD64,PDWORD,PIMAGEHLP_LINE64); -typedef BOOL (WINAPI *SymInitialize_FctType) - (HANDLE,PSTR,BOOL); -typedef BOOL (WINAPI *StackWalk64_FctType) - (DWORD,HANDLE,HANDLE,LPSTACKFRAME64,PVOID,PREAD_PROCESS_MEMORY_ROUTINE64, - PFUNCTION_TABLE_ACCESS_ROUTINE64,PGET_MODULE_BASE_ROUTINE64 , - PTRANSLATE_ADDRESS_ROUTINE64); -typedef BOOL (WINAPI *MiniDumpWriteDump_FctType)( - IN HANDLE hProcess, - IN DWORD ProcessId, - IN HANDLE hFile, - IN MINIDUMP_TYPE DumpType, - IN CONST PMINIDUMP_EXCEPTION_INFORMATION ExceptionParam, OPTIONAL - IN CONST PMINIDUMP_USER_STREAM_INFORMATION UserStreamParam, OPTIONAL - IN CONST PMINIDUMP_CALLBACK_INFORMATION CallbackParam OPTIONAL - ); - -static SymSetOptions_FctType pSymSetOptions; -static SymGetModuleInfo64_FctType pSymGetModuleInfo64; -static SymGetSymFromAddr64_FctType pSymGetSymFromAddr64; -static SymInitialize_FctType pSymInitialize; -static StackWalk64_FctType pStackWalk64; -static SymGetLineFromAddr64_FctType pSymGetLineFromAddr64; -static MiniDumpWriteDump_FctType pMiniDumpWriteDump; +#if _MSC_VER +#pragma comment(lib, "dbghelp") +#endif static EXCEPTION_POINTERS *exception_ptrs; @@ -382,50 +347,24 @@ void my_init_stacktrace() { } -/* - Dynamically load dbghelp functions -*/ -BOOL init_dbghelp_functions() -{ - static BOOL first_time= TRUE; - static BOOL rc; - HMODULE hDbghlp; - - if(first_time) - { - first_time= FALSE; - hDbghlp= LoadLibrary("dbghelp"); - if(!hDbghlp) - { - rc= FALSE; - return rc; - } - pSymSetOptions= (SymSetOptions_FctType) - GetProcAddress(hDbghlp,"SymSetOptions"); - pSymInitialize= (SymInitialize_FctType) - GetProcAddress(hDbghlp,"SymInitialize"); - pSymGetModuleInfo64= (SymGetModuleInfo64_FctType) - GetProcAddress(hDbghlp,"SymGetModuleInfo64"); - pSymGetLineFromAddr64= (SymGetLineFromAddr64_FctType) - GetProcAddress(hDbghlp,"SymGetLineFromAddr64"); - pSymGetSymFromAddr64=(SymGetSymFromAddr64_FctType) - GetProcAddress(hDbghlp,"SymGetSymFromAddr64"); - pStackWalk64= (StackWalk64_FctType) - GetProcAddress(hDbghlp,"StackWalk64"); - pMiniDumpWriteDump = (MiniDumpWriteDump_FctType) - GetProcAddress(hDbghlp,"MiniDumpWriteDump"); - - rc = (BOOL)(pSymSetOptions && pSymInitialize && pSymGetModuleInfo64 - && pSymGetLineFromAddr64 && pSymGetSymFromAddr64 && pStackWalk64); - } - return rc; -} void my_set_exception_pointers(EXCEPTION_POINTERS *ep) { exception_ptrs = ep; } +/* + Appends directory to symbol path. +*/ +static void add_to_symbol_path(char *path, size_t path_buffer_size, + char *dir, size_t dir_buffer_size) +{ + strcat_s(dir, dir_buffer_size, ";"); + if (!strstr(path, dir)) + { + strcat_s(path, path_buffer_size, dir); + } +} /* Get symbol path - semicolon-separated list of directories to search for debug @@ -437,8 +376,28 @@ static void get_symbol_path(char *path, size_t size) { HANDLE hSnap; char *envvar; + char *p; +#ifndef DBUG_OFF + static char pdb_debug_dir[MAX_PATH + 7]; +#endif path[0]= '\0'; + +#ifndef DBUG_OFF + /* + Add "debug" subdirectory of the application directory, sometimes PDB will + placed here by installation. + */ + GetModuleFileName(NULL, pdb_debug_dir, MAX_PATH); + p= strrchr(pdb_debug_dir, '\\'); + if(p) + { + *p= 0; + strcat_s(pdb_debug_dir, sizeof(pdb_debug_dir), "\\debug;"); + add_to_symbol_path(path, size, pdb_debug_dir, sizeof(pdb_debug_dir)); + } +#endif + /* Enumerate all modules, and add their directories to the path. Avoid duplicate entries. @@ -452,7 +411,7 @@ static void get_symbol_path(char *path, size_t size) for (ret= Module32First(hSnap, &mod); ret; ret= Module32Next(hSnap, &mod)) { char *module_dir= mod.szExePath; - char *p= strrchr(module_dir,'\\'); + p= strrchr(module_dir,'\\'); if (!p) { /* @@ -460,29 +419,23 @@ static void get_symbol_path(char *path, size_t size) will indicate current directory. */ module_dir[0]= '.'; - p= module_dir + 1; + module_dir[1]= '\0'; } - *p++= ';'; - *p= '\0'; - - if (!strstr(path, module_dir)) + else { - size_t dir_len = strlen(module_dir); - if (size > dir_len) - { - strncat(path, module_dir, size-1); - size -= dir_len; - } + *p= '\0'; } + add_to_symbol_path(path, size, module_dir,sizeof(mod.szExePath)); } CloseHandle(hSnap); } + /* Add _NT_SYMBOL_PATH, if present. */ envvar= getenv("_NT_SYMBOL_PATH"); - if(envvar && size) + if(envvar) { - strncat(path, envvar, size-1); + strcat_s(path, size, envvar); } } @@ -506,15 +459,15 @@ void my_print_stacktrace(uchar* unused1, ulong unused2) STACKFRAME64 frame={0}; static char symbol_path[MAX_SYMBOL_PATH]; - if(!exception_ptrs || !init_dbghelp_functions()) + if(!exception_ptrs) return; /* Copy context, as stackwalking on original will unwind the stack */ context = *(exception_ptrs->ContextRecord); /*Initialize symbols.*/ - pSymSetOptions(SYMOPT_LOAD_LINES|SYMOPT_NO_PROMPTS|SYMOPT_DEFERRED_LOADS|SYMOPT_DEBUG); + SymSetOptions(SYMOPT_LOAD_LINES|SYMOPT_NO_PROMPTS|SYMOPT_DEFERRED_LOADS|SYMOPT_DEBUG); get_symbol_path(symbol_path, sizeof(symbol_path)); - pSymInitialize(hProcess, symbol_path, TRUE); + SymInitialize(hProcess, symbol_path, TRUE); /*Prepare stackframe for the first StackWalk64 call*/ frame.AddrFrame.Mode= frame.AddrPC.Mode= frame.AddrStack.Mode= AddrModeFlat; @@ -546,11 +499,11 @@ void my_print_stacktrace(uchar* unused1, ulong unused2) BOOL have_symbol= FALSE; BOOL have_source= FALSE; - if(!pStackWalk64(machine, hProcess, hThread, &frame, &context, 0, 0, 0 ,0)) + if(!StackWalk64(machine, hProcess, hThread, &frame, &context, 0, 0, 0 ,0)) break; addr= frame.AddrPC.Offset; - have_module= pSymGetModuleInfo64(hProcess,addr,&module); + have_module= SymGetModuleInfo64(hProcess,addr,&module); #ifdef _M_IX86 if(!have_module) { @@ -560,13 +513,13 @@ void my_print_stacktrace(uchar* unused1, ulong unused2) happy, pretend passing the old structure. */ module.SizeOfStruct= MODULE64_SIZE_WINXP; - have_module= pSymGetModuleInfo64(hProcess, addr, &module); + have_module= SymGetModuleInfo64(hProcess, addr, &module); } #endif - have_symbol= pSymGetSymFromAddr64(hProcess, addr, &function_offset, + have_symbol= SymGetSymFromAddr64(hProcess, addr, &function_offset, &(package.sym)); - have_source= pSymGetLineFromAddr64(hProcess, addr, &line_offset, &line); + have_source= SymGetLineFromAddr64(hProcess, addr, &line_offset, &line); fprintf(stderr, "%p ", addr); if(have_module) @@ -610,7 +563,7 @@ void my_write_core(int unused) MINIDUMP_EXCEPTION_INFORMATION info; HANDLE hFile; - if(!exception_ptrs || !init_dbghelp_functions() || !pMiniDumpWriteDump) + if(!exception_ptrs) return; info.ExceptionPointers= exception_ptrs; @@ -628,7 +581,7 @@ void my_write_core(int unused) if(hFile) { /* Create minidump */ - if(pMiniDumpWriteDump(GetCurrentProcess(), GetCurrentProcessId(), + if(MiniDumpWriteDump(GetCurrentProcess(), GetCurrentProcessId(), hFile, MiniDumpNormal, &info, 0, 0)) { fprintf(stderr, "Minidump written to %s\n", diff --git a/packaging/WiX/CPackWixConfig.cmake b/packaging/WiX/CPackWixConfig.cmake index 9577574bbaf..6fdc5b46f9a 100644 --- a/packaging/WiX/CPackWixConfig.cmake +++ b/packaging/WiX/CPackWixConfig.cmake @@ -7,7 +7,7 @@ IF(ESSENTIALS) SET(CPACK_PACKAGE_FILE_NAME "mysql-essentials-${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH}-win${bits}") ELSE() SET(CPACK_COMPONENTS_USED - "Server;Client;DataFiles;Development;SharedLibraries;Embedded;Debuginfo;Documentation;IniFiles;Readme;Server_Scripts") + "Server;Client;DataFiles;Development;SharedLibraries;Embedded;Debuginfo;Documentation;IniFiles;Readme;Server_Scripts;DebugBinaries") ENDIF() @@ -45,6 +45,13 @@ SET(CPACK_COMPONENT_GROUP_MYSQLSERVER_DESCRIPTION "Install MySQL Server") SET(CPACK_COMPONENT_CLIENT_DISPLAY_NAME "Client Programs") SET(CPACK_COMPONENT_CLIENT_DESCRIPTION "Various helpful (commandline) tools including the mysql command line client" ) + # Subfeature "Debug binaries" + SET(CPACK_COMPONENT_DEBUGBINARIES_GROUP "MySQLServer") + SET(CPACK_COMPONENT_DEBUGBINARIES_DISPLAY_NAME "Debug binaries") + SET(CPACK_COMPONENT_DEBUGBINARIES_DESCRIPTION + "Debug/trace versions of executables and libraries" ) + #SET(CPACK_COMPONENT_DEBUGBINARIES_WIX_LEVEL 2) + #Subfeature "Data Files" SET(CPACK_COMPONENT_DATAFILES_GROUP "MySQLServer") diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt index ca5738f116e..7107a68ee84 100755 --- a/sql/CMakeLists.txt +++ b/sql/CMakeLists.txt @@ -156,7 +156,10 @@ IF(WITH_MYSQLD_LDFLAGS) SET_TARGET_PROPERTIES(mysqld PROPERTIES LINK_FLAGS "${MYSQLD_LINK_FLAGS} ${WITH_MYSQLD_LDFLAGS}") ENDIF() -INSTALL_DEBUG_TARGET(mysqld DESTINATION ${INSTALL_SBINDIR} RENAME mysqld-debug) +INSTALL_DEBUG_TARGET(mysqld + DESTINATION ${INSTALL_SBINDIR} + PDB_DESTINATION ${INSTALL_SBINDIR}/debug + RENAME mysqld-debug) # Handle out-of-source build from source package with possibly broken # bison. Copy bison output to from source to build directory, if not already -- cgit v1.2.1 From c9221a2a6fe471512b5bf5a0b4b396856b3f0ba9 Mon Sep 17 00:00:00 2001 From: Alfranio Correia Date: Wed, 30 Jun 2010 16:25:13 +0100 Subject: BUG#53259 Unsafe statement binlogged in statement format w/MyIsam temp tables BUG#54872 MBR: replication failure caused by using tmp table inside transaction Changed criteria to classify a statement as unsafe in order to reduce the number of spurious warnings. So a statement is classified as unsafe when there is on-going transaction at any point of the execution if: 1. The mixed statement is about to update a transactional table and a non-transactional table. 2. The mixed statement is about to update a temporary transactional table and a non-transactional table. 3. The mixed statement is about to update a transactional table and read from a non-transactional table. 4. The mixed statement is about to update a temporary transactional table and read from a non-transactional table. 5. The mixed statement is about to update a non-transactional table and read from a transactional table when the isolation level is lower than repeatable read. After updating a transactional table if: 6. The mixed statement is about to update a non-transactional table and read from a temporary transactional table. 7. The mixed statement is about to update a non-transactional table and read from a temporary transactional table. 8. The mixed statement is about to update a non-transactionala table and read from a temporary non-transactional table. 9. The mixed statement is about to update a temporary non-transactional table and update a non-transactional table. 10. The mixed statement is about to update a temporary non-transactional table and read from a non-transactional table. 11. A statement is about to update a non-transactional table and the option variables.binlog_direct_non_trans_update is OFF. The reason for this is that locks acquired may not protected a concurrent transaction of interfering in the current execution and by consequence in the result. So the patch reduced the number of spurious unsafe warnings. Besides we fixed a regression caused by BUG#51894, which makes temporary tables to go into the trx-cache if there is an on-going transaction. In MIXED mode, the patch for BUG#51894 ignores that the trx-cache may have updates to temporary non-transactional tables that must be written to the binary log while rolling back the transaction. So we fix this problem by writing the content of the trx-cache to the binary log while rolling back a transaction if a non-transactional temporary table was updated and the binary logging format is MIXED. --- .../extra/rpl_tests/rpl_binlog_max_cache_size.test | 4 +- .../suite/binlog/r/binlog_multi_engine.result | 5 +- mysql-test/suite/binlog/r/binlog_stm_binlog.result | 4 +- .../binlog/r/binlog_stm_mix_innodb_myisam.result | 8 +- mysql-test/suite/ndb/r/ndb_binlog_format.result | 2 - .../suite/rpl/r/rpl_begin_commit_rollback.result | 2 - .../suite/rpl/r/rpl_concurrency_error.result | 8 - .../rpl/r/rpl_mixed_binlog_max_cache_size.result | 2 +- .../suite/rpl/r/rpl_mixed_mixing_engines.result | 924 +++++---------------- .../r/rpl_non_direct_mixed_mixing_engines.result | 256 ++---- .../rpl/r/rpl_non_direct_stm_mixing_engines.result | 31 - .../rpl/r/rpl_stm_binlog_max_cache_size.result | 20 - .../suite/rpl/r/rpl_stm_mixing_engines.result | 112 --- .../suite/rpl/r/rpl_stm_stop_middle_group.result | 2 - mysql-test/suite/rpl/r/rpl_temp_temporary.result | 16 +- .../rpl/t/rpl_non_direct_mixed_mixing_engines.test | 2 - mysql-test/t/innodb_mysql_lock2.test | 4 + sql/log.cc | 68 +- sql/log.h | 1 + sql/log_event.cc | 10 +- sql/sql_class.cc | 299 ++++--- sql/sql_class.h | 126 ++- sql/sql_parse.cc | 3 +- 23 files changed, 626 insertions(+), 1283 deletions(-) diff --git a/mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test b/mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test index dd5f9907a21..1fb6b3dcb8a 100644 --- a/mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test +++ b/mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test @@ -77,11 +77,11 @@ eval UPDATE t2, t1 SET t2.data = CONCAT($data, $data, $data, $data), connection slave; --source include/wait_for_slave_sql_to_stop.inc -if (`SELECT @@binlog_format = 'STATEMENT'`) +if (`SELECT @@binlog_format = 'STATEMENT' || @@binlog_format = 'MIXED'`) { SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1; } -if (`SELECT @@binlog_format = 'ROW' || @@binlog_format = 'MIXED'`) +if (`SELECT @@binlog_format = 'ROW'`) { SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 2; } diff --git a/mysql-test/suite/binlog/r/binlog_multi_engine.result b/mysql-test/suite/binlog/r/binlog_multi_engine.result index b0ec756b651..d0febc3f8bc 100644 --- a/mysql-test/suite/binlog/r/binlog_multi_engine.result +++ b/mysql-test/suite/binlog/r/binlog_multi_engine.result @@ -7,8 +7,6 @@ SET SESSION BINLOG_FORMAT=STATEMENT; INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2); INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2); UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c; -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. The last event before the COMMIT is use `test`; UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c *** Please look in binlog_multi_engine.test if you have a diff here **** START TRANSACTION; @@ -73,6 +71,9 @@ mysqld-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) mysqld-bin.000001 # Write_rows # # table_id: # mysqld-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F mysqld-bin.000001 # Query # # COMMIT +mysqld-bin.000001 # Query # # BEGIN +mysqld-bin.000001 # Query # # use `test`; UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c +mysqld-bin.000001 # Query # # COMMIT mysqld-bin.000001 # Query # # use `test`; TRUNCATE t1m mysqld-bin.000001 # Query # # use `test`; TRUNCATE t1b mysqld-bin.000001 # Query # # use `test`; TRUNCATE t1n diff --git a/mysql-test/suite/binlog/r/binlog_stm_binlog.result b/mysql-test/suite/binlog/r/binlog_stm_binlog.result index e5efc26f0cb..c491d23c21b 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_binlog.result +++ b/mysql-test/suite/binlog/r/binlog_stm_binlog.result @@ -635,7 +635,9 @@ COERCIBILITY(NAME_CONST('s1', _utf8'test' COLLATE utf8_unicode_ci)) d2, COERCIBILITY(s1) d3; DROP TEMPORARY TABLE tmp1; END -master-bin.000001 # Query # # use `bug39182`; DROP TEMPORARY TABLE IF EXISTS `tmp1` /* generated by server */ +master-bin.000001 # Query # # use `bug39182`; CREATE TEMPORARY TABLE tmp1 +SELECT * FROM t1 WHERE a LIKE CONCAT("%", NAME_CONST('s1',_utf8'test' COLLATE 'utf8_unicode_ci'), "%") +master-bin.000001 # Query # # use `bug39182`; DROP TEMPORARY TABLE tmp1 DROP PROCEDURE p1; DROP TABLE t1; DROP DATABASE bug39182; diff --git a/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result b/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result index 9bf6f4de144..7c83c1c13a5 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result +++ b/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result @@ -110,8 +110,6 @@ delete from t2; reset master; insert into t1 values(9); insert into t2 select * from t1; -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN @@ -126,8 +124,6 @@ reset master; insert into t1 values(10); begin; insert into t2 select * from t1; -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN @@ -245,8 +241,6 @@ Warnings: Warning 1196 Some non-transactional changed tables couldn't be rolled back create table t0 (n int); insert t0 select * from t1; -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. set autocommit=1; insert into t0 select GET_LOCK("lock1",null); Warnings: @@ -288,7 +282,7 @@ master-bin.000001 # Query # # use `test`; create temporary table t1 (a int) engi master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; insert t1 values (1) -master-bin.000001 # Query # # ROLLBACK +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; create table t0 (n int) master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; insert t0 select * from t1 diff --git a/mysql-test/suite/ndb/r/ndb_binlog_format.result b/mysql-test/suite/ndb/r/ndb_binlog_format.result index 909d122bfc6..b6022b61746 100644 --- a/mysql-test/suite/ndb/r/ndb_binlog_format.result +++ b/mysql-test/suite/ndb/r/ndb_binlog_format.result @@ -8,8 +8,6 @@ SET SESSION BINLOG_FORMAT=STATEMENT; INSERT INTO t1 VALUES (1,1), (1,2), (2,1), (2,2); INSERT INTO t2 VALUES (1,1), (1,2), (2,1), (2,2); UPDATE t1, t2 SET m = 2, b = 3 WHERE n = c; -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. START TRANSACTION; INSERT INTO t3 VALUES (1,1), (1,2), (2,1), (2,2); UPDATE t1, t3 SET m = 2, e = 3 WHERE n = f; diff --git a/mysql-test/suite/rpl/r/rpl_begin_commit_rollback.result b/mysql-test/suite/rpl/r/rpl_begin_commit_rollback.result index 1ed7e0116a2..a65ee7d208e 100644 --- a/mysql-test/suite/rpl/r/rpl_begin_commit_rollback.result +++ b/mysql-test/suite/rpl/r/rpl_begin_commit_rollback.result @@ -72,8 +72,6 @@ before call db1.p1() INSERT INTO db1.t2 VALUES ('before call db1.p2()'); BEGIN; CALL db1.p2(); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. ROLLBACK; INSERT INTO db1.t2 VALUES ('after call db1.p2()'); SELECT * FROM db1.t1; diff --git a/mysql-test/suite/rpl/r/rpl_concurrency_error.result b/mysql-test/suite/rpl/r/rpl_concurrency_error.result index 013f02c3a86..eb303c46f28 100644 --- a/mysql-test/suite/rpl/r/rpl_concurrency_error.result +++ b/mysql-test/suite/rpl/r/rpl_concurrency_error.result @@ -29,8 +29,6 @@ UPDATE t SET f = 'magenta 2' WHERE f = 'red'; ERROR HY000: Lock wait timeout exceeded; try restarting transaction INSERT INTO t VALUES (5 + (2 * 10),"brown"); INSERT INTO n VALUES (now(),"brown"); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. COMMIT; ROLLBACK; Warnings: @@ -58,8 +56,6 @@ UPDATE t SET f = 'dark blue 2' WHERE f = 'red'; ERROR HY000: Lock wait timeout exceeded; try restarting transaction INSERT INTO t VALUES (6 + (2 * 10),"brown"); INSERT INTO n VALUES (now(),"brown"); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. COMMIT; COMMIT; show binlog events from ; @@ -83,8 +79,6 @@ UPDATE t SET f = 'magenta 1' WHERE f = 'red'; ERROR HY000: Lock wait timeout exceeded; try restarting transaction INSERT INTO t VALUES (5 + (1 * 10),"brown"); INSERT INTO n VALUES (now(),"brown"); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. COMMIT; ROLLBACK; Warnings: @@ -110,8 +104,6 @@ UPDATE t SET f = 'dark blue 1' WHERE f = 'red'; ERROR HY000: Lock wait timeout exceeded; try restarting transaction INSERT INTO t VALUES (6 + (1 * 10),"brown"); INSERT INTO n VALUES (now(),"brown"); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. COMMIT; COMMIT; show binlog events from ; diff --git a/mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result b/mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result index 3ebe54df9dc..1ad34fbe961 100644 --- a/mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result +++ b/mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result @@ -19,7 +19,7 @@ SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1; START SLAVE SQL_THREAD; *** Single statement on both transactional and non-transactional tables. *** Got one of the listed errors -SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 2; +SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1; START SLAVE SQL_THREAD; source include/diff_master_slave.inc; ######################################################################################## diff --git a/mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result index e7e4e1b8aa4..f3a0254f6a4 100644 --- a/mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result +++ b/mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result @@ -393,15 +393,13 @@ master-bin.000001 # Query # # COMMIT INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 23, 1, COUNT(*) FROM tt_1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 23, 1, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 23, 1, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- @@ -409,15 +407,13 @@ master-bin.000001 # Query # # COMMIT INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 24, 1, COUNT(*) FROM nt_1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 24, 1, COUNT(*) FROM nt_1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> nT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> nT << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 24, 1, COUNT(*) FROM nt_1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> nT << -e-e-e-e-e-e-e-e-e-e-e- @@ -425,23 +421,13 @@ master-bin.000001 # Xid # # COMMIT /* XID */ UPDATE nt_3, tt_3 SET nt_3.info= "new text 25 --> 1", tt_3.info= "new text 25 --> 1" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_3) -master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_3) -master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; UPDATE nt_3, tt_3 SET nt_3.info= "new text 25 --> 1", tt_3.info= "new text 25 --> 1" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> NT << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_3) -master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_3) -master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; UPDATE nt_3, tt_3 SET nt_3.info= "new text 25 --> 1", tt_3.info= "new text 25 --> 1" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- @@ -449,23 +435,13 @@ master-bin.000001 # Xid # # COMMIT /* XID */ INSERT INTO nt_4(trans_id, stmt_id) VALUES (26, 1); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_4) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_4) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (26, 1) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_4) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_4) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (26, 1) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- @@ -473,35 +449,13 @@ master-bin.000001 # Xid # # COMMIT /* XID */ INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (27, 1, fc_i_tt_5_suc(27, 1)); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -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 # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_5) -master-bin.000001 # Table_map # # table_id: # (test.tt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (27, 1, fc_i_tt_5_suc(27, 1)) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -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 # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_5) -master-bin.000001 # Table_map # # table_id: # (test.tt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (27, 1, fc_i_tt_5_suc(27, 1)) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- @@ -509,23 +463,13 @@ master-bin.000001 # Xid # # COMMIT /* XID */ UPDATE tt_4, nt_4 SET tt_4.info= "new text 28 --> 1", nt_4.info= "new text 28 --> 1" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_4) -master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_4) -master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; UPDATE tt_4, nt_4 SET tt_4.info= "new text 28 --> 1", nt_4.info= "new text 28 --> 1" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_4) -master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_4) -master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; UPDATE tt_4, nt_4 SET tt_4.info= "new text 28 --> 1", nt_4.info= "new text 28 --> 1" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- @@ -533,23 +477,13 @@ master-bin.000001 # Xid # # COMMIT /* XID */ INSERT INTO tt_3(trans_id, stmt_id) VALUES (29, 1); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_3) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_3) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (29, 1) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_3) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_3) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (29, 1) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- @@ -557,35 +491,13 @@ master-bin.000001 # Xid # # COMMIT /* XID */ INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (30, 1, fc_i_nt_5_suc(30, 1)); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # -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 # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_5) -master-bin.000001 # Table_map # # table_id: # (test.tt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (30, 1, fc_i_nt_5_suc(30, 1)) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # -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 # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_5) -master-bin.000001 # Table_map # # table_id: # (test.tt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (30, 1, fc_i_nt_5_suc(30, 1)) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- @@ -604,15 +516,13 @@ INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 31, 1, COUNT(*) FROM tt_1 UNION Got one of the listed errors Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 31, 1, COUNT(*) FROM tt_1 UNION SELECT 23, 1, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> tNe << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> tNe << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 31, 1, COUNT(*) FROM tt_1 UNION SELECT 23, 1, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> tNe << -e-e-e-e-e-e-e-e-e-e-e- @@ -630,16 +540,14 @@ INSERT INTO nt_4(trans_id, stmt_id) VALUES (33, 1), (26, 1); Got one of the listed errors Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_4) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (33, 1), (26, 1) +master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> NeT-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> NeT-trig << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_4) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (33, 1), (26, 1) +master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> NeT-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> NeT-func << -b-b-b-b-b-b-b-b-b-b-b- @@ -647,20 +555,14 @@ INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (34, 1, ''), (30, 2, fc_i_tt_5_ Got one of the listed errors Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -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 `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (34, 1, ''), (30, 2, fc_i_tt_5_suc (34, 1)) +master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> NeT-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> NeT-func << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -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 `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (34, 1, ''), (30, 2, fc_i_tt_5_suc (34, 1)) +master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> NeT-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TeN-trig << -b-b-b-b-b-b-b-b-b-b-b- @@ -668,16 +570,14 @@ INSERT INTO tt_3(trans_id, stmt_id) VALUES (35, 1), (29, 1); Got one of the listed errors Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_3) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (35, 1), (29, 1) +master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> TeN-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TeN-trig << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_3) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (35, 1), (29, 1) +master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> TeN-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TeN-func << -b-b-b-b-b-b-b-b-b-b-b- @@ -685,24 +585,14 @@ INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (36, 1, ''), (30, 1, fc_i_nt_5_ Got one of the listed errors Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # -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 `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (36, 1, ''), (30, 1, fc_i_nt_5_suc (36, 1)) +master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> TeN-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TeN-func << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # -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 `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (36, 1, ''), (30, 1, fc_i_nt_5_suc (36, 1)) +master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> TeN-func << -e-e-e-e-e-e-e-e-e-e-e- @@ -3711,8 +3601,7 @@ Log_name Pos Event_type Server_id End_log_pos Info INSERT INTO nt_1(trans_id, stmt_id) VALUES (133, 4); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (133, 4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -3725,8 +3614,7 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> B T N C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (133, 4) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (133, 2) @@ -3745,10 +3633,7 @@ Log_name Pos Event_type Server_id End_log_pos Info INSERT INTO nt_5(trans_id, stmt_id) VALUES (134, 4); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (134, 4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -3761,10 +3646,7 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> B T N-trig C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (134, 4) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (134, 2) @@ -3785,12 +3667,7 @@ fc_i_nt_5_suc (135, 4) fc_i_nt_5_suc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(135,4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -3803,12 +3680,7 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> B T N-func C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(135,4) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (135, 2) @@ -3827,16 +3699,10 @@ Log_name Pos Event_type Server_id End_log_pos Info CALL pc_i_nt_5_suc (136, 4); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',136), NAME_CONST('in_stmt_id',1)) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',136), NAME_CONST('in_stmt_id',1) + 1) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -3849,16 +3715,10 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> B T N-proc C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',136), NAME_CONST('in_stmt_id',1)) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',136), NAME_CONST('in_stmt_id',1) + 1) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (136, 2) @@ -3877,8 +3737,7 @@ Log_name Pos Event_type Server_id End_log_pos Info INSERT INTO nt_1(trans_id, stmt_id) VALUES (137, 4); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (137, 4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -3891,8 +3750,7 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> B T-trig N C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (137, 4) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (137, 2) @@ -3911,10 +3769,7 @@ Log_name Pos Event_type Server_id End_log_pos Info INSERT INTO nt_5(trans_id, stmt_id) VALUES (138, 4); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (138, 4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -3927,10 +3782,7 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> B T-trig N-trig C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (138, 4) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (138, 2) @@ -3951,12 +3803,7 @@ fc_i_nt_5_suc (139, 4) fc_i_nt_5_suc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(139,4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -3969,12 +3816,7 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> B T-trig N-func C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(139,4) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (139, 2) @@ -3993,16 +3835,10 @@ Log_name Pos Event_type Server_id End_log_pos Info CALL pc_i_nt_5_suc (140, 4); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',140), NAME_CONST('in_stmt_id',1)) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',140), NAME_CONST('in_stmt_id',1) + 1) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -4015,16 +3851,10 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> B T-trig N-proc C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',140), NAME_CONST('in_stmt_id',1)) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',140), NAME_CONST('in_stmt_id',1) + 1) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (140, 2) @@ -4045,8 +3875,7 @@ Log_name Pos Event_type Server_id End_log_pos Info INSERT INTO nt_1(trans_id, stmt_id) VALUES (141, 4); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (141, 4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -4059,8 +3888,7 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> B T-func N C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (141, 4) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(141,2) @@ -4081,10 +3909,7 @@ Log_name Pos Event_type Server_id End_log_pos Info INSERT INTO nt_5(trans_id, stmt_id) VALUES (142, 4); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (142, 4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -4097,10 +3922,7 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> B T-func N-trig C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (142, 4) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(142,2) @@ -4123,12 +3945,7 @@ fc_i_nt_5_suc (143, 4) fc_i_nt_5_suc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(143,4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -4141,12 +3958,7 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> B T-func N-func C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(143,4) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(143,2) @@ -4167,16 +3979,10 @@ Log_name Pos Event_type Server_id End_log_pos Info CALL pc_i_nt_5_suc (144, 4); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',144), NAME_CONST('in_stmt_id',1)) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',144), NAME_CONST('in_stmt_id',1) + 1) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -4189,16 +3995,10 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> B T-func N-proc C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',144), NAME_CONST('in_stmt_id',1)) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',144), NAME_CONST('in_stmt_id',1) + 1) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(144,2) @@ -4217,8 +4017,7 @@ Log_name Pos Event_type Server_id End_log_pos Info INSERT INTO nt_1(trans_id, stmt_id) VALUES (145, 4); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (145, 4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -4232,8 +4031,7 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> B T-proc N C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (145, 4) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',145), NAME_CONST('in_stmt_id',1)) @@ -4253,10 +4051,7 @@ Log_name Pos Event_type Server_id End_log_pos Info INSERT INTO nt_5(trans_id, stmt_id) VALUES (146, 4); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (146, 4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -4270,10 +4065,7 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> B T-proc N-trig C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (146, 4) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',146), NAME_CONST('in_stmt_id',1)) @@ -4295,12 +4087,7 @@ fc_i_nt_5_suc (147, 4) fc_i_nt_5_suc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(147,4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -4314,12 +4101,7 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> B T-proc N-func C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(147,4) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',147), NAME_CONST('in_stmt_id',1)) @@ -4339,16 +4121,10 @@ Log_name Pos Event_type Server_id End_log_pos Info CALL pc_i_nt_5_suc (148, 4); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',148), NAME_CONST('in_stmt_id',1)) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',148), NAME_CONST('in_stmt_id',1) + 1) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -4362,16 +4138,10 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> B T-proc N-proc C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',148), NAME_CONST('in_stmt_id',1)) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',148), NAME_CONST('in_stmt_id',1) + 1) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',148), NAME_CONST('in_stmt_id',1)) @@ -4487,8 +4257,7 @@ INSERT INTO nt_1(trans_id, stmt_id) VALUES (152, 4), (150, 4); Got one of the listed errors Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (152, 4), (150, 4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> Ne << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -4501,8 +4270,7 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> B T Ne C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (152, 4), (150, 4) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (152, 2) @@ -4531,8 +4299,7 @@ Log_name Pos Event_type Server_id End_log_pos Info INSERT INTO nt_1(trans_id, stmt_id) VALUES (153, 4); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (153, 4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -4544,8 +4311,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> B T N R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (153, 4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B T N R << -e-e-e-e-e-e-e-e-e-e-e- @@ -4561,10 +4327,7 @@ Log_name Pos Event_type Server_id End_log_pos Info INSERT INTO nt_5(trans_id, stmt_id) VALUES (154, 4); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (154, 4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -4576,10 +4339,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> B T N-trig R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (154, 4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B T N-trig R << -e-e-e-e-e-e-e-e-e-e-e- @@ -4597,12 +4357,7 @@ fc_i_nt_5_suc (155, 4) fc_i_nt_5_suc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(155,4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -4614,12 +4369,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> B T N-func R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(155,4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B T N-func R << -e-e-e-e-e-e-e-e-e-e-e- @@ -4635,16 +4385,10 @@ Log_name Pos Event_type Server_id End_log_pos Info CALL pc_i_nt_5_suc (156, 4); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',156), NAME_CONST('in_stmt_id',1)) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',156), NAME_CONST('in_stmt_id',1) + 1) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -4656,16 +4400,10 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> B T N-proc R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',156), NAME_CONST('in_stmt_id',1)) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',156), NAME_CONST('in_stmt_id',1) + 1) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B T N-proc R << -e-e-e-e-e-e-e-e-e-e-e- @@ -4681,8 +4419,7 @@ Log_name Pos Event_type Server_id End_log_pos Info INSERT INTO nt_1(trans_id, stmt_id) VALUES (157, 4); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (157, 4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -4694,8 +4431,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> B T-trig N R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (157, 4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B T-trig N R << -e-e-e-e-e-e-e-e-e-e-e- @@ -4711,10 +4447,7 @@ Log_name Pos Event_type Server_id End_log_pos Info INSERT INTO nt_5(trans_id, stmt_id) VALUES (158, 4); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (158, 4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -4726,10 +4459,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> B T-trig N-trig R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (158, 4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B T-trig N-trig R << -e-e-e-e-e-e-e-e-e-e-e- @@ -4747,12 +4477,7 @@ fc_i_nt_5_suc (159, 4) fc_i_nt_5_suc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(159,4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -4764,12 +4489,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> B T-trig N-func R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(159,4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B T-trig N-func R << -e-e-e-e-e-e-e-e-e-e-e- @@ -4785,16 +4505,10 @@ Log_name Pos Event_type Server_id End_log_pos Info CALL pc_i_nt_5_suc (160, 4); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',160), NAME_CONST('in_stmt_id',1)) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',160), NAME_CONST('in_stmt_id',1) + 1) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -4806,16 +4520,10 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> B T-trig N-proc R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',160), NAME_CONST('in_stmt_id',1)) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',160), NAME_CONST('in_stmt_id',1) + 1) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B T-trig N-proc R << -e-e-e-e-e-e-e-e-e-e-e- @@ -4833,8 +4541,7 @@ Log_name Pos Event_type Server_id End_log_pos Info INSERT INTO nt_1(trans_id, stmt_id) VALUES (161, 4); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (161, 4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -4846,8 +4553,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> B T-func N R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (161, 4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B T-func N R << -e-e-e-e-e-e-e-e-e-e-e- @@ -4865,10 +4571,7 @@ Log_name Pos Event_type Server_id End_log_pos Info INSERT INTO nt_5(trans_id, stmt_id) VALUES (162, 4); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (162, 4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -4880,10 +4583,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> B T-func N-trig R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (162, 4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B T-func N-trig R << -e-e-e-e-e-e-e-e-e-e-e- @@ -4903,12 +4603,7 @@ fc_i_nt_5_suc (163, 4) fc_i_nt_5_suc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(163,4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -4920,12 +4615,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> B T-func N-func R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(163,4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B T-func N-func R << -e-e-e-e-e-e-e-e-e-e-e- @@ -4943,16 +4633,10 @@ Log_name Pos Event_type Server_id End_log_pos Info CALL pc_i_nt_5_suc (164, 4); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',164), NAME_CONST('in_stmt_id',1)) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',164), NAME_CONST('in_stmt_id',1) + 1) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -4964,16 +4648,10 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> B T-func N-proc R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',164), NAME_CONST('in_stmt_id',1)) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',164), NAME_CONST('in_stmt_id',1) + 1) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B T-func N-proc R << -e-e-e-e-e-e-e-e-e-e-e- @@ -4989,8 +4667,7 @@ Log_name Pos Event_type Server_id End_log_pos Info INSERT INTO nt_1(trans_id, stmt_id) VALUES (165, 4); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (165, 4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -5002,8 +4679,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> B T-proc N R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (165, 4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B T-proc N R << -e-e-e-e-e-e-e-e-e-e-e- @@ -5019,10 +4695,7 @@ Log_name Pos Event_type Server_id End_log_pos Info INSERT INTO nt_5(trans_id, stmt_id) VALUES (166, 4); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (166, 4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -5034,10 +4707,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> B T-proc N-trig R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (166, 4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B T-proc N-trig R << -e-e-e-e-e-e-e-e-e-e-e- @@ -5055,12 +4725,7 @@ fc_i_nt_5_suc (167, 4) fc_i_nt_5_suc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(167,4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -5072,12 +4737,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> B T-proc N-func R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(167,4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B T-proc N-func R << -e-e-e-e-e-e-e-e-e-e-e- @@ -5093,16 +4753,10 @@ Log_name Pos Event_type Server_id End_log_pos Info CALL pc_i_nt_5_suc (168, 4); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',168), NAME_CONST('in_stmt_id',1)) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',168), NAME_CONST('in_stmt_id',1) + 1) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -5114,16 +4768,10 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> B T-proc N-proc R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',168), NAME_CONST('in_stmt_id',1)) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',168), NAME_CONST('in_stmt_id',1) + 1) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B T-proc N-proc R << -e-e-e-e-e-e-e-e-e-e-e- @@ -5233,8 +4881,7 @@ INSERT INTO nt_1(trans_id, stmt_id) VALUES (172, 4), (170, 4); Got one of the listed errors Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (172, 4), (170, 4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> Ne << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -5246,8 +4893,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> B T Ne R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (172, 4), (170, 4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B T Ne R << -e-e-e-e-e-e-e-e-e-e-e- @@ -5673,16 +5319,10 @@ Log_name Pos Event_type Server_id End_log_pos Info CALL pc_i_nt_5_suc (185, 2); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',185), NAME_CONST('in_stmt_id',1)) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',185), NAME_CONST('in_stmt_id',1) + 1) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- @@ -5699,16 +5339,10 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> B N-proc T C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',185), NAME_CONST('in_stmt_id',1)) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',185), NAME_CONST('in_stmt_id',1) + 1) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (185, 4) @@ -5723,16 +5357,10 @@ Log_name Pos Event_type Server_id End_log_pos Info CALL pc_i_nt_5_suc (186, 2); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',186), NAME_CONST('in_stmt_id',1)) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',186), NAME_CONST('in_stmt_id',1) + 1) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- @@ -5749,16 +5377,10 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> B N-proc T-trig C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',186), NAME_CONST('in_stmt_id',1)) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',186), NAME_CONST('in_stmt_id',1) + 1) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (186, 4) @@ -5773,16 +5395,10 @@ Log_name Pos Event_type Server_id End_log_pos Info CALL pc_i_nt_5_suc (187, 2); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',187), NAME_CONST('in_stmt_id',1)) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',187), NAME_CONST('in_stmt_id',1) + 1) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- @@ -5801,16 +5417,10 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> B N-proc T-func C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',187), NAME_CONST('in_stmt_id',1)) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',187), NAME_CONST('in_stmt_id',1) + 1) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(187,4) @@ -5825,16 +5435,10 @@ Log_name Pos Event_type Server_id End_log_pos Info CALL pc_i_nt_5_suc (188, 2); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',188), NAME_CONST('in_stmt_id',1)) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',188), NAME_CONST('in_stmt_id',1) + 1) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- @@ -5852,16 +5456,10 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> B N-proc T-proc C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',188), NAME_CONST('in_stmt_id',1)) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',188), NAME_CONST('in_stmt_id',1) + 1) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',188), NAME_CONST('in_stmt_id',1)) @@ -6237,16 +5835,10 @@ Log_name Pos Event_type Server_id End_log_pos Info CALL pc_i_nt_5_suc (201, 2); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',201), NAME_CONST('in_stmt_id',1)) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',201), NAME_CONST('in_stmt_id',1) + 1) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- @@ -6262,16 +5854,10 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> B N-proc T R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',201), NAME_CONST('in_stmt_id',1)) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',201), NAME_CONST('in_stmt_id',1) + 1) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B N-proc T R << -e-e-e-e-e-e-e-e-e-e-e- @@ -6283,16 +5869,10 @@ Log_name Pos Event_type Server_id End_log_pos Info CALL pc_i_nt_5_suc (202, 2); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',202), NAME_CONST('in_stmt_id',1)) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',202), NAME_CONST('in_stmt_id',1) + 1) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- @@ -6308,16 +5888,10 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> B N-proc T-proc R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',202), NAME_CONST('in_stmt_id',1)) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',202), NAME_CONST('in_stmt_id',1) + 1) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B N-proc T-proc R << -e-e-e-e-e-e-e-e-e-e-e- @@ -6329,16 +5903,10 @@ Log_name Pos Event_type Server_id End_log_pos Info CALL pc_i_nt_5_suc (203, 2); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',203), NAME_CONST('in_stmt_id',1)) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',203), NAME_CONST('in_stmt_id',1) + 1) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- @@ -6354,16 +5922,10 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> B N-proc T-trig R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',203), NAME_CONST('in_stmt_id',1)) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',203), NAME_CONST('in_stmt_id',1) + 1) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B N-proc T-trig R << -e-e-e-e-e-e-e-e-e-e-e- @@ -6375,16 +5937,10 @@ Log_name Pos Event_type Server_id End_log_pos Info CALL pc_i_nt_5_suc (204, 2); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',204), NAME_CONST('in_stmt_id',1)) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',204), NAME_CONST('in_stmt_id',1) + 1) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- @@ -6402,16 +5958,10 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> B N-proc T-func R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',204), NAME_CONST('in_stmt_id',1)) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',204), NAME_CONST('in_stmt_id',1) + 1) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B N-proc T-func R << -e-e-e-e-e-e-e-e-e-e-e- @@ -6434,8 +5984,7 @@ Log_name Pos Event_type Server_id End_log_pos Info INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 205, 2, COUNT(*) FROM tt_1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 205, 2, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- @@ -6452,8 +6001,7 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> B tN T C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 205, 2, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (205, 4) @@ -6762,8 +6310,7 @@ INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 213, 2, COUNT(*) FROM tt_1 UNIO Got one of the listed errors Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 213, 2, COUNT(*) FROM tt_1 UNION SELECT 205, 2, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> tNe << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- @@ -6780,8 +6327,7 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> B tNe T C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 213, 2, COUNT(*) FROM tt_1 UNION SELECT 205, 2, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (213, 4) @@ -6986,8 +6532,7 @@ Log_name Pos Event_type Server_id End_log_pos Info INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 219, 2, COUNT(*) FROM tt_1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 219, 2, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- @@ -7003,8 +6548,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> B tN T R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 219, 2, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B tN T R << -e-e-e-e-e-e-e-e-e-e-e- @@ -7240,8 +6784,7 @@ INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 227, 2, COUNT(*) FROM tt_1 UNIO Got one of the listed errors Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 227, 2, COUNT(*) FROM tt_1 UNION SELECT 219, 2, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> tNe << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- @@ -7257,8 +6800,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> B tNe T R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 227, 2, COUNT(*) FROM tt_1 UNION SELECT 219, 2, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B tNe T R << -e-e-e-e-e-e-e-e-e-e-e- @@ -8439,8 +7981,7 @@ Log_name Pos Event_type Server_id End_log_pos Info INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 261, 2, COUNT(*) FROM tt_1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 261, 2, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- @@ -8457,8 +7998,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> B tN N C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 261, 2, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (261, 4) @@ -8477,8 +8017,7 @@ Log_name Pos Event_type Server_id End_log_pos Info INSERT INTO nt_1(trans_id, stmt_id) VALUES (262, 4); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (262, 4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -8492,8 +8031,7 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> B nT N C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (262, 4) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_1) @@ -8517,8 +8055,7 @@ master-bin.000001 # Query # # COMMIT INSERT INTO nt_1(trans_id, stmt_id) VALUES (263, 4); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (263, 4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -8536,8 +8073,7 @@ master-bin.000001 # Table_map # # table_id: # (test.nt_3) master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (263, 4) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_3) @@ -8561,8 +8097,7 @@ master-bin.000001 # Query # # COMMIT INSERT INTO nt_1(trans_id, stmt_id) VALUES (264, 4); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (264, 4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -8580,8 +8115,7 @@ master-bin.000001 # Table_map # # table_id: # (test.nt_4) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (264, 4) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_4) @@ -8607,8 +8141,7 @@ master-bin.000001 # Query # # COMMIT INSERT INTO nt_1(trans_id, stmt_id) VALUES (265, 4); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (265, 4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -8632,8 +8165,7 @@ 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 # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (265, 4) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_5) @@ -8661,8 +8193,7 @@ master-bin.000001 # Query # # COMMIT INSERT INTO nt_1(trans_id, stmt_id) VALUES (266, 4); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (266, 4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -8680,8 +8211,7 @@ master-bin.000001 # Table_map # # table_id: # (test.nt_4) master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (266, 4) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_4) @@ -8705,8 +8235,7 @@ master-bin.000001 # Query # # COMMIT INSERT INTO nt_1(trans_id, stmt_id) VALUES (267, 4); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (267, 4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -8724,8 +8253,7 @@ master-bin.000001 # Table_map # # table_id: # (test.nt_3) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (267, 4) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_3) @@ -8753,8 +8281,7 @@ master-bin.000001 # Query # # COMMIT INSERT INTO nt_1(trans_id, stmt_id) VALUES (268, 4); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (268, 4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -8778,8 +8305,7 @@ 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 # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (268, 4) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_5) @@ -8810,8 +8336,7 @@ INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 269, 2, COUNT(*) FROM tt_1 UNIO Got one of the listed errors Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 269, 2, COUNT(*) FROM tt_1 UNION SELECT 268, 4, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> tNe << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- @@ -8828,8 +8353,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> B tNe N C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 269, 2, COUNT(*) FROM tt_1 UNION SELECT 268, 4, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (269, 4) @@ -9035,8 +8559,7 @@ Log_name Pos Event_type Server_id End_log_pos Info INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 275, 2, COUNT(*) FROM tt_1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 275, 2, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- @@ -9055,8 +8578,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> B tN N R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 275, 2, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (275, 4) @@ -9075,8 +8597,7 @@ Log_name Pos Event_type Server_id End_log_pos Info INSERT INTO nt_1(trans_id, stmt_id) VALUES (276, 4); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (276, 4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -9088,8 +8609,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> B nT N R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (276, 4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B nT N R << -e-e-e-e-e-e-e-e-e-e-e- @@ -9109,8 +8629,7 @@ master-bin.000001 # Query # # COMMIT INSERT INTO nt_1(trans_id, stmt_id) VALUES (277, 4); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (277, 4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -9126,8 +8645,7 @@ master-bin.000001 # Table_map # # table_id: # (test.nt_3) master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (277, 4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B NT N R << -e-e-e-e-e-e-e-e-e-e-e- @@ -9147,8 +8665,7 @@ master-bin.000001 # Query # # COMMIT INSERT INTO nt_1(trans_id, stmt_id) VALUES (278, 4); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (278, 4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -9164,8 +8681,7 @@ master-bin.000001 # Table_map # # table_id: # (test.nt_4) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (278, 4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B NT-trig N R << -e-e-e-e-e-e-e-e-e-e-e- @@ -9187,8 +8703,7 @@ master-bin.000001 # Query # # COMMIT INSERT INTO nt_1(trans_id, stmt_id) VALUES (279, 4); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (279, 4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -9206,8 +8721,7 @@ 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 # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (279, 4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B NT-func N R << -e-e-e-e-e-e-e-e-e-e-e- @@ -9227,8 +8741,7 @@ master-bin.000001 # Query # # COMMIT INSERT INTO nt_1(trans_id, stmt_id) VALUES (280, 4); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (280, 4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -9244,8 +8757,7 @@ master-bin.000001 # Table_map # # table_id: # (test.nt_4) master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (280, 4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B TN N R << -e-e-e-e-e-e-e-e-e-e-e- @@ -9265,8 +8777,7 @@ master-bin.000001 # Query # # COMMIT INSERT INTO nt_1(trans_id, stmt_id) VALUES (281, 4); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (281, 4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -9282,8 +8793,7 @@ master-bin.000001 # Table_map # # table_id: # (test.nt_3) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (281, 4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B TN-trig N R << -e-e-e-e-e-e-e-e-e-e-e- @@ -9307,8 +8817,7 @@ master-bin.000001 # Query # # COMMIT INSERT INTO nt_1(trans_id, stmt_id) VALUES (282, 4); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (282, 4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -9328,8 +8837,7 @@ 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 # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (282, 4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B TN-func N R << -e-e-e-e-e-e-e-e-e-e-e- @@ -9354,8 +8862,7 @@ INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 283, 2, COUNT(*) FROM tt_1 UNIO Got one of the listed errors Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 283, 2, COUNT(*) FROM tt_1 UNION SELECT 282, 4, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> tNe << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- @@ -9374,8 +8881,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> B tNe N R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 283, 2, COUNT(*) FROM tt_1 UNION SELECT 282, 4, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (283, 4) @@ -9597,8 +9103,7 @@ master-bin.000001 # Query # # COMMIT INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 289, 4, COUNT(*) FROM tt_1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 289, 4, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -9611,8 +9116,7 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (289, 2) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 289, 4, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B N tN C << -e-e-e-e-e-e-e-e-e-e-e- @@ -9953,8 +9457,7 @@ INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 297, 4, COUNT(*) FROM tt_1 UNIO Got one of the listed errors Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 297, 4, COUNT(*) FROM tt_1 UNION SELECT 297, 2, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> tNe << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -9967,8 +9470,7 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (297, 2) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 297, 4, COUNT(*) FROM tt_1 UNION SELECT 297, 2, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B N tNe C << -e-e-e-e-e-e-e-e-e-e-e- @@ -10177,8 +9679,7 @@ master-bin.000001 # Query # # COMMIT INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 303, 4, COUNT(*) FROM tt_1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 303, 4, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -10193,8 +9694,7 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (303, 2) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 303, 4, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B N tN R << -e-e-e-e-e-e-e-e-e-e-e- @@ -10481,8 +9981,7 @@ INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 311, 4, COUNT(*) FROM tt_1 UNIO Got one of the listed errors Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 311, 4, COUNT(*) FROM tt_1 UNION SELECT 311, 2, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> tNe << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -10497,8 +9996,7 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (311, 2) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 311, 4, COUNT(*) FROM tt_1 UNION SELECT 311, 2, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B N tNe R << -e-e-e-e-e-e-e-e-e-e-e- @@ -10792,8 +10290,7 @@ Log_name Pos Event_type Server_id End_log_pos Info INSERT INTO nt_1(trans_id, stmt_id) VALUES (319, 4); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (319, 4) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> S1 << -b-b-b-b-b-b-b-b-b-b-b- @@ -10823,8 +10320,7 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> B T N S1 T R1 C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (319, 4) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 2) @@ -10850,8 +10346,7 @@ Log_name Pos Event_type Server_id End_log_pos Info INSERT INTO nt_1(trans_id, stmt_id) VALUES (320, 5); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (320, 5) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- @@ -10877,8 +10372,7 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> B T S1 N T R1 C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (320, 5) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 2) @@ -11931,8 +11425,7 @@ Log_name Pos Event_type Server_id End_log_pos Info INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 357, 2, COUNT(*) FROM tt_1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 357, 2, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CT << -b-b-b-b-b-b-b-b-b-b-b- @@ -11956,8 +11449,7 @@ master-bin.000001 # Query # # ROLLBACK -b-b-b-b-b-b-b-b-b-b-b- >> B tN CT T R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 357, 2, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_14 (a int) engine=Innodb diff --git a/mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result index e7e4e1b8aa4..0a1a776d37c 100644 --- a/mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result +++ b/mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result @@ -393,15 +393,13 @@ master-bin.000001 # Query # # COMMIT INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 23, 1, COUNT(*) FROM tt_1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 23, 1, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 23, 1, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- @@ -409,15 +407,13 @@ master-bin.000001 # Query # # COMMIT INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 24, 1, COUNT(*) FROM nt_1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 24, 1, COUNT(*) FROM nt_1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> nT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> nT << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 24, 1, COUNT(*) FROM nt_1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> nT << -e-e-e-e-e-e-e-e-e-e-e- @@ -425,23 +421,13 @@ master-bin.000001 # Xid # # COMMIT /* XID */ UPDATE nt_3, tt_3 SET nt_3.info= "new text 25 --> 1", tt_3.info= "new text 25 --> 1" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_3) -master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_3) -master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; UPDATE nt_3, tt_3 SET nt_3.info= "new text 25 --> 1", tt_3.info= "new text 25 --> 1" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> NT << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_3) -master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_3) -master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; UPDATE nt_3, tt_3 SET nt_3.info= "new text 25 --> 1", tt_3.info= "new text 25 --> 1" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- @@ -449,23 +435,13 @@ master-bin.000001 # Xid # # COMMIT /* XID */ INSERT INTO nt_4(trans_id, stmt_id) VALUES (26, 1); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_4) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_4) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (26, 1) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_4) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_4) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (26, 1) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- @@ -473,35 +449,13 @@ master-bin.000001 # Xid # # COMMIT /* XID */ INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (27, 1, fc_i_tt_5_suc(27, 1)); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -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 # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_5) -master-bin.000001 # Table_map # # table_id: # (test.tt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (27, 1, fc_i_tt_5_suc(27, 1)) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -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 # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_5) -master-bin.000001 # Table_map # # table_id: # (test.tt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (27, 1, fc_i_tt_5_suc(27, 1)) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- @@ -509,23 +463,13 @@ master-bin.000001 # Xid # # COMMIT /* XID */ UPDATE tt_4, nt_4 SET tt_4.info= "new text 28 --> 1", nt_4.info= "new text 28 --> 1" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_4) -master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_4) -master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; UPDATE tt_4, nt_4 SET tt_4.info= "new text 28 --> 1", nt_4.info= "new text 28 --> 1" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_4) -master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_4) -master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; UPDATE tt_4, nt_4 SET tt_4.info= "new text 28 --> 1", nt_4.info= "new text 28 --> 1" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1 master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- @@ -533,23 +477,13 @@ master-bin.000001 # Xid # # COMMIT /* XID */ INSERT INTO tt_3(trans_id, stmt_id) VALUES (29, 1); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_3) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_3) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (29, 1) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_3) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_3) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (29, 1) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- @@ -557,35 +491,13 @@ master-bin.000001 # Xid # # COMMIT /* XID */ INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (30, 1, fc_i_nt_5_suc(30, 1)); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # -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 # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_5) -master-bin.000001 # Table_map # # table_id: # (test.tt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (30, 1, fc_i_nt_5_suc(30, 1)) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # -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 # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_5) -master-bin.000001 # Table_map # # table_id: # (test.tt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (30, 1, fc_i_nt_5_suc(30, 1)) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- @@ -604,15 +516,13 @@ INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 31, 1, COUNT(*) FROM tt_1 UNION Got one of the listed errors Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 31, 1, COUNT(*) FROM tt_1 UNION SELECT 23, 1, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> tNe << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> tNe << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 31, 1, COUNT(*) FROM tt_1 UNION SELECT 23, 1, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> tNe << -e-e-e-e-e-e-e-e-e-e-e- @@ -630,16 +540,14 @@ INSERT INTO nt_4(trans_id, stmt_id) VALUES (33, 1), (26, 1); Got one of the listed errors Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_4) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (33, 1), (26, 1) +master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> NeT-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> NeT-trig << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_4) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (33, 1), (26, 1) +master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> NeT-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> NeT-func << -b-b-b-b-b-b-b-b-b-b-b- @@ -647,20 +555,14 @@ INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (34, 1, ''), (30, 2, fc_i_tt_5_ Got one of the listed errors Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -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 `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (34, 1, ''), (30, 2, fc_i_tt_5_suc (34, 1)) +master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> NeT-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> NeT-func << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -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 `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (34, 1, ''), (30, 2, fc_i_tt_5_suc (34, 1)) +master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> NeT-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TeN-trig << -b-b-b-b-b-b-b-b-b-b-b- @@ -668,16 +570,14 @@ INSERT INTO tt_3(trans_id, stmt_id) VALUES (35, 1), (29, 1); Got one of the listed errors Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_3) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (35, 1), (29, 1) +master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> TeN-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TeN-trig << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_3) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (35, 1), (29, 1) +master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> TeN-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TeN-func << -b-b-b-b-b-b-b-b-b-b-b- @@ -685,24 +585,14 @@ INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (36, 1, ''), (30, 1, fc_i_nt_5_ Got one of the listed errors Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # -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 `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (36, 1, ''), (30, 1, fc_i_nt_5_suc (36, 1)) +master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> TeN-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TeN-func << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # -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 `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (36, 1, ''), (30, 1, fc_i_nt_5_suc (36, 1)) +master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> TeN-func << -e-e-e-e-e-e-e-e-e-e-e- @@ -6434,8 +6324,7 @@ Log_name Pos Event_type Server_id End_log_pos Info INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 205, 2, COUNT(*) FROM tt_1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 205, 2, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- @@ -6452,8 +6341,7 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> B tN T C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 205, 2, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (205, 4) @@ -6762,8 +6650,7 @@ INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 213, 2, COUNT(*) FROM tt_1 UNIO Got one of the listed errors Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 213, 2, COUNT(*) FROM tt_1 UNION SELECT 205, 2, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> tNe << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- @@ -6780,8 +6667,7 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> B tNe T C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 213, 2, COUNT(*) FROM tt_1 UNION SELECT 205, 2, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (213, 4) @@ -6986,8 +6872,7 @@ Log_name Pos Event_type Server_id End_log_pos Info INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 219, 2, COUNT(*) FROM tt_1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 219, 2, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- @@ -7003,8 +6888,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> B tN T R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 219, 2, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B tN T R << -e-e-e-e-e-e-e-e-e-e-e- @@ -7240,8 +7124,7 @@ INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 227, 2, COUNT(*) FROM tt_1 UNIO Got one of the listed errors Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 227, 2, COUNT(*) FROM tt_1 UNION SELECT 219, 2, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> tNe << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- @@ -7257,8 +7140,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> B tNe T R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 227, 2, COUNT(*) FROM tt_1 UNION SELECT 219, 2, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B tNe T R << -e-e-e-e-e-e-e-e-e-e-e- @@ -8439,8 +8321,7 @@ Log_name Pos Event_type Server_id End_log_pos Info INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 261, 2, COUNT(*) FROM tt_1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 261, 2, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- @@ -8457,8 +8338,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> B tN N C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 261, 2, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (261, 4) @@ -8810,8 +8690,7 @@ INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 269, 2, COUNT(*) FROM tt_1 UNIO Got one of the listed errors Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 269, 2, COUNT(*) FROM tt_1 UNION SELECT 268, 4, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> tNe << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- @@ -8828,8 +8707,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> B tNe N C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 269, 2, COUNT(*) FROM tt_1 UNION SELECT 268, 4, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (269, 4) @@ -9035,8 +8913,7 @@ Log_name Pos Event_type Server_id End_log_pos Info INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 275, 2, COUNT(*) FROM tt_1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 275, 2, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- @@ -9055,8 +8932,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> B tN N R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 275, 2, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (275, 4) @@ -9354,8 +9230,7 @@ INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 283, 2, COUNT(*) FROM tt_1 UNIO Got one of the listed errors Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 283, 2, COUNT(*) FROM tt_1 UNION SELECT 282, 4, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> tNe << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- @@ -9374,8 +9249,7 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> B tNe N R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 283, 2, COUNT(*) FROM tt_1 UNION SELECT 282, 4, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (283, 4) @@ -9597,8 +9471,7 @@ master-bin.000001 # Query # # COMMIT INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 289, 4, COUNT(*) FROM tt_1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 289, 4, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -9611,8 +9484,7 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (289, 2) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 289, 4, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B N tN C << -e-e-e-e-e-e-e-e-e-e-e- @@ -9953,8 +9825,7 @@ INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 297, 4, COUNT(*) FROM tt_1 UNIO Got one of the listed errors Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 297, 4, COUNT(*) FROM tt_1 UNION SELECT 297, 2, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> tNe << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- @@ -9967,8 +9838,7 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (297, 2) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 297, 4, COUNT(*) FROM tt_1 UNION SELECT 297, 2, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B N tNe C << -e-e-e-e-e-e-e-e-e-e-e- @@ -10177,8 +10047,7 @@ master-bin.000001 # Query # # COMMIT INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 303, 4, COUNT(*) FROM tt_1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 303, 4, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -10193,8 +10062,7 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (303, 2) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 303, 4, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B N tN R << -e-e-e-e-e-e-e-e-e-e-e- @@ -10481,8 +10349,7 @@ INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 311, 4, COUNT(*) FROM tt_1 UNIO Got one of the listed errors Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 311, 4, COUNT(*) FROM tt_1 UNION SELECT 311, 2, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> tNe << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -10497,8 +10364,7 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (311, 2) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 311, 4, COUNT(*) FROM tt_1 UNION SELECT 311, 2, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B N tNe R << -e-e-e-e-e-e-e-e-e-e-e- @@ -11931,8 +11797,7 @@ Log_name Pos Event_type Server_id End_log_pos Info INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 357, 2, COUNT(*) FROM tt_1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 357, 2, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CT << -b-b-b-b-b-b-b-b-b-b-b- @@ -11956,8 +11821,7 @@ master-bin.000001 # Query # # ROLLBACK -b-b-b-b-b-b-b-b-b-b-b- >> B tN CT T R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 357, 2, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_14 (a int) engine=Innodb diff --git a/mysql-test/suite/rpl/r/rpl_non_direct_stm_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_non_direct_stm_mixing_engines.result index ab02432b0d4..7c1ef59d9bd 100644 --- a/mysql-test/suite/rpl/r/rpl_non_direct_stm_mixing_engines.result +++ b/mysql-test/suite/rpl/r/rpl_non_direct_stm_mixing_engines.result @@ -391,8 +391,6 @@ master-bin.000001 # Query # # COMMIT # -b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 23, 1, COUNT(*) FROM tt_1; -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 23, 1, COUNT(*) FROM tt_1 @@ -407,8 +405,6 @@ master-bin.000001 # Query # # COMMIT -b-b-b-b-b-b-b-b-b-b-b- >> nT << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 24, 1, COUNT(*) FROM nt_1; -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 24, 1, COUNT(*) FROM nt_1 @@ -423,8 +419,6 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> NT << -b-b-b-b-b-b-b-b-b-b-b- UPDATE nt_3, tt_3 SET nt_3.info= "new text 25 --> 1", tt_3.info= "new text 25 --> 1" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1; -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; UPDATE nt_3, tt_3 SET nt_3.info= "new text 25 --> 1", tt_3.info= "new text 25 --> 1" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1 @@ -439,8 +433,6 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_4(trans_id, stmt_id) VALUES (26, 1); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (26, 1) @@ -455,8 +447,6 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (27, 1, fc_i_tt_5_suc(27, 1)); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (27, 1, fc_i_tt_5_suc(27, 1)) @@ -471,8 +461,6 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- UPDATE tt_4, nt_4 SET tt_4.info= "new text 28 --> 1", nt_4.info= "new text 28 --> 1" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1; -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; UPDATE tt_4, nt_4 SET tt_4.info= "new text 28 --> 1", nt_4.info= "new text 28 --> 1" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1 @@ -487,8 +475,6 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_3(trans_id, stmt_id) VALUES (29, 1); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (29, 1) @@ -503,8 +489,6 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (30, 1, fc_i_nt_5_suc(30, 1)); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (30, 1, fc_i_nt_5_suc(30, 1)) @@ -6076,8 +6060,6 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 205, 2, COUNT(*) FROM tt_1; -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 205, 2, COUNT(*) FROM tt_1 @@ -6518,8 +6500,6 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 219, 2, COUNT(*) FROM tt_1; -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 219, 2, COUNT(*) FROM tt_1 @@ -7845,8 +7825,6 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 261, 2, COUNT(*) FROM tt_1; -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 261, 2, COUNT(*) FROM tt_1 @@ -8311,8 +8289,6 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 275, 2, COUNT(*) FROM tt_1; -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 275, 2, COUNT(*) FROM tt_1 @@ -8811,8 +8787,6 @@ master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 289, 4, COUNT(*) FROM tt_1; -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 289, 4, COUNT(*) FROM tt_1 @@ -9297,8 +9271,6 @@ master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 303, 4, COUNT(*) FROM tt_1; -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 303, 4, COUNT(*) FROM tt_1 @@ -10557,7 +10529,6 @@ Log_name Pos Event_type Server_id End_log_pos Info INSERT INTO nt_xx_9(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM tt_1;; Warnings: Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_9(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM tt_1 @@ -10966,8 +10937,6 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 357, 2, COUNT(*) FROM tt_1; -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 357, 2, COUNT(*) FROM tt_1 diff --git a/mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result b/mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result index bec91a96194..1ad34fbe961 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result +++ b/mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result @@ -32,18 +32,12 @@ BEGIN; Got one of the listed errors Got one of the listed errors Got one of the listed errors -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. BEGIN; Got one of the listed errors Got one of the listed errors -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. BEGIN; Got one of the listed errors Got one of the listed errors -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. source include/diff_master_slave.inc; ######################################################################################## # 3 - BEGIN - COMMIT @@ -55,8 +49,6 @@ BEGIN; Got one of the listed errors Got one of the listed errors Got one of the listed errors -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. COMMIT; source include/diff_master_slave.inc; ######################################################################################## @@ -69,8 +61,6 @@ BEGIN; Got one of the listed errors Got one of the listed errors Got one of the listed errors -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. ROLLBACK; Warnings: Warning 1196 Some non-transactional changed tables couldn't be rolled back @@ -109,8 +99,6 @@ BEGIN; Got one of the listed errors Got one of the listed errors Got one of the listed errors -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. ROLLBACK TO sv; Warnings: Warning 1196 Some non-transactional changed tables couldn't be rolled back @@ -123,19 +111,11 @@ TRUNCATE TABLE t1; TRUNCATE TABLE t2; TRUNCATE TABLE t3; BEGIN; -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Got one of the listed errors Got one of the listed errors Got one of the listed errors -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. COMMIT; BEGIN; -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Got one of the listed errors COMMIT; source include/diff_master_slave.inc; diff --git a/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result index a5219662881..300932b7b8d 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result +++ b/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result @@ -391,8 +391,6 @@ master-bin.000001 # Query # # COMMIT # -b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 23, 1, COUNT(*) FROM tt_1; -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 23, 1, COUNT(*) FROM tt_1 @@ -407,8 +405,6 @@ master-bin.000001 # Query # # COMMIT -b-b-b-b-b-b-b-b-b-b-b- >> nT << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 24, 1, COUNT(*) FROM nt_1; -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 24, 1, COUNT(*) FROM nt_1 @@ -423,8 +419,6 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> NT << -b-b-b-b-b-b-b-b-b-b-b- UPDATE nt_3, tt_3 SET nt_3.info= "new text 25 --> 1", tt_3.info= "new text 25 --> 1" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1; -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; UPDATE nt_3, tt_3 SET nt_3.info= "new text 25 --> 1", tt_3.info= "new text 25 --> 1" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1 @@ -439,8 +433,6 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_4(trans_id, stmt_id) VALUES (26, 1); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (26, 1) @@ -455,8 +447,6 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (27, 1, fc_i_tt_5_suc(27, 1)); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (27, 1, fc_i_tt_5_suc(27, 1)) @@ -471,8 +461,6 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- UPDATE tt_4, nt_4 SET tt_4.info= "new text 28 --> 1", nt_4.info= "new text 28 --> 1" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1; -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; UPDATE tt_4, nt_4 SET tt_4.info= "new text 28 --> 1", nt_4.info= "new text 28 --> 1" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1 @@ -487,8 +475,6 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_3(trans_id, stmt_id) VALUES (29, 1); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (29, 1) @@ -503,8 +489,6 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (30, 1, fc_i_nt_5_suc(30, 1)); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (30, 1, fc_i_nt_5_suc(30, 1)) @@ -3615,8 +3599,6 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id) VALUES (133, 4); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (133, 4) @@ -3649,8 +3631,6 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_5(trans_id, stmt_id) VALUES (134, 4); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (134, 4) @@ -3755,8 +3735,6 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id) VALUES (137, 4); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (137, 4) @@ -3789,8 +3767,6 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_5(trans_id, stmt_id) VALUES (138, 4); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (138, 4) @@ -3897,8 +3873,6 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id) VALUES (141, 4); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (141, 4) @@ -3933,8 +3907,6 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_5(trans_id, stmt_id) VALUES (142, 4); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (142, 4) @@ -4043,8 +4015,6 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id) VALUES (145, 4); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (145, 4) @@ -4079,8 +4049,6 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_5(trans_id, stmt_id) VALUES (146, 4); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (146, 4) @@ -4329,8 +4297,6 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id) VALUES (153, 4); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (153, 4) @@ -4365,8 +4331,6 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_5(trans_id, stmt_id) VALUES (154, 4); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (154, 4) @@ -4477,8 +4441,6 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id) VALUES (157, 4); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (157, 4) @@ -4513,8 +4475,6 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_5(trans_id, stmt_id) VALUES (158, 4); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (158, 4) @@ -4627,8 +4587,6 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id) VALUES (161, 4); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (161, 4) @@ -4665,8 +4623,6 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_5(trans_id, stmt_id) VALUES (162, 4); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (162, 4) @@ -4781,8 +4737,6 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id) VALUES (165, 4); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (165, 4) @@ -4819,8 +4773,6 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_5(trans_id, stmt_id) VALUES (166, 4); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (166, 4) @@ -6244,8 +6196,6 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 205, 2, COUNT(*) FROM tt_1; -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 205, 2, COUNT(*) FROM tt_1 @@ -6686,8 +6636,6 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 219, 2, COUNT(*) FROM tt_1; -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 219, 2, COUNT(*) FROM tt_1 @@ -8029,8 +7977,6 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 261, 2, COUNT(*) FROM tt_1; -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 261, 2, COUNT(*) FROM tt_1 @@ -8069,8 +8015,6 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> nT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id) VALUES (262, 4); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (262, 4) @@ -8105,8 +8049,6 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id) VALUES (263, 4); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (263, 4) @@ -8141,8 +8083,6 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id) VALUES (264, 4); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (264, 4) @@ -8177,8 +8117,6 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id) VALUES (265, 4); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (265, 4) @@ -8213,8 +8151,6 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id) VALUES (266, 4); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (266, 4) @@ -8249,8 +8185,6 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id) VALUES (267, 4); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (267, 4) @@ -8285,8 +8219,6 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id) VALUES (268, 4); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (268, 4) @@ -8392,8 +8324,6 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NeT-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id) VALUES (271, 4); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (271, 4) @@ -8427,8 +8357,6 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NeT-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id) VALUES (272, 4); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (272, 4) @@ -8462,8 +8390,6 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TeN-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id) VALUES (273, 4); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (273, 4) @@ -8497,8 +8423,6 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TeN-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id) VALUES (274, 4); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (274, 4) @@ -8539,8 +8463,6 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 275, 2, COUNT(*) FROM tt_1; -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 275, 2, COUNT(*) FROM tt_1 @@ -8581,8 +8503,6 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> nT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id) VALUES (276, 4); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (276, 4) @@ -8619,8 +8539,6 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id) VALUES (277, 4); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (277, 4) @@ -8657,8 +8575,6 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id) VALUES (278, 4); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (278, 4) @@ -8695,8 +8611,6 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id) VALUES (279, 4); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (279, 4) @@ -8733,8 +8647,6 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id) VALUES (280, 4); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (280, 4) @@ -8771,8 +8683,6 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id) VALUES (281, 4); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (281, 4) @@ -8809,8 +8719,6 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id) VALUES (282, 4); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (282, 4) @@ -8922,8 +8830,6 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NeT-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id) VALUES (285, 4); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (285, 4) @@ -8959,8 +8865,6 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> NeT-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id) VALUES (286, 4); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (286, 4) @@ -8996,8 +8900,6 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TeN-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id) VALUES (287, 4); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (287, 4) @@ -9033,8 +8935,6 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> TeN-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id) VALUES (288, 4); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (288, 4) @@ -9083,8 +8983,6 @@ master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 289, 4, COUNT(*) FROM tt_1; -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 289, 4, COUNT(*) FROM tt_1 @@ -9569,8 +9467,6 @@ master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 303, 4, COUNT(*) FROM tt_1; -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 303, 4, COUNT(*) FROM tt_1 @@ -10158,8 +10054,6 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id) VALUES (319, 4); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (319, 4) @@ -10216,8 +10110,6 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> S1 << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id) VALUES (320, 5); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (320, 5) @@ -10845,7 +10737,6 @@ Log_name Pos Event_type Server_id End_log_pos Info INSERT INTO nt_xx_9(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM tt_1;; Warnings: Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_9(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM tt_1 @@ -10949,7 +10840,6 @@ Log_name Pos Event_type Server_id End_log_pos Info INSERT INTO nt_xx_10(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM nt_1;; Warnings: Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_10(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM nt_1 @@ -11262,8 +11152,6 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 357, 2, COUNT(*) FROM tt_1; -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 357, 2, COUNT(*) FROM tt_1 diff --git a/mysql-test/suite/rpl/r/rpl_stm_stop_middle_group.result b/mysql-test/suite/rpl/r/rpl_stm_stop_middle_group.result index 96829a1b1ec..eb1d6689bfc 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_stop_middle_group.result +++ b/mysql-test/suite/rpl/r/rpl_stm_stop_middle_group.result @@ -52,8 +52,6 @@ include/start_slave.inc set @@global.debug="+d,stop_slave_middle_group"; set @@global.debug="+d,incomplete_group_in_relay_log"; update tm as t1, ti as t2 set t1.a=t1.a * 2, t2.a=t2.a * 2; -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. SELECT "Fatal error: ... The slave SQL is stopped, leaving the current group of events unfinished with a non-transaction table changed. If the group consists solely of Row-based events, you can try restarting the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details)." AS Last_SQL_Error, @check as `true`; Last_SQL_Error true Fatal error: ... The slave SQL is stopped, leaving the current group of events unfinished with a non-transaction table changed. If the group consists solely of Row-based events, you can try restarting the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details). 1 diff --git a/mysql-test/suite/rpl/r/rpl_temp_temporary.result b/mysql-test/suite/rpl/r/rpl_temp_temporary.result index 3911bd8a773..9c667963f77 100644 --- a/mysql-test/suite/rpl/r/rpl_temp_temporary.result +++ b/mysql-test/suite/rpl/r/rpl_temp_temporary.result @@ -23,8 +23,6 @@ CREATE TEMPORARY TABLE t_innodb_temp(id int) engine= Innodb; INSERT INTO t_innodb_temp VALUES(1); BEGIN; INSERT INTO t_myisam SELECT * FROM t_myisam_temp; -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. INSERT INTO t_innodb SELECT * FROM t_myisam_temp; INSERT INTO t_innodb SELECT * FROM t_innodb_temp; ROLLBACK; @@ -32,8 +30,6 @@ Warnings: Warning 1196 Some non-transactional changed tables couldn't be rolled back BEGIN; INSERT INTO t_myisam SELECT * FROM t_innodb_temp; -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them. INSERT INTO t_innodb SELECT * FROM t_myisam_temp; INSERT INTO t_innodb SELECT * FROM t_innodb_temp; ROLLBACK; @@ -61,11 +57,15 @@ show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t_myisam SELECT * FROM t_myisam_temp +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t_innodb SELECT * FROM t_myisam_temp master-bin.000001 # Query # # use `test`; INSERT INTO t_innodb SELECT * FROM t_innodb_temp master-bin.000001 # Query # # ROLLBACK master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t_myisam SELECT * FROM t_innodb_temp +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t_innodb SELECT * FROM t_myisam_temp master-bin.000001 # Query # # use `test`; INSERT INTO t_innodb SELECT * FROM t_innodb_temp master-bin.000001 # Query # # ROLLBACK @@ -185,12 +185,8 @@ BEGIN; INSERT INTO t_myisam VALUES(CONNECTION_ID()); INSERT INTO tmp1 VALUES(1); INSERT INTO t_myisam VALUES(1); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. INSERT INTO t_innodb VALUES(1); INSERT INTO t_myisam VALUES(CONNECTION_ID()); -Warnings: -Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction. INSERT INTO t_innodb VALUES(1); COMMIT; show binlog events from ; @@ -202,13 +198,15 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t_myisam VALUES(CONNECTION_ID()) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tmp1 VALUES(1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t_myisam VALUES(1) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t_myisam VALUES(CONNECTION_ID()) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tmp1 VALUES(1) master-bin.000001 # Query # # use `test`; INSERT INTO t_innodb VALUES(1) master-bin.000001 # Query # # use `test`; INSERT INTO t_innodb VALUES(1) master-bin.000001 # Xid # # COMMIT /* XID */ diff --git a/mysql-test/suite/rpl/t/rpl_non_direct_mixed_mixing_engines.test b/mysql-test/suite/rpl/t/rpl_non_direct_mixed_mixing_engines.test index 1952be145d0..2f2db01f422 100644 --- a/mysql-test/suite/rpl/t/rpl_non_direct_mixed_mixing_engines.test +++ b/mysql-test/suite/rpl/t/rpl_non_direct_mixed_mixing_engines.test @@ -11,5 +11,3 @@ SET SESSION binlog_direct_non_transactional_updates = OFF; --enable_query_log let $engine_type=Innodb; --source extra/rpl_tests/rpl_mixing_engines.test - ---diff_files suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result suite/rpl/r/rpl_mixed_mixing_engines.result diff --git a/mysql-test/t/innodb_mysql_lock2.test b/mysql-test/t/innodb_mysql_lock2.test index 048d712183f..4ad30b9f25b 100644 --- a/mysql-test/t/innodb_mysql_lock2.test +++ b/mysql-test/t/innodb_mysql_lock2.test @@ -12,6 +12,10 @@ # Save the initial number of concurrent sessions. --source include/count_sessions.inc +--disable_query_log +CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); +--enable_query_log + --echo # --echo # Test how do we handle locking in various cases when --echo # we read data from InnoDB tables. diff --git a/sql/log.cc b/sql/log.cc index 680a56ec161..24ec38d5284 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -209,7 +209,7 @@ class binlog_cache_data { public: binlog_cache_data(): m_pending(0), before_stmt_pos(MY_OFF_T_UNDEF), - incident(FALSE) + incident(FALSE), changes_to_non_trans_temp_table_flag(FALSE) { cache_log.end_of_file= max_binlog_cache_size; } @@ -245,9 +245,20 @@ public: return(incident); } + void set_changes_to_non_trans_temp_table() + { + changes_to_non_trans_temp_table_flag= TRUE; + } + + bool changes_to_non_trans_temp_table() + { + return (changes_to_non_trans_temp_table_flag); + } + void reset() { truncate(0); + changes_to_non_trans_temp_table_flag= FALSE; incident= FALSE; before_stmt_pos= MY_OFF_T_UNDEF; cache_log.end_of_file= max_binlog_cache_size; @@ -304,6 +315,12 @@ private: */ bool incident; + /* + This flag indicates if the cache has changes to temporary tables. + @TODO This a temporary fix and should be removed after BUG#54562. + */ + bool changes_to_non_trans_temp_table_flag; + /* It truncates the cache to a certain position. This includes deleting the pending event. @@ -1772,13 +1789,23 @@ static int binlog_rollback(handlerton *hton, THD *thd, bool all) /* We flush the cache wrapped in a beging/rollback if: . aborting a single or multi-statement transaction and; - . the format is STMT and non-trans engines were updated or; - . the OPTION_KEEP_LOG is activate. + . the OPTION_KEEP_LOG is active or; + . the format is STMT and a non-trans table was updated or; + . the format is MIXED and a temporary non-trans table was + updated or; + . the format is MIXED, non-trans table was updated and + aborting a single statement transaction; */ + if (ending_trans(thd, all) && ((thd->variables.option_bits & OPTION_KEEP_LOG) || (trans_has_updated_non_trans_table(thd) && - thd->variables.binlog_format == BINLOG_FORMAT_STMT))) + thd->variables.binlog_format == BINLOG_FORMAT_STMT) || + (cache_mngr->trx_cache.changes_to_non_trans_temp_table() && + thd->variables.binlog_format == BINLOG_FORMAT_MIXED) || + (trans_has_updated_non_trans_table(thd) && + ending_single_stmt_trans(thd,all) && + thd->variables.binlog_format == BINLOG_FORMAT_MIXED))) { Query_log_event qev(thd, STRING_WITH_LEN("ROLLBACK"), TRUE, FALSE, TRUE, 0); error= binlog_flush_trx_cache(thd, cache_mngr, &qev); @@ -1786,13 +1813,17 @@ static int binlog_rollback(handlerton *hton, THD *thd, bool all) /* Truncate the cache if: . aborting a single or multi-statement transaction or; - . the OPTION_KEEP_LOG is not activate and; - . the format is not STMT or no non-trans were updated. + . the OPTION_KEEP_LOG is not active and; + . the format is not STMT or no non-trans was updated and; + . the format is not MIXED or no temporary non-trans was + updated. */ else if (ending_trans(thd, all) || (!(thd->variables.option_bits & OPTION_KEEP_LOG) && - ((!stmt_has_updated_non_trans_table(thd) || - thd->variables.binlog_format != BINLOG_FORMAT_STMT)))) + (!stmt_has_updated_non_trans_table(thd) || + thd->variables.binlog_format != BINLOG_FORMAT_STMT) && + (!cache_mngr->trx_cache.changes_to_non_trans_temp_table() || + thd->variables.binlog_format != BINLOG_FORMAT_MIXED))) error= binlog_truncate_trx_cache(thd, cache_mngr, all); } @@ -4254,7 +4285,23 @@ bool use_trans_cache(const THD* thd, bool is_transactional) */ bool ending_trans(THD* thd, const bool all) { - return (all || (!all && !thd->in_multi_stmt_transaction_mode())); + return (all || ending_single_stmt_trans(thd, all)); +} + +/** + This function checks if a single statement transaction is about + to commit or not. + + @param thd The client thread that executed the current statement. + @param all Committing a transaction (i.e. TRUE) or a statement + (i.e. FALSE). + @return + @c true if committing a single statement transaction, otherwise + @c false. +*/ +bool ending_single_stmt_trans(THD* thd, const bool all) +{ + return (!all && !thd->in_multi_stmt_transaction_mode()); } /** @@ -4653,6 +4700,9 @@ bool MYSQL_BIN_LOG::write(Log_event *event_info) file= cache_mngr->get_binlog_cache_log(is_trans_cache); cache_data= cache_mngr->get_binlog_cache_data(is_trans_cache); + if (thd->stmt_accessed_non_trans_temp_table()) + cache_data->set_changes_to_non_trans_temp_table(); + thd->binlog_start_trans_and_stmt(); } DBUG_PRINT("info",("event type: %d",event_info->get_type_code())); diff --git a/sql/log.h b/sql/log.h index d264f62fb64..4a58c3081d8 100644 --- a/sql/log.h +++ b/sql/log.h @@ -27,6 +27,7 @@ bool trans_has_updated_trans_table(const THD* thd); bool stmt_has_updated_trans_table(const THD *thd); bool use_trans_cache(const THD* thd, bool is_transactional); bool ending_trans(THD* thd, const bool all); +bool ending_single_stmt_trans(THD* thd, const bool all); bool trans_has_updated_non_trans_table(const THD* thd); bool stmt_has_updated_non_trans_table(const THD* thd); diff --git a/sql/log_event.cc b/sql/log_event.cc index 7778ee18f5c..606f5945a07 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -678,8 +678,9 @@ Log_event::Log_event(THD* thd_arg, uint16 flags_arg, bool using_trans) { server_id= thd->server_id; when= thd->start_time; - cache_type= (using_trans || stmt_has_updated_trans_table(thd) - || thd->thread_temporary_used + cache_type= ((using_trans || stmt_has_updated_trans_table(thd) || + (thd->stmt_accessed_temp_table() && + trans_has_updated_trans_table(thd))) ? Log_event::EVENT_TRANSACTIONAL_CACHE : Log_event::EVENT_STMT_CACHE); } @@ -2519,8 +2520,9 @@ Query_log_event::Query_log_event(THD* thd_arg, const char* query_arg, } else { - cache_type= ((using_trans || stmt_has_updated_trans_table(thd) - || trx_cache || thd->thread_temporary_used) + cache_type= ((using_trans || stmt_has_updated_trans_table(thd) || trx_cache || + (thd->stmt_accessed_temp_table() && + trans_has_updated_trans_table(thd))) ? Log_event::EVENT_TRANSACTIONAL_CACHE : Log_event::EVENT_STMT_CACHE); } diff --git a/sql/sql_class.cc b/sql/sql_class.cc index d29796149a7..e781f08b6d4 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -493,7 +493,9 @@ THD::THD() rli_fake(0), lock_id(&main_lock_id), user_time(0), in_sub_stmt(0), - binlog_unsafe_warning_flags(0), binlog_table_maps(0), + binlog_unsafe_warning_flags(0), + stmt_accessed_table_flag(0), + binlog_table_maps(0), table_map_for_update(0), arg_of_last_insert_id_function(FALSE), first_successful_insert_id_in_prev_stmt(0), @@ -537,7 +539,7 @@ THD::THD() count_cuted_fields= CHECK_FIELD_IGNORE; killed= NOT_KILLED; col_access=0; - is_slave_error= thread_specific_used= thread_temporary_used= FALSE; + is_slave_error= thread_specific_used= FALSE; my_hash_clear(&handler_tables_hash); tmp_table=0; used_tables=0; @@ -3663,7 +3665,7 @@ int THD::decide_logging_format(TABLE_LIST *tables) capabilities. */ handler::Table_flags flags_write_some_set= 0; - handler::Table_flags flags_some_set= 0; + handler::Table_flags flags_access_some_set= 0; handler::Table_flags flags_write_all_set= HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE; @@ -3678,17 +3680,7 @@ int THD::decide_logging_format(TABLE_LIST *tables) Innodb and Falcon; Innodb and MyIsam. */ my_bool multi_access_engine= FALSE; - /* - If non-transactional and transactional engines are about - to be accessed and any of them is about to be updated. - For example: Innodb and MyIsam. - */ - my_bool trans_non_trans_access_engines= FALSE; - /* - If all engines that are about to be updated are - transactional. - */ - my_bool all_trans_write_engines= TRUE; + TABLE* prev_write_table= NULL; TABLE* prev_access_table= NULL; @@ -3712,9 +3704,12 @@ int THD::decide_logging_format(TABLE_LIST *tables) { if (table->placeholder()) continue; + if (table->table->s->table_category == TABLE_CATEGORY_PERFORMANCE) lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_SYSTEM_TABLE); + handler::Table_flags const flags= table->table->file->ha_table_flags(); + DBUG_PRINT("info", ("table: %s; ha_table_flags: 0x%llx", table->table_name, flags)); if (table->lock_type >= TL_WRITE_ALLOW_WRITE) @@ -3722,177 +3717,171 @@ int THD::decide_logging_format(TABLE_LIST *tables) if (prev_write_table && prev_write_table->file->ht != table->table->file->ht) multi_write_engine= TRUE; - /* - Every temporary table must be always written to the binary - log in transaction boundaries and as such we artificially - classify them as transactional. - - Indirectly, this avoids classifying a temporary table created - on a non-transactional engine as unsafe when it is modified - after any transactional table: - BEGIN; - INSERT INTO innodb_t VALUES (1); - INSERT INTO myisam_t_temp VALUES (1); - COMMIT; + my_bool trans= table->table->file->has_transactions(); - BINARY LOG: + if (table->table->s->tmp_table) + set_stmt_accessed_table(trans ? STMT_WRITES_TEMP_TRANS_TABLE : + STMT_WRITES_TEMP_NON_TRANS_TABLE); + else + set_stmt_accessed_table(trans ? STMT_WRITES_TRANS_TABLE : + STMT_WRITES_NON_TRANS_TABLE); - BEGIN; - INSERT INTO innodb_t VALUES (1); - INSERT INTO myisam_t_temp VALUES (1); - COMMIT; - */ - all_trans_write_engines= all_trans_write_engines && - (table->table->file->has_transactions() || - table->table->s->tmp_table); - prev_write_table= table->table; flags_write_all_set &= flags; flags_write_some_set |= flags; - } - flags_some_set |= flags; - /* - The mixture of non-transactional and transactional tables must - identified and classified as unsafe. However, a temporary table - must be always handled as a transactional table. Based on that, - we have the following statements classified as mixed and by - consequence as unsafe: - 1: INSERT INTO myisam_t SELECT * FROM innodb_t; - - 2: INSERT INTO innodb_t SELECT * FROM myisam_t; - - 3: INSERT INTO myisam_t SELECT * FROM myisam_t_temp; - - 4: INSERT INTO myisam_t_temp SELECT * FROM myisam_t; - - 5: CREATE TEMPORARY TABLE myisam_t_temp SELECT * FROM mysiam_t; - - The following statements are not considered mixed and as such - are safe: - - 1: INSERT INTO innodb_t SELECT * FROM myisam_t_temp; + prev_write_table= table->table; + } + flags_access_some_set |= flags; - 2: INSERT INTO myisam_t_temp SELECT * FROM innodb_t_temp; - */ - if (!trans_non_trans_access_engines && prev_access_table && - (lex->sql_command != SQLCOM_CREATE_TABLE || + if (lex->sql_command != SQLCOM_CREATE_TABLE || (lex->sql_command == SQLCOM_CREATE_TABLE && - (lex->create_info.options & HA_LEX_CREATE_TMP_TABLE)))) + (lex->create_info.options & HA_LEX_CREATE_TMP_TABLE))) { - my_bool prev_trans; - my_bool act_trans; - if (prev_access_table->s->tmp_table || table->table->s->tmp_table) - { - prev_trans= prev_access_table->s->tmp_table ? TRUE : - prev_access_table->file->has_transactions(); - act_trans= table->table->s->tmp_table ? TRUE : - table->table->file->has_transactions(); - } + my_bool trans= table->table->file->has_transactions(); + + if (table->table->s->tmp_table) + set_stmt_accessed_table(trans ? STMT_READS_TEMP_TRANS_TABLE : + STMT_READS_TEMP_NON_TRANS_TABLE); else - { - prev_trans= prev_access_table->file->has_transactions(); - act_trans= table->table->file->has_transactions(); - } - trans_non_trans_access_engines= (prev_trans != act_trans); - multi_access_engine= TRUE; + set_stmt_accessed_table(trans ? STMT_READS_TRANS_TABLE : + STMT_READS_NON_TRANS_TABLE); } - thread_temporary_used |= table->table->s->tmp_table; + + if (prev_access_table && prev_access_table->file->ht != + table->table->file->ht) + multi_access_engine= TRUE; + prev_access_table= table->table; } DBUG_PRINT("info", ("flags_write_all_set: 0x%llx", flags_write_all_set)); DBUG_PRINT("info", ("flags_write_some_set: 0x%llx", flags_write_some_set)); - DBUG_PRINT("info", ("flags_some_set: 0x%llx", flags_some_set)); + DBUG_PRINT("info", ("flags_access_some_set: 0x%llx", flags_access_some_set)); DBUG_PRINT("info", ("multi_write_engine: %d", multi_write_engine)); DBUG_PRINT("info", ("multi_access_engine: %d", multi_access_engine)); - DBUG_PRINT("info", ("trans_non_trans_access_engines: %d", - trans_non_trans_access_engines)); int error= 0; int unsafe_flags; /* - Set the statement as unsafe if: - - . it is a mixed statement, i.e. access transactional and non-transactional - tables, and update any of them; - - or: - - . an early statement updated a transactional table; - . and, the current statement updates a non-transactional table. - - Any mixed statement is classified as unsafe to ensure that mixed mode is - completely safe. Consider the following example to understand why we - decided to do this: - - Note that mixed statements such as - - 1: INSERT INTO myisam_t SELECT * FROM innodb_t; - - 2: INSERT INTO innodb_t SELECT * FROM myisam_t; - - 3: INSERT INTO myisam_t SELECT * FROM myisam_t_temp; - - 4: INSERT INTO myisam_t_temp SELECT * FROM myisam_t; - - 5: CREATE TEMPORARY TABLE myisam_t_temp SELECT * FROM mysiam_t; - - are classified as unsafe to ensure that in mixed mode the execution is - completely safe and equivalent to the row mode. Consider the following - statements and sessions (connections) to understand the reason: - - con1: INSERT INTO innodb_t VALUES (1); - con1: INSERT INTO innodb_t VALUES (100); + Classify a statement as unsafe when there is a mixed statement and an + on-going transaction at any point of the execution if: - con1: BEGIN - con2: INSERT INTO myisam_t SELECT * FROM innodb_t; - con1: INSERT INTO innodb_t VALUES (200); - con1: COMMIT; + 1. The mixed statement is about to update a transactional table and + a non-transactional table. - The point is that the concurrent statements may be written into the binary log - in a way different from the execution. For example, + 2. The mixed statement is about to update a temporary transactional + table and a non-transactional table. + + 3. The mixed statement is about to update a transactional table and + read from a non-transactional table. - BINARY LOG: + 4. The mixed statement is about to update a temporary transactional + table and read from a non-transactional table. - con2: BEGIN; - con2: INSERT INTO myisam_t SELECT * FROM innodb_t; - con2: COMMIT; - con1: BEGIN - con1: INSERT INTO innodb_t VALUES (200); - con1: COMMIT; + 5. The mixed statement is about to update a non-transactional table + and read from a transactional table when the isolation level is + lower than repeatable read. - .... + After updating a transactional table if: - or - - BINARY LOG: - - con1: BEGIN - con1: INSERT INTO innodb_t VALUES (200); - con1: COMMIT; - con2: BEGIN; - con2: INSERT INTO myisam_t SELECT * FROM innodb_t; - con2: COMMIT; - - Clearly, this may become a problem in STMT mode and setting the statement - as unsafe will make rows to be written into the binary log in MIXED mode - and as such the problem will not stand. - - In STMT mode, although such statement is classified as unsafe, i.e. + 6. The mixed statement is about to update a non-transactional table + and read from a temporary transactional table. + + 7. The mixed statement is about to update a non-transactional table + and read from a temporary transactional table. + + 8. The mixed statement is about to update a non-transactionala table + and read from a temporary non-transactional table. + + 9. The mixed statement is about to update a temporary non-transactional + table and update a non-transactional table. + + 10. The mixed statement is about to update a temporary non-transactional + table and read from a non-transactional table. + + 11. A statement is about to update a non-transactional table and the + option variables.binlog_direct_non_trans_update is OFF. + + The reason for this is that locks acquired may not protected a concurrent + transaction of interfering in the current execution and by consequence in + the result. In particular, if there is an on-going transaction and a + transactional table was already updated, a temporary table must be written + to the binary log in the boundaries of the on-going transaction and as + such we artificially classify them as transactional. + */ + if (in_multi_stmt_transaction_mode()) + { + my_bool mixed_unsafe= FALSE; + my_bool non_trans_unsafe= FALSE; + + /* Case 1. */ + if (stmt_accessed_table(STMT_WRITES_TRANS_TABLE) && + stmt_accessed_table(STMT_WRITES_NON_TRANS_TABLE)) + mixed_unsafe= TRUE; + /* Case 2. */ + else if (stmt_accessed_table(STMT_WRITES_TEMP_TRANS_TABLE) && + stmt_accessed_table(STMT_WRITES_NON_TRANS_TABLE)) + mixed_unsafe= TRUE; + /* Case 3. */ + else if (stmt_accessed_table(STMT_WRITES_TRANS_TABLE) && + stmt_accessed_table(STMT_READS_NON_TRANS_TABLE)) + mixed_unsafe= TRUE; + /* Case 4. */ + else if (stmt_accessed_table(STMT_WRITES_TEMP_TRANS_TABLE) && + stmt_accessed_table(STMT_READS_NON_TRANS_TABLE)) + mixed_unsafe= TRUE; + /* Case 5. */ + else if (stmt_accessed_table(STMT_WRITES_NON_TRANS_TABLE) && + stmt_accessed_table(STMT_READS_TRANS_TABLE) && + tx_isolation < ISO_REPEATABLE_READ) + /* + By default, InnoDB operates in REPEATABLE READ and with the option + --innodb-locks-unsafe-for-binlog disabled. In this case, InnoDB uses + next-key locks for searches and index scans, which prevents phantom + rows. + + This is scenario is safe for Innodb. However, there are no means to + transparently get this information. Therefore, we need to improve this + and change the storage engines to report somehow when an execution is + safe under an isolation level & binary logging format. + */ + mixed_unsafe= TRUE; - INSERT INTO myisam_t SELECT * FROM innodb_t; + if (trans_has_updated_trans_table(this)) + { + /* Case 6. */ + if (stmt_accessed_table(STMT_WRITES_NON_TRANS_TABLE) && + stmt_accessed_table(STMT_READS_TRANS_TABLE)) + mixed_unsafe= TRUE; + /* Case 7. */ + else if (stmt_accessed_table(STMT_WRITES_NON_TRANS_TABLE) && + stmt_accessed_table(STMT_READS_TEMP_TRANS_TABLE)) + mixed_unsafe= TRUE; + /* Case 8. */ + else if (stmt_accessed_table(STMT_WRITES_NON_TRANS_TABLE) && + stmt_accessed_table(STMT_READS_TEMP_NON_TRANS_TABLE)) + mixed_unsafe= TRUE; + /* Case 9. */ + else if (stmt_accessed_table(STMT_WRITES_TEMP_NON_TRANS_TABLE) && + stmt_accessed_table(STMT_WRITES_NON_TRANS_TABLE)) + mixed_unsafe= TRUE; + /* Case 10. */ + else if (stmt_accessed_table(STMT_WRITES_TEMP_NON_TRANS_TABLE) && + stmt_accessed_table(STMT_READS_NON_TRANS_TABLE)) + mixed_unsafe= TRUE; + /* Case 11. */ + else if (!variables.binlog_direct_non_trans_update && + stmt_accessed_table(STMT_WRITES_NON_TRANS_TABLE)) + non_trans_unsafe= TRUE; + } - there is no enough information to avoid writing it outside the boundaries - of a transaction. This is not a problem if we are considering snapshot - isolation level but if we have pure repeatable read or serializable the - lock history on the slave will be different from the master. - */ - if (trans_non_trans_access_engines) - lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_MIXED_STATEMENT); - else if (trans_has_updated_trans_table(this) && !all_trans_write_engines) - lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_NONTRANS_AFTER_TRANS); + if (mixed_unsafe) + lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_MIXED_STATEMENT); + else if (non_trans_unsafe) + lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_NONTRANS_AFTER_TRANS); + } /* If more than one engine is involved in the statement and at @@ -3904,7 +3893,7 @@ int THD::decide_logging_format(TABLE_LIST *tables) (flags_write_some_set & HA_HAS_OWN_BINLOGGING)) my_error((error= ER_BINLOG_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE), MYF(0)); - else if (multi_access_engine && flags_some_set & HA_HAS_OWN_BINLOGGING) + else if (multi_access_engine && flags_access_some_set & HA_HAS_OWN_BINLOGGING) lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE); /* both statement-only and row-only engines involved */ diff --git a/sql/sql_class.h b/sql/sql_class.h index c11c15571f2..7808cbe4d41 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1566,6 +1566,125 @@ public: return current_stmt_binlog_format == BINLOG_FORMAT_ROW; } + enum enum_stmt_accessed_table + { + /* + If a transactional table is about to be read. Note that + a write implies a read. + */ + STMT_READS_TRANS_TABLE= 0, + /* + If a transactional table is about to be updated. + */ + STMT_WRITES_TRANS_TABLE, + /* + If a non-transactional table is about to be read. Note that + a write implies a read. + */ + STMT_READS_NON_TRANS_TABLE, + /* + If a non-transactional table is about to be updated. + */ + STMT_WRITES_NON_TRANS_TABLE, + /* + If a temporary transactional table is about to be read. Note + that a write implies a read. + */ + STMT_READS_TEMP_TRANS_TABLE, + /* + If a temporary transactional table is about to be updated. + */ + STMT_WRITES_TEMP_TRANS_TABLE, + /* + If a temporary non-transactional table is about to be read. Note + that a write implies a read. + */ + STMT_READS_TEMP_NON_TRANS_TABLE, + /* + If a temporary non-transactional table is about to be updated. + */ + STMT_WRITES_TEMP_NON_TRANS_TABLE, + /* + The last element of the enumeration. Please, if necessary add + anything before this. + */ + STMT_ACCESS_TABLE_COUNT + }; + + /** + Sets the type of table that is about to be accessed while executing a + statement. + + @param accessed_table Enumeration type that defines the type of table, + e.g. temporary, transactional, non-transactional. + */ + inline void set_stmt_accessed_table(enum_stmt_accessed_table accessed_table) + { + DBUG_ENTER("THD::set_stmt_accessed_table"); + + DBUG_ASSERT(accessed_table >= 0 && accessed_table < STMT_ACCESS_TABLE_COUNT); + stmt_accessed_table_flag |= (1U << accessed_table); + + DBUG_VOID_RETURN; + } + + /** + Checks if a type of table is about to be accessed while executing a + statement. + + @param accessed_table Enumeration type that defines the type of table, + e.g. temporary, transactional, non-transactional. + + @return + @retval TRUE if the type of the table is about to be accessed + @retval FALSE otherwise + */ + inline bool stmt_accessed_table(enum_stmt_accessed_table accessed_table) + { + DBUG_ENTER("THD::stmt_accessed_table"); + + DBUG_ASSERT(accessed_table >= 0 && accessed_table < STMT_ACCESS_TABLE_COUNT); + + DBUG_RETURN((stmt_accessed_table_flag & (1U << accessed_table)) != 0); + } + + /** + Checks if a temporary table is about to be accessed while executing a + statement. + + @return + @retval TRUE if a temporary table is about to be accessed + @retval FALSE otherwise + */ + inline bool stmt_accessed_temp_table() + { + DBUG_ENTER("THD::stmt_accessed_temp_table"); + + DBUG_RETURN((stmt_accessed_table_flag & + ((1U << STMT_READS_TEMP_TRANS_TABLE) | + (1U << STMT_WRITES_TEMP_TRANS_TABLE) | + (1U << STMT_READS_TEMP_NON_TRANS_TABLE) | + (1U << STMT_WRITES_TEMP_NON_TRANS_TABLE))) != 0); + } + + /** + Checks if a temporary non-transactional table is about to be accessed + while executing a statement. + + @return + @retval TRUE if a temporary non-transactional table is about to be + accessed + @retval FALSE otherwise + */ + inline bool stmt_accessed_non_trans_temp_table() + { + DBUG_ENTER("THD::stmt_accessed_non_trans_temp_table"); + + DBUG_RETURN((stmt_accessed_table_flag & + ((1U << STMT_READS_TEMP_NON_TRANS_TABLE) | + (1U << STMT_WRITES_TEMP_NON_TRANS_TABLE))) != 0); + } + private: /** Indicates the format in which the current statement will be @@ -1603,6 +1722,12 @@ private: */ uint32 binlog_unsafe_warning_flags; + /** + Bit field that determines the type of tables that are about to be + be accessed while executing a statement. + */ + uint32 stmt_accessed_table_flag; + void issue_unsafe_warnings(); /* @@ -2021,7 +2146,6 @@ public: is set if a statement accesses a temporary table created through CREATE TEMPORARY TABLE. */ - bool thread_temporary_used; bool charset_is_system_charset, charset_is_collation_connection; bool charset_is_character_set_filesystem; bool enable_slow_log; /* enable slow log for current statement */ diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 273eadf4205..b48491577d1 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -5633,7 +5633,7 @@ void THD::reset_for_next_command() thd->transaction.all.modified_non_trans_table= FALSE; } DBUG_ASSERT(thd->security_ctx== &thd->main_security_ctx); - thd->thread_specific_used= thd->thread_temporary_used= FALSE; + thd->thread_specific_used= FALSE; if (opt_bin_log) { @@ -5648,6 +5648,7 @@ void THD::reset_for_next_command() thd->reset_current_stmt_binlog_format_row(); thd->binlog_unsafe_warning_flags= 0; + thd->stmt_accessed_table_flag= 0; DBUG_PRINT("debug", ("is_current_stmt_binlog_format_row(): %d", -- cgit v1.2.1 From 68ecc965a6713e1502b042bf0a2b6b339102f463 Mon Sep 17 00:00:00 2001 From: Alfranio Correia Date: Wed, 30 Jun 2010 20:37:41 +0100 Subject: WL#5344 --- .../extra/rpl_tests/rpl_drop_create_temp_table.inc | 967 ++++++++++++ .../rpl_tests/rpl_drop_create_temp_table.test | 389 +++++ .../rpl/r/rpl_mixed_drop_create_temp_table.result | 1513 +++++++++++++++++++ .../rpl/r/rpl_row_drop_create_temp_table.result | 1539 ++++++++++++++++++++ .../rpl/r/rpl_stm_drop_create_temp_table.result | 1513 +++++++++++++++++++ mysql-test/suite/rpl/r/rpl_temp_temporary.result | 238 --- .../rpl/t/rpl_mixed_drop_create_temp_table.test | 10 + .../rpl/t/rpl_row_drop_create_temp_table.test | 10 + .../rpl/t/rpl_stm_drop_create_temp_table.test | 10 + .../suite/rpl/t/rpl_temp_temporary-master.opt | 1 - mysql-test/suite/rpl/t/rpl_temp_temporary.test | 228 --- 11 files changed, 5951 insertions(+), 467 deletions(-) create mode 100644 mysql-test/extra/rpl_tests/rpl_drop_create_temp_table.inc create mode 100644 mysql-test/extra/rpl_tests/rpl_drop_create_temp_table.test create mode 100644 mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result create mode 100644 mysql-test/suite/rpl/r/rpl_row_drop_create_temp_table.result create mode 100644 mysql-test/suite/rpl/r/rpl_stm_drop_create_temp_table.result delete mode 100644 mysql-test/suite/rpl/r/rpl_temp_temporary.result create mode 100644 mysql-test/suite/rpl/t/rpl_mixed_drop_create_temp_table.test create mode 100644 mysql-test/suite/rpl/t/rpl_row_drop_create_temp_table.test create mode 100644 mysql-test/suite/rpl/t/rpl_stm_drop_create_temp_table.test delete mode 100644 mysql-test/suite/rpl/t/rpl_temp_temporary-master.opt delete mode 100644 mysql-test/suite/rpl/t/rpl_temp_temporary.test diff --git a/mysql-test/extra/rpl_tests/rpl_drop_create_temp_table.inc b/mysql-test/extra/rpl_tests/rpl_drop_create_temp_table.inc new file mode 100644 index 00000000000..2d480349c65 --- /dev/null +++ b/mysql-test/extra/rpl_tests/rpl_drop_create_temp_table.inc @@ -0,0 +1,967 @@ +--source include/have_innodb.inc +--disable_abort_on_error + +if (`SELECT HEX(@commands) = HEX('configure')`) +{ + connection master; + + # + # Creates a T-table that is never dropped. + # + --eval CREATE TABLE tt_xx_1 ( id INT ) ENGINE = Innodb + + # + # Creates a N-table that is never dropped. + # + --eval CREATE TABLE nt_xx_1 ( id INT ) ENGINE = MyIsam + + # + # Creates a Temporary N-table that is never dropped. + # + --eval CREATE TEMPORARY TABLE nt_tmp_xx_1 ( id INT ) ENGINE = MyIsam + + # + # Creates a Temporary N-table that is never dropped. + # + --eval CREATE TEMPORARY TABLE tt_tmp_xx_1 ( id INT ) ENGINE = Innodb + + # + # In what follows, we create a set of tables that are used + # throughout this test case. The number of tables to be + # created is give by the variable $tot_table. + # + # + # Creates Temporay N-tables that are automatically dropped and recreated + # when a command ends. + # + --let $n= $tot_table + while (`SELECT $n != 0`) + { + --eval DROP TEMPORARY TABLE IF EXISTS nt_tmp_$n + --eval CREATE TEMPORARY TABLE nt_tmp_$n ( id INT ) ENGINE = MyIsam + --disable_query_log + --eval SET @check_temp='$available_n_temp' + --enable_query_log + # + # Updates the $available_n_temp that keeps track of the created + # temporary N-tables. + # + if (`SELECT HEX(@check_temp) != HEX('')`) + { + --let $available_n_temp= $available_n_temp,nt_tmp_$n + } + if (`SELECT HEX(@check_temp) = HEX('')`) + { + --let $available_n_temp= nt_tmp_$n + } + --dec $n + } + + # + # Creates Temporay T-tables that are automatically dropped and recreated + # when a command ends. + # + --let $n= $tot_table + while (`SELECT $n != 0`) + { + --eval DROP TEMPORARY TABLE IF EXISTS tt_tmp_$n + --eval CREATE TEMPORARY TABLE tt_tmp_$n ( id INT ) ENGINE = Innodb + --disable_query_log + --eval SET @check_temp='$available_t_temp' + --enable_query_log + # + # Updates the $available_t_temp that keeps track of the created + # temporary T-tables. + # + if (`SELECT HEX(@check_temp) != HEX('')`) + { + --let $available_t_temp= $available_t_temp,tt_tmp_$n + } + if (`SELECT HEX(@check_temp) = HEX('')`) + { + --let $available_t_temp= tt_tmp_$n + } + --dec $n + } + + # + # Creates N-tables that are automatically dropped and recreated + # when a command ends. + # + --let $n= $tot_table + while (`SELECT $n != 0`) + { + --eval DROP TABLE IF EXISTS nt_$n + --eval CREATE TABLE nt_$n ( id INT ) ENGINE = MyIsam + --disable_query_log + --eval SET @check_temp='$available_n' + --enable_query_log + # + # Updates the $available_n that keeps track of the created + # N-tables. + # + if (`SELECT HEX(@check_temp) != HEX('')`) + { + --let $available_n= $available_n,nt_$n + } + if (`SELECT HEX(@check_temp) = HEX('')`) + { + --let $available_n= nt_$n + } + --dec $n + } + + # + # Creates T-tables that are automatically dropped and recreated + # when a command ends. + # + --let $n= $tot_table + while (`SELECT $n != 0`) + { + --eval DROP TABLE IF EXISTS tt_$n + --eval CREATE TABLE tt_$n ( id INT ) ENGINE = Innodb + --disable_query_log + --eval SET @check_temp='$available_t' + --enable_query_log + # + # Updates the $available_t that keeps track of the created + # T-tables. + # + if (`SELECT HEX(@check_temp) != HEX('')`) + { + --let $available_t= $available_t,tt_$n + } + if (`SELECT HEX(@check_temp) = HEX('')`) + { + --let $available_t= tt_$n + } + --dec $n + } + + --let $dropped_t_temp= + --let $dropped_n_temp= + + --let $dropped_t= + --let $dropped_n= + + let $pos_trans_command= query_get_value("SHOW MASTER STATUS", Position, 1); + + SET @commands= ''; +} + +# +# Drops tables and synchronizes master and slave. Note that temporary +# tables are not explitcily dropped as they will be dropped while +# closing the connection. +# +if (`SELECT HEX(@commands) = HEX('clean')`) +{ + connection master; + + DROP TABLE IF EXISTS tt_xx_1; + + DROP TABLE IF EXISTS nt_xx_1; + + --let $n= $tot_table + while (`SELECT $n != 0`) + { + --eval DROP TABLE IF EXISTS nt_$n + --dec $n + } + + --let $n= $tot_table + while (`SELECT $n != 0`) + { + --eval DROP TABLE IF EXISTS tt_$n + --dec $n + } + + sync_slave_with_master; + + SET @commands= ''; +} + +# +# This is the core of the test is responsible for processing +# the following commands: +# +# B - Begin +# C - Commit +# R - Rollback +# +# +# T - Inserts a row into a T-table +# N-Temp - Inserts a row into a temporary N-table. +# +# +# T-SELECT-N-Temp - Selects from a temporary N-table and inserts +# into a T-table. +# N-SELECT-N-Temp - Selects from a temporary N-table and inserts +# into a N-table. +# T-SELECT-T-Temp - Selects from a temporary T-table and inserts +# into a T-table. +# N-SELECT-T-Temp - Selects from a temporary T-table and inserts +# into a N-table. +# +# +# Create-N-Temp - Creates a temporary N-table if a temporary N-table +# was dropped before +# Create-T-Temp - Creates a temporary T-table if a temporary T-table +# was dropped before +# +# +# Drop-Temp-T-Temp - Drops a temporary T-table if there is any +# Drop-Temp-N-Temp - Drops a temporary N-table if there is any +# Drop-Temp-TN-Temp - Drops both a temporary T-table and N-table if there +# is any +# Drop-Temp-TT-Temp - Drops two temporary T-tables if there is any +# Drop-Temp-NN-Temp - Drops two temporary N-tables if there is any +# Drop-Temp-Xe-Temp - Tries to drop a temporary table that does not exist +# Drop-Temp-NXe-Temp - Drops a temporary N-table if there is any and +# a temporary table that does not exist +# Drop-Temp-TXe-Temp - Drops a temporary T-table if there is any and +# a temporary table that does not exist +# +# +# Drop-Temp-If-Xe-Temp - Tries to drop a temporary table that does not exist +# Drop-Temp-If-TXe-Temp - Drops a temporary T-table if there is any and +# a temporary table that does not exist +# +# +# Drop-T - Drops a T-table if there is any +# Drop-N - Drops a N-table if there is any +# Drop-Xe - Tries to drop a table that does not exist +# Drop-TXe - Drops a T-table if there is any and a table that does +# not exist +# Drop-NXe - Drops a N-table if there is any and a table that does +# not exist +# Drop-TN - Drops both a T-table and N-table if there is any +# Drop-TT - Drops two T-tables if there is any +# Drop-NN - Drops two N-tables if there is any +# Drop-N-TN-Temp - Drops a N-table and both a temporary T-table and +# N-table if there is any +# +# +# Drop-If-Xe - Tries to drop a table that does not exist +# Drop-If-TXe - Drops a T-table if there is any and a table that does +# not exist +# Drop-If-NXe - Drops a N-table if there is any and a table that does +# not exist +# +while (`SELECT HEX(@commands) != HEX('')`) +{ + --disable_query_log + SET @command= SUBSTRING_INDEX(@commands, ' ', 1); + let $command= `SELECT @command`; + --eval SET @check_commands= '$commands' + if (`SELECT HEX(@check_commands) = HEX('''')`) + { + let $commands= `SELECT @commands`; + } + + if (`SELECT HEX(@command) = HEX('B')`) + { + --enable_query_log + eval BEGIN; + --disable_query_log + } + + if (`SELECT HEX(@command) = HEX('T')`) + { + --enable_query_log + eval INSERT INTO tt_xx_1() VALUES (1); + --disable_query_log + } + + if (`SELECT HEX(@command) = HEX('N')`) + { + --enable_query_log + eval INSERT INTO nt_xx_1() VALUES (1); + --disable_query_log + } + + if (`SELECT HEX(@command) = HEX('N-Temp')`) + { + --enable_query_log + eval INSERT INTO nt_tmp_xx_1() VALUES (1); + --disable_query_log + } + + if (`SELECT HEX(@command) = HEX('N-SELECT-N-Temp')`) + { + --enable_query_log + eval INSERT INTO nt_xx_1 SELECT * FROM nt_tmp_xx_1; + --disable_query_log + } + + if (`SELECT HEX(@command) = HEX('N-SELECT-T-Temp')`) + { + --enable_query_log + eval INSERT INTO nt_xx_1 SELECT * FROM tt_tmp_xx_1; + --disable_query_log + } + + if (`SELECT HEX(@command) = HEX('T-SELECT-N-Temp')`) + { + --enable_query_log + eval INSERT INTO tt_xx_1 SELECT * FROM nt_tmp_xx_1; + --disable_query_log + } + + if (`SELECT HEX(@command) = HEX('T-SELECT-T-Temp')`) + { + --enable_query_log + eval INSERT INTO tt_xx_1 SELECT * FROM tt_tmp_xx_1; + --disable_query_log + } + + if (`SELECT HEX(@command) = HEX('Create-N-Temp') || HEX(@command) = HEX('Create-T-Temp')`) + { + if (`SELECT HEX(@command) = HEX('Create-N-Temp')`) + { + --let $dropped_temp=$dropped_n_temp + --let $available_temp=$available_n_temp + } + if (`SELECT HEX(@command) = HEX('Create-T-Temp')`) + { + --let $dropped_temp=$dropped_t_temp + --let $available_temp=$available_t_temp + } + + --eval SET @check_temp='$dropped_temp' + if (`SELECT HEX(@check_temp) != HEX('')`) + { + SET @temp= SUBSTRING_INDEX(@check_temp, ',', 1); + let $table=`SELECT @temp`; + --eval SET @check_temp='$available_temp' + if (`SELECT HEX(@check_temp) != HEX('')`) + { + --let $available_temp= $available_temp,$table + } + if (`SELECT HEX(@check_temp) = HEX('')`) + { + --let $available_temp= $table + } + --eval SET @check_temp='$dropped_temp' + --eval SET @table_temp='$table' + SET @check_temp= LTRIM(SUBSTRING(@check_temp, LENGTH(@table_temp) + 2)); + --let $dropped_temp= `SELECT @check_temp` + + if (`SELECT HEX(@command) = HEX('Create-N-Temp')`) + { + --enable_query_log + --eval CREATE TEMPORARY TABLE $table ( id INT ) engine= MyIsam + --disable_query_log + + --let $available_n_temp= $available_temp + --let $dropped_n_temp= $dropped_temp + } + if (`SELECT HEX(@command) = HEX('Create-T-Temp')`) + { + --enable_query_log + --eval CREATE TEMPORARY TABLE $table ( id INT ) engine= Innodb + --disable_query_log + + --let $available_t_temp= $available_temp + --let $dropped_t_temp= $dropped_temp + } + } + } + + if (`SELECT HEX(@command) = HEX('Drop-Temp-N-Temp') || HEX(@command) = HEX('Drop-Temp-T-Temp') || HEX(@command) = HEX('Drop-T') || HEX(@command) = HEX('Drop-N')`) + { + if (`SELECT HEX(@command) = HEX('Drop-Temp-N-Temp')`) + { + --let $dropped_temp=$dropped_n_temp + --let $available_temp=$available_n_temp + } + if (`SELECT HEX(@command) = HEX('Drop-Temp-T-Temp')`) + { + --let $dropped_temp=$dropped_t_temp + --let $available_temp=$available_t_temp + } + if (`SELECT HEX(@command) = HEX('Drop-N')`) + { + --let $dropped_temp=$dropped_n + --let $available_temp=$available_n + } + if (`SELECT HEX(@command) = HEX('Drop-T')`) + { + --let $dropped_temp=$dropped_t + --let $available_temp=$available_t + } + + --eval SET @check_temp='$available_temp' + if (`SELECT HEX(@check_temp) != HEX('')`) + { + SET @temp= SUBSTRING_INDEX(@check_temp, ',', 1); + let $table=`SELECT @temp`; + --eval SET @check_temp='$dropped_temp' + if (`SELECT HEX(@check_temp) != HEX('')`) + { + --let $dropped_temp= $dropped_temp,$table + } + if (`SELECT HEX(@check_temp) = HEX('')`) + { + --let $dropped_temp= $table + } + --eval SET @check_temp='$available_temp' + --eval SET @table_temp='$table' + SET @check_temp= LTRIM(SUBSTRING(@check_temp, LENGTH(@table_temp) + 2)); + --let $available_temp= `SELECT @check_temp` + + if (`SELECT HEX(@command) = HEX('Drop-Temp-N-Temp')`) + { + --enable_query_log + --eval DROP TEMPORARY TABLE $table + --disable_query_log + + --let $available_n_temp= $available_temp + --let $dropped_n_temp= $dropped_temp + } + if (`SELECT HEX(@command) = HEX('Drop-Temp-T-Temp')`) + { + --enable_query_log + --eval DROP TEMPORARY TABLE $table + --disable_query_log + + --let $available_t_temp= $available_temp + --let $dropped_t_temp= $dropped_temp + } + if (`SELECT HEX(@command) = HEX('Drop-N')`) + { + --enable_query_log + --eval DROP TABLE $table + --disable_query_log + + --let $available_n= $available_temp + --let $dropped_n= $dropped_temp + } + if (`SELECT HEX(@command) = HEX('Drop-T')`) + { + --enable_query_log + --eval DROP TABLE $table + --disable_query_log + + --let $available_t= $available_temp + --let $dropped_t= $dropped_temp + } + } + } + + if (`SELECT HEX(@command) = HEX('Drop-Temp-Xe-Temp')`) + { + --enable_query_log + --eval DROP TEMPORARY TABLE tt_xx_1 + --disable_query_log + } + + if (`SELECT HEX(@command) = HEX('Drop-Temp-If-Xe-Temp')`) + { + --enable_query_log + --eval DROP TEMPORARY TABLE IF EXISTS tt_xx_1 + --disable_query_log + } + + if (`SELECT HEX(@command) = HEX('Drop-Xe')`) + { + --enable_query_log + --eval DROP TABLE xx_1 + --disable_query_log + } + + if (`SELECT HEX(@command) = HEX('Drop-If-Xe')`) + { + --enable_query_log + --eval DROP TABLE IF EXISTS xx_1 + --disable_query_log + } + + if (`SELECT HEX(@command) = HEX('Drop-Temp-NXe-Temp') || HEX(@command) = HEX('Drop-Temp-TXe-Temp') || HEX(@command) = HEX('Drop-NXe') || HEX(@command) = HEX('Drop-TXe') || HEX(@command) = HEX('Drop-Temp-If-NXe-Temp') || HEX(@command) = HEX('Drop-Temp-If-TXe-Temp') || HEX(@command) = HEX('Drop-If-NXe') || HEX(@command) = HEX('Drop-If-TXe')`) + { + if (`SELECT HEX(@command) = HEX('Drop-Temp-NXe-Temp') || HEX(@command) = HEX('Drop-Temp-If-NXe-Temp')`) + { + --let $dropped_temp=$dropped_n_temp + --let $available_temp=$available_n_temp + } + if (`SELECT HEX(@command) = HEX('Drop-Temp-TXe-Temp') || HEX(@command) = HEX('Drop-Temp-If-TXe-Temp')`) + { + --let $dropped_temp=$dropped_t_temp + --let $available_temp=$available_t_temp + } + if (`SELECT HEX(@command) = HEX('Drop-NXe') || HEX(@command) = HEX('Drop-If-NXe')`) + { + --let $dropped_temp=$dropped_n + --let $available_temp=$available_n + } + if (`SELECT HEX(@command) = HEX('Drop-TXe') || HEX(@command) = HEX('Drop-If-TXe')`) + { + --let $dropped_temp=$dropped_t + --let $available_temp=$available_t + } + + --eval SET @check_temp='$available_temp' + if (`SELECT HEX(@check_temp) != HEX('')`) + { + SET @temp= SUBSTRING_INDEX(@check_temp, ',', 1); + let $table=`SELECT @temp`; + --eval SET @check_temp='$dropped_temp' + if (`SELECT HEX(@check_temp) != HEX('')`) + { + --let $dropped_temp= $dropped_temp,$table + } + if (`SELECT HEX(@check_temp) = HEX('')`) + { + --let $dropped_n_temp= $table + } + --eval SET @check_temp='$available_temp' + --eval SET @table_temp='$table' + SET @check_temp= LTRIM(SUBSTRING(@check_temp, LENGTH(@table_temp) + 2)); + --let $available_temp= `SELECT @check_temp` + + if (`SELECT HEX(@command) = HEX('Drop-Temp-NXe-Temp')`) + { + --enable_query_log + --eval DROP TEMPORARY TABLE $table, tt_1 + --disable_query_log + + --let $available_n_temp= $available_temp + --let $dropped_n_temp= $dropped_temp + } + if (`SELECT HEX(@command) = HEX('Drop-Temp-If-NXe-Temp')`) + { + --enable_query_log + --eval DROP TEMPORARY TABLE IF EXISTS $table, tt_1 + --disable_query_log + + --let $available_n_temp= $available_temp + --let $dropped_n_temp= $dropped_temp + } + if (`SELECT HEX(@command) = HEX('Drop-Temp-TXe-Temp')`) + { + --enable_query_log + --eval DROP TEMPORARY TABLE $table, tt_1 + --disable_query_log + + --let $available_t_temp= $available_temp + --let $dropped_t_temp= $dropped_temp + } + if (`SELECT HEX(@command) = HEX('Drop-Temp-If-TXe-Temp')`) + { + --enable_query_log + --eval DROP TEMPORARY TABLE IF EXISTS $table, tt_1 + --disable_query_log + + --let $available_t_temp= $available_temp + --let $dropped_t_temp= $dropped_temp + } + if (`SELECT HEX(@command) = HEX('Drop-NXe')`) + { + --enable_query_log + --eval DROP TABLE $table, xx_1 + --disable_query_log + + --let $available_n= $available_temp + --let $dropped_n= $dropped_temp + } + if (`SELECT HEX(@command) = HEX('Drop-If-NXe')`) + { + --enable_query_log + --eval DROP TABLE IF EXISTS $table, xx_1 + --disable_query_log + + --let $available_n= $available_temp + --let $dropped_n= $dropped_temp + } + if (`SELECT HEX(@command) = HEX('Drop-TXe')`) + { + --enable_query_log + --eval DROP TABLE $table, xx_1 + --disable_query_log + + --let $available_t= $available_temp + --let $dropped_t= $dropped_temp + } + if (`SELECT HEX(@command) = HEX('Drop-If-TXe')`) + { + --enable_query_log + --eval DROP TABLE IF EXISTS $table, xx_1 + --disable_query_log + + --let $available_t= $available_temp + --let $dropped_t= $dropped_temp + } + } + } + + if (`SELECT HEX(@command) = HEX('Drop-Temp-NN-Temp') || HEX(@command) = HEX('Drop-Temp-TT-Temp') || HEX(@command) = HEX('Drop-NN') || HEX(@command) = HEX('Drop-TT')`) + { + if (`SELECT HEX(@command) = HEX('Drop-Temp-NN-Temp')`) + { + --let $dropped_temp=$dropped_n_temp + --let $available_temp=$available_n_temp + } + if (`SELECT HEX(@command) = HEX('Drop-Temp-TT-Temp')`) + { + --let $dropped_temp=$dropped_t_temp + --let $available_temp=$available_t_temp + } + if (`SELECT HEX(@command) = HEX('Drop-NN')`) + { + --let $dropped_temp=$dropped_n + --let $available_temp=$available_n + } + if (`SELECT HEX(@command) = HEX('Drop-TT')`) + { + --let $dropped_temp=$dropped_t + --let $available_temp=$available_t + } + + --eval SET @check_temp='$available_temp' + if (`SELECT HEX(@check_temp) != HEX('')`) + { + --let $n= 2 + while (`SELECT HEX(@check_temp) != HEX('') && $n != 0`) + { + SET @temp= SUBSTRING_INDEX(@check_temp, ',', 1); + let $table=`SELECT @temp`; + --eval SET @check_temp='$dropped_temp' + if (`SELECT HEX(@check_temp) != HEX('')`) + { + --let $dropped_temp= $dropped_temp,$table + } + if (`SELECT HEX(@check_temp) = HEX('')`) + { + --let $dropped_temp= $table + } + if (`SELECT $n = 1`) + { + --let $table_1= $table + } + if (`SELECT $n = 2`) + { + --let $table_2= $table + } + + --dec $n + --eval SET @check_temp='$available_temp' + --eval SET @table_temp='$table' + SET @check_temp= LTRIM(SUBSTRING(@check_temp, LENGTH(@table_temp) + 2)); + --let $available_temp= `SELECT @check_temp` + } + + if (`SELECT HEX(@command) = HEX('Drop-Temp-NN-Temp') && $n = 0`) + { + --enable_query_log + --eval DROP TEMPORARY TABLE $table_1, $table_2 + --disable_query_log + + --let $available_n_temp= $available_temp + --let $dropped_n_temp= $dropped_temp + } + if (`SELECT HEX(@command) = HEX('Drop-Temp-TT-Temp') && $n= 0`) + { + --enable_query_log + --eval DROP TEMPORARY TABLE $table_1, $table_2 + --disable_query_log + + --let $available_t_temp= $available_temp + --let $dropped_t_temp= $dropped_temp + } + if (`SELECT HEX(@command) = HEX('Drop-NN') && $n = 0`) + { + --enable_query_log + --eval DROP TABLE $table_1, $table_2 + --disable_query_log + + --let $available_n= $available_temp + --let $dropped_n= $dropped_temp + } + if (`SELECT HEX(@command) = HEX('Drop-TT') && $n= 0`) + { + --enable_query_log + --eval DROP TABLE $table_1, $table_2 + --disable_query_log + + --let $available_t= $available_temp + --let $dropped_t= $dropped_temp + } + } + } + + if (`SELECT HEX(@command) = HEX('Drop-Temp-TN-Temp')`) + { + --eval SET @check_temp_t='$available_t_temp' + --eval SET @check_temp_n='$available_n_temp' + if (`SELECT HEX(@check_temp_t) != HEX('') && HEX(@check_temp_n) != HEX('')`) + { + SET @temp_t= SUBSTRING_INDEX(@check_temp_t, ',', 1); + let $table_t=`SELECT @temp_t`; + --eval SET @check_temp_t='$dropped_t_temp' + if (`SELECT HEX(@check_temp_t) != HEX('')`) + { + --let $dropped_t_temp= $dropped_t_temp,$table_t + } + if (`SELECT HEX(@check_temp_t) = HEX('')`) + { + --let $dropped_t_temp= $table_t + } + --eval SET @check_temp='$available_t_temp' + --eval SET @table_temp='$table_t' + SET @check_temp= LTRIM(SUBSTRING(@check_temp, LENGTH(@table_temp) + 2)); + --let $available_t_temp= `SELECT @check_temp` + + SET @temp_n= SUBSTRING_INDEX(@check_temp_n, ',', 1); + let $table_n=`SELECT @temp_n`; + --eval SET @check_temp_n='$dropped_n_temp' + if (`SELECT HEX(@check_temp_n) != HEX('')`) + { + --let $dropped_n_temp= $dropped_n_temp,$table_n + } + if (`SELECT HEX(@check_temp_n) = HEX('')`) + { + --let $dropped_n_temp= $table_n + } + --eval SET @check_temp='$available_n_temp' + --eval SET @table_temp='$table_n' + SET @check_temp= LTRIM(SUBSTRING(@check_temp, LENGTH(@table_temp) + 2)); + --let $available_t_temp= `SELECT @check_temp` + + --enable_query_log + --eval DROP TEMPORARY TABLE $table_t, $table_n + --disable_query_log + } + } + + if (`SELECT HEX(@command) = HEX('Drop-TN')`) + { + --eval SET @check_temp_t='$available_t' + --eval SET @check_temp_n='$available_n' + if (`SELECT HEX(@check_temp_t) != HEX('') && HEX(@check_temp_n) != HEX('')`) + { + SET @temp_t= SUBSTRING_INDEX(@check_temp_t, ',', 1); + let $table_t=`SELECT @temp_t`; + --eval SET @check_temp_t='$dropped_t' + if (`SELECT HEX(@check_temp_t) != HEX('')`) + { + --let $dropped_t= $dropped_t,$table_t + } + if (`SELECT HEX(@check_temp_t) = HEX('')`) + { + --let $dropped_t= $table_t + } + --eval SET @check_temp='$available_t' + --eval SET @table_temp='$table_t' + SET @check_temp= LTRIM(SUBSTRING(@check_temp, LENGTH(@table_temp) + 2)); + --let $available_t= `SELECT @check_temp` + + SET @temp_n= SUBSTRING_INDEX(@check_temp_n, ',', 1); + let $table_n=`SELECT @temp_n`; + --eval SET @check_temp_n='$dropped_n' + if (`SELECT HEX(@check_temp_n) != HEX('')`) + { + --let $dropped_n= $dropped_n,$table_n + } + if (`SELECT HEX(@check_temp_n) = HEX('')`) + { + --let $dropped_n= $table_n + } + --eval SET @check_temp='$available_n' + --eval SET @table_temp='$table_n' + SET @check_temp= LTRIM(SUBSTRING(@check_temp, LENGTH(@table_temp) + 2)); + --let $available_t= `SELECT @check_temp` + + --enable_query_log + --eval DROP TABLE $table_t, $table_n + --disable_query_log + } + } + + if (`SELECT HEX(@command) = HEX('Drop-N-TN-Temp') || HEX(@command) = HEX('Drop-TN-Temp')`) + { + --eval SET @check_temp_t='$available_t_temp' + --eval SET @check_temp_n='$available_n_temp' + if (`SELECT HEX(@command) = HEX('Drop-N-TN-Temp')`) + { + --eval SET @check_n='$available_n' + } + if (`SELECT HEX(@command) = HEX('Drop-TN-Temp')`) + { + # + # Just to be possible to go through the next if... + # + --eval SET @check_n='...' + } + if (`SELECT HEX(@check_temp_t) != HEX('') && HEX(@check_temp_n) != HEX('') && HEX(@check_n) != HEX('')`) + { + SET @temp_t= SUBSTRING_INDEX(@check_temp_t, ',', 1); + let $table_temp_t=`SELECT @temp_t`; + --eval SET @check_temp_t='$dropped_t_temp' + if (`SELECT HEX(@check_temp_t) != HEX('')`) + { + --let $dropped_t_temp= $dropped_t_temp,$table_temp_t + } + if (`SELECT HEX(@check_temp_t) = HEX('')`) + { + --let $dropped_t_temp= $table_temp_t + } + --eval SET @check_temp='$available_t_temp' + --eval SET @table_temp='$table_temp_t' + SET @check_temp= LTRIM(SUBSTRING(@check_temp, LENGTH(@table_temp) + 2)); + --let $available_t_temp= `SELECT @check_temp` + + SET @temp_n= SUBSTRING_INDEX(@check_temp_n, ',', 1); + let $table_temp_n=`SELECT @temp_n`; + --eval SET @check_temp_n='$dropped_n_temp' + if (`SELECT HEX(@check_temp_n) != HEX('')`) + { + --let $dropped_n_temp= $dropped_n_temp,$table_temp_n + } + if (`SELECT HEX(@check_temp_n) = HEX('')`) + { + --let $dropped_n_temp= $table_temp_n + } + --eval SET @check_temp='$available_n_temp' + --eval SET @table_temp='$table_temp_n' + SET @check_temp= LTRIM(SUBSTRING(@check_temp, LENGTH(@table_temp) + 2)); + --let $available_n_temp= `SELECT @check_temp` + + if (`SELECT HEX(@command) = HEX('Drop-N-TN-Temp')`) + { + SET @temp_n= SUBSTRING_INDEX(@check_n, ',', 1); + let $table_n=`SELECT @temp_n`; + --eval SET @check_n='$dropped_n' + if (`SELECT HEX(@check_n) != HEX('')`) + { + --let $dropped_n= $dropped_n,$table_n + } + if (`SELECT HEX(@check_n) = HEX('')`) + { + --let $dropped_n= $table_n + } + --eval SET @check_temp='$available_n' + --eval SET @table_temp='$table_n' + SET @check_temp= LTRIM(SUBSTRING(@check_temp, LENGTH(@table_temp) + 2)); + --let $available_n= `SELECT @check_temp` + + --enable_query_log + --eval DROP TABLE $table_temp_t, $table_temp_n, $table_n + --disable_query_log + } + if (`SELECT HEX(@command) = HEX('Drop-TN-Temp')`) + { + --enable_query_log + --eval DROP TABLE $table_temp_t, $table_temp_n + --disable_query_log + } + } + } + + if (`SELECT HEX(@command) = HEX('C')`) + { + --enable_query_log + --error 0, ER_GET_ERRMSG + eval COMMIT; + --disable_query_log + } + + if (`SELECT HEX(@command) = HEX('R')`) + { + --enable_query_log + --error 0, ER_GET_ERRMSG + eval ROLLBACK; + --disable_query_log + } + + SET @commands= LTRIM(SUBSTRING(@commands, LENGTH(@command) + 1)); + if (`SELECT HEX(@commands) = HEX('')`) + { + let $binlog_start= $pos_trans_command; + --echo -b-b-b-b-b-b-b-b-b-b-b- >> $commands << -b-b-b-b-b-b-b-b-b-b-b- + --source include/show_binlog_events.inc + --echo -e-e-e-e-e-e-e-e-e-e-e- >> $commands << -e-e-e-e-e-e-e-e-e-e-e- + --echo + + --disable_warnings + --let $available_n_temp= + --let $dropped_n_temp= + --let $n= $tot_table + while (`SELECT $n != 0`) + { + --eval DROP TEMPORARY TABLE IF EXISTS nt_tmp_$n + --eval CREATE TEMPORARY TABLE nt_tmp_$n ( id INT ) ENGINE = MyIsam + --eval SET @check_temp='$available_n_temp' + if (`SELECT HEX(@check_temp) != HEX('')`) + { + --let $available_n_temp= $available_n_temp,nt_tmp_$n + } + if (`SELECT HEX(@check_temp) = HEX('')`) + { + --let $available_n_temp= nt_tmp_$n + } + --dec $n + } + + --let $available_t_temp= + --let $dropped_t_temp= + --let $n= $tot_table + while (`SELECT $n != 0`) + { + --eval DROP TEMPORARY TABLE IF EXISTS tt_tmp_$n + --eval CREATE TEMPORARY TABLE tt_tmp_$n ( id INT ) ENGINE = Innodb + --eval SET @check_temp='$available_t_temp' + if (`SELECT HEX(@check_temp) != HEX('')`) + { + --let $available_t_temp= $available_t_temp,tt_tmp_$n + } + if (`SELECT HEX(@check_temp) = HEX('')`) + { + --let $available_t_temp= tt_tmp_$n + } + --dec $n + } + + --let $available_t= + --let $dropped_t= + --let $n= $tot_table + while (`SELECT $n != 0`) + { + --eval DROP TABLE IF EXISTS tt_$n + --eval CREATE TABLE tt_$n ( id INT ) ENGINE = Innodb + --eval SET @check_temp='$available_t' + if (`SELECT HEX(@check_temp) != HEX('')`) + { + --let $available_t= $available_t,tt_$n + } + if (`SELECT HEX(@check_temp) = HEX('')`) + { + --let $available_t= tt_$n + } + --dec $n + } + + --let $available_n= + --let $dropped_n= + --let $n= $tot_table + while (`SELECT $n != 0`) + { + --eval DROP TABLE IF EXISTS nt_$n + --eval CREATE TABLE nt_$n ( id INT ) ENGINE = MyIsam + --eval SET @check_temp='$available_n' + if (`SELECT HEX(@check_temp) != HEX('')`) + { + --let $available_n= $available_n,nt_$n + } + if (`SELECT HEX(@check_temp) = HEX('')`) + { + --let $available_n= nt_$n + } + --dec $n + } + --enable_warnings + + let $pos_trans_command= query_get_value("SHOW MASTER STATUS", Position, 1); + let $commands= ''; + } + --enable_query_log +} diff --git a/mysql-test/extra/rpl_tests/rpl_drop_create_temp_table.test b/mysql-test/extra/rpl_tests/rpl_drop_create_temp_table.test new file mode 100644 index 00000000000..32f8d16b900 --- /dev/null +++ b/mysql-test/extra/rpl_tests/rpl_drop_create_temp_table.test @@ -0,0 +1,389 @@ +############################################################################### +# In this test case, we check how changes to temporary tables are written +# to the binary log. +# +# (TODO --- GET INFO AS SOON AS THE SITE IS AVAILABLE) +# +# This test uses the commands available at: +# extra/rpl_tests/rpl_drop_create_temp_table.inc +# +############################################################################### + + +--echo ######################################################################### +--echo # CONFIGURATION +--echo ######################################################################### + +call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT."); + +--let $tot_table= 2 +SET @commands= 'configure'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +--echo ######################################################################### +--echo # 1 - Tables dropped by "DROP TEMPORARY TABLE" +--echo ######################################################################### +connection master; + +--echo +--echo # +--echo #1) Generates in the binlog what follows: +--echo # +SET @commands= 'Drop-Temp-T-Temp'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'Drop-Temp-N-Temp'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'Drop-Temp-Xe-Temp'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'Drop-Temp-If-Xe-Temp'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'Drop-Temp-TXe-Temp'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'Drop-Temp-If-TXe-Temp'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'Drop-Temp-NXe-Temp'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'Drop-Temp-If-NXe-Temp'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'Drop-Temp-TN-Temp'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'Drop-Temp-TT-Temp'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'Drop-Temp-NN-Temp'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + + +--echo +--echo # +--echo #2) Generates in the binlog what follows: +--echo # +SET @commands= 'B T Drop-Temp-T-Temp C'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B T Drop-Temp-T-Temp N Drop-Temp-T-Temp C'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B T Drop-Temp-N-Temp C'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B T Drop-Temp-N-Temp N Drop-Temp-N-Temp C'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B T Drop-Temp-Xe-Temp C'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B T Drop-Temp-Xe-Temp N Drop-Temp-Xe-Temp C'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B T Drop-Temp-If-Xe-Temp C'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B T Drop-Temp-If-Xe-Temp N Drop-Temp-If-Xe-Temp C'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B T Drop-Temp-TXe-Temp C'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B T Drop-Temp-TXe-Temp N Drop-Temp-TXe-Temp C'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B T Drop-Temp-If-TXe-Temp C'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B T Drop-Temp-If-TXe-Temp N Drop-Temp-If-TXe-Temp C'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B T Drop-Temp-NXe-Temp C'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B T Drop-Temp-NXe-Temp N Drop-Temp-NXe-Temp C'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B T Drop-Temp-If-NXe-Temp C'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B T Drop-Temp-If-NXe-Temp N Drop-Temp-If-NXe-Temp C'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B T Drop-Temp-TN-Temp C'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B T Drop-Temp-TN-Temp N Drop-Temp-TN-Temp C'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B T Drop-Temp-TT-Temp C'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B T Drop-Temp-TT-Temp N Drop-Temp-TT-Temp C'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B T Drop-Temp-NN-Temp C'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B T Drop-Temp-NN-Temp N Drop-Temp-NN-Temp C'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + + +--echo +--echo # +--echo #3) Generates in the binlog what follows: +--echo # +SET @commands= 'B T Drop-Temp-T-Temp R'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B T Drop-Temp-T-Temp N Drop-Temp-T-Temp R'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B T Drop-Temp-N-Temp R'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B T Drop-Temp-N-Temp N Drop-Temp-N-Temp R'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B T Drop-Temp-Xe-Temp R'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B T Drop-Temp-Xe-Temp N Drop-Temp-Xe-Temp R'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B T Drop-Temp-If-Xe-Temp R'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B T Drop-Temp-If-Xe-Temp N Drop-Temp-If-Xe-Temp R'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B T Drop-Temp-TXe-Temp R'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B T Drop-Temp-TXe-Temp N Drop-Temp-TXe-Temp R'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B T Drop-Temp-If-TXe-Temp R'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B T Drop-Temp-If-TXe-Temp N Drop-Temp-If-TXe-Temp R'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B T Drop-Temp-NXe-Temp R'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B T Drop-Temp-NXe-Temp N Drop-Temp-NXe-Temp R'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B T Drop-Temp-If-NXe-Temp R'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B T Drop-Temp-If-NXe-Temp N Drop-Temp-If-NXe-Temp R'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B T Drop-Temp-TN-Temp R'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B T Drop-Temp-TN-Temp N Drop-Temp-TN-Temp R'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B T Drop-Temp-TT-Temp R'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B T Drop-Temp-TT-Temp N Drop-Temp-TT-Temp R'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B T Drop-Temp-NN-Temp R'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B T Drop-Temp-NN-Temp N Drop-Temp-NN-Temp R'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + + +--echo ######################################################################### +--echo # 2 - Tables dropped by "DROP TABLE" +--echo ######################################################################### +connection master; + +--echo +--echo # +--echo #1) Generates in the binlog what follows: +--echo # +SET @commands= 'Drop-T'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'Drop-N'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'Drop-Xe'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'Drop-If-Xe'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'Drop-TXe'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'Drop-If-TXe'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'Drop-NXe'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'Drop-If-NXe'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'Drop-TN'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'Drop-TT'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'Drop-NN'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'Drop-N-TN-Temp'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'Drop-TN-Temp'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +--echo +--echo # +--echo #2) Generates in the binlog what follows: +--echo # +SET @commands= 'B T Drop-T'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B T Drop-N'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B T Drop-Xe'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B T Drop-If-Xe'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B T Drop-TXe'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B T Drop-If-TXe'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B T Drop-NXe'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B T Drop-If-NXe'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B T Drop-TN'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B T Drop-TT'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B T Drop-NN'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B T Drop-N-TN-Temp'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B T Drop-TN-Temp'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +--echo ######################################################################### +--echo # 3 - CREATE TEMPORARY TABLE +--echo ######################################################################### +connection master; + +--echo +--echo # +--echo #1) Generates in the binlog what follows: +--echo # +SET @commands= 'Drop-Temp-N-Temp Create-N-Temp Drop-Temp-N-Temp Drop-Temp-N-Temp'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +--echo +--echo # +--echo #2) Generates in the binlog what follows: +--echo # +SET @commands= 'B T Drop-Temp-N-Temp Create-N-Temp Drop-Temp-N-Temp Drop-Temp-N-Temp C'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp C'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +--echo +--echo # +--echo #3) Generates in the binlog what follows: +--echo # +SET @commands= 'B T Drop-Temp-N-Temp Create-N-Temp Drop-Temp-N-Temp Drop-Temp-N-Temp R'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp R'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + + +--echo ######################################################################### +--echo # 4 - CHANGING TEMPORARY TABLES +--echo ######################################################################### +connection master; + +--echo +--echo # +--echo #1) Generates in the binlog what follows: +--echo # +SET @commands= 'B N N-Temp N-SELECT-N-Temp N-Temp C'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B N N-Temp T-SELECT-N-Temp N-Temp C'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B N N-Temp N-SELECT-T-Temp N-Temp C'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B N N-Temp T-SELECT-T-Temp N-Temp C'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +--echo +--echo +--echo # +--echo #2) Generates in the binlog what follows: +--echo # +SET @commands= 'B N N-Temp N-SELECT-N-Temp N-Temp R'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B N N-Temp T-SELECT-N-Temp N-Temp R'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B N N-Temp N-SELECT-T-Temp N-Temp R'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +SET @commands= 'B N N-Temp T-SELECT-T-Temp N-Temp R'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc + +--echo ################################################################################### +--echo # CHECK CONSISTENCY +--echo ################################################################################### +connection master; +sync_slave_with_master; + +let $MYSQLD_DATADIR= `SELECT @@datadir`; + +--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLD_DATADIR/test-temporary-master.sql +--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLD_DATADIR/test-temporary-slave.sql +--diff_files $MYSQLD_DATADIR/test-temporary-master.sql $MYSQLD_DATADIR/test-temporary-slave.sql + +--echo ######################################################################### +--echo # CLEAN +--echo ######################################################################### +SET @commands= 'clean'; +--source extra/rpl_tests/rpl_drop_create_temp_table.inc diff --git a/mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result b/mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result new file mode 100644 index 00000000000..c752e836ebb --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result @@ -0,0 +1,1513 @@ +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; +######################################################################### +# CONFIGURATION +######################################################################### +call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT."); +SET @commands= 'configure'; +CREATE TABLE tt_xx_1 ( id INT ) ENGINE = Innodb; +CREATE TABLE nt_xx_1 ( id INT ) ENGINE = MyIsam; +CREATE TEMPORARY TABLE nt_tmp_xx_1 ( id INT ) ENGINE = MyIsam; +CREATE TEMPORARY TABLE tt_tmp_xx_1 ( id INT ) ENGINE = Innodb; +DROP TEMPORARY TABLE IF EXISTS nt_tmp_2; +Warnings: +Note 1051 Unknown table 'nt_tmp_2' +CREATE TEMPORARY TABLE nt_tmp_2 ( id INT ) ENGINE = MyIsam; +DROP TEMPORARY TABLE IF EXISTS nt_tmp_1; +Warnings: +Note 1051 Unknown table 'nt_tmp_1' +CREATE TEMPORARY TABLE nt_tmp_1 ( id INT ) ENGINE = MyIsam; +DROP TEMPORARY TABLE IF EXISTS tt_tmp_2; +Warnings: +Note 1051 Unknown table 'tt_tmp_2' +CREATE TEMPORARY TABLE tt_tmp_2 ( id INT ) ENGINE = Innodb; +DROP TEMPORARY TABLE IF EXISTS tt_tmp_1; +Warnings: +Note 1051 Unknown table 'tt_tmp_1' +CREATE TEMPORARY TABLE tt_tmp_1 ( id INT ) ENGINE = Innodb; +DROP TABLE IF EXISTS nt_2; +Warnings: +Note 1051 Unknown table 'nt_2' +CREATE TABLE nt_2 ( id INT ) ENGINE = MyIsam; +DROP TABLE IF EXISTS nt_1; +Warnings: +Note 1051 Unknown table 'nt_1' +CREATE TABLE nt_1 ( id INT ) ENGINE = MyIsam; +DROP TABLE IF EXISTS tt_2; +Warnings: +Note 1051 Unknown table 'tt_2' +CREATE TABLE tt_2 ( id INT ) ENGINE = Innodb; +DROP TABLE IF EXISTS tt_1; +Warnings: +Note 1051 Unknown table 'tt_1' +CREATE TABLE tt_1 ( id INT ) ENGINE = Innodb; +SET @commands= ''; +######################################################################### +# 1 - Tables dropped by "DROP TEMPORARY TABLE" +######################################################################### + +# +#1) Generates in the binlog what follows: +# +SET @commands= 'Drop-Temp-T-Temp'; +DROP TEMPORARY TABLE tt_tmp_2; +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_2 +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-Temp-N-Temp'; +DROP TEMPORARY TABLE nt_tmp_2; +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-N-Temp << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_2 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-N-Temp << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-Temp-Xe-Temp'; +DROP TEMPORARY TABLE tt_xx_1; +ERROR 42S02: Unknown table 'tt_xx_1' +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-Xe-Temp << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-Xe-Temp << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-Temp-If-Xe-Temp'; +DROP TEMPORARY TABLE IF EXISTS tt_xx_1; +Warnings: +Note 1051 Unknown table 'tt_xx_1' +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-If-Xe-Temp << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS tt_xx_1 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-If-Xe-Temp << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-Temp-TXe-Temp'; +DROP TEMPORARY TABLE tt_tmp_2, tt_1; +ERROR 42S02: Unknown table 'tt_1' +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-TXe-Temp << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_2, tt_1 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-TXe-Temp << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-Temp-If-TXe-Temp'; +DROP TEMPORARY TABLE IF EXISTS tt_tmp_2, tt_1; +Warnings: +Note 1051 Unknown table 'tt_1' +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-If-TXe-Temp << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS tt_tmp_2, tt_1 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-If-TXe-Temp << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-Temp-NXe-Temp'; +DROP TEMPORARY TABLE nt_tmp_2, tt_1; +ERROR 42S02: Unknown table 'tt_1' +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-NXe-Temp << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_2, tt_1 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-NXe-Temp << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-Temp-If-NXe-Temp'; +DROP TEMPORARY TABLE IF EXISTS nt_tmp_2, tt_1; +Warnings: +Note 1051 Unknown table 'tt_1' +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-If-NXe-Temp << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS nt_tmp_2, tt_1 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-If-NXe-Temp << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-Temp-TN-Temp'; +DROP TEMPORARY TABLE tt_tmp_2, nt_tmp_2; +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-TN-Temp << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_2, nt_tmp_2 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-TN-Temp << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-Temp-TT-Temp'; +DROP TEMPORARY TABLE tt_tmp_1, tt_tmp_2; +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-TT-Temp << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_1, tt_tmp_2 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-TT-Temp << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-Temp-NN-Temp'; +DROP TEMPORARY TABLE nt_tmp_1, nt_tmp_2; +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-NN-Temp << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_1, nt_tmp_2 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-NN-Temp << -e-e-e-e-e-e-e-e-e-e-e- + + +# +#2) Generates in the binlog what follows: +# +SET @commands= 'B T Drop-Temp-T-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_2; +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-T-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_2 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-T-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-T-Temp N Drop-Temp-T-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_2; +INSERT INTO nt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_1; +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-T-Temp N Drop-Temp-T-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_2 +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-T-Temp N Drop-Temp-T-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-N-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_2; +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-N-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_2 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-N-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-N-Temp N Drop-Temp-N-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_2; +INSERT INTO nt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_1; +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-N-Temp N Drop-Temp-N-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_2 +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-N-Temp N Drop-Temp-N-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-Xe-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_xx_1; +ERROR 42S02: Unknown table 'tt_xx_1' +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-Xe-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-Xe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-Xe-Temp N Drop-Temp-Xe-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_xx_1; +ERROR 42S02: Unknown table 'tt_xx_1' +INSERT INTO nt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_xx_1; +ERROR 42S02: Unknown table 'tt_xx_1' +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-Xe-Temp N Drop-Temp-Xe-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-Xe-Temp N Drop-Temp-Xe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-If-Xe-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE IF EXISTS tt_xx_1; +Warnings: +Note 1051 Unknown table 'tt_xx_1' +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-If-Xe-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS tt_xx_1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-Xe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-If-Xe-Temp N Drop-Temp-If-Xe-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE IF EXISTS tt_xx_1; +Warnings: +Note 1051 Unknown table 'tt_xx_1' +INSERT INTO nt_xx_1() VALUES (1); +DROP TEMPORARY TABLE IF EXISTS tt_xx_1; +Warnings: +Note 1051 Unknown table 'tt_xx_1' +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-If-Xe-Temp N Drop-Temp-If-Xe-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS tt_xx_1 +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS tt_xx_1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-Xe-Temp N Drop-Temp-If-Xe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-TXe-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_2, tt_1; +ERROR 42S02: Unknown table 'tt_1' +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TXe-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_2, tt_1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-TXe-Temp N Drop-Temp-TXe-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_2, tt_1; +ERROR 42S02: Unknown table 'tt_1' +INSERT INTO nt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_1, tt_1; +ERROR 42S02: Unknown table 'tt_1' +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TXe-Temp N Drop-Temp-TXe-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_2, tt_1 +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_1, tt_1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TXe-Temp N Drop-Temp-TXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-If-TXe-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE IF EXISTS tt_tmp_2, tt_1; +Warnings: +Note 1051 Unknown table 'tt_1' +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-If-TXe-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS tt_tmp_2, tt_1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-TXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-If-TXe-Temp N Drop-Temp-If-TXe-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE IF EXISTS tt_tmp_2, tt_1; +Warnings: +Note 1051 Unknown table 'tt_1' +INSERT INTO nt_xx_1() VALUES (1); +DROP TEMPORARY TABLE IF EXISTS tt_tmp_1, tt_1; +Warnings: +Note 1051 Unknown table 'tt_1' +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-If-TXe-Temp N Drop-Temp-If-TXe-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS tt_tmp_2, tt_1 +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS tt_tmp_1, tt_1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-TXe-Temp N Drop-Temp-If-TXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-NXe-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_2, tt_1; +ERROR 42S02: Unknown table 'tt_1' +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-NXe-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_2, tt_1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-NXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-NXe-Temp N Drop-Temp-NXe-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_2, tt_1; +ERROR 42S02: Unknown table 'tt_1' +INSERT INTO nt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_1, tt_1; +ERROR 42S02: Unknown table 'tt_1' +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-NXe-Temp N Drop-Temp-NXe-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_2, tt_1 +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_1, tt_1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-NXe-Temp N Drop-Temp-NXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-If-NXe-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE IF EXISTS nt_tmp_2, tt_1; +Warnings: +Note 1051 Unknown table 'tt_1' +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-If-NXe-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS nt_tmp_2, tt_1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-NXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-If-NXe-Temp N Drop-Temp-If-NXe-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE IF EXISTS nt_tmp_2, tt_1; +Warnings: +Note 1051 Unknown table 'tt_1' +INSERT INTO nt_xx_1() VALUES (1); +DROP TEMPORARY TABLE IF EXISTS nt_tmp_1, tt_1; +Warnings: +Note 1051 Unknown table 'tt_1' +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-If-NXe-Temp N Drop-Temp-If-NXe-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS nt_tmp_2, tt_1 +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS nt_tmp_1, tt_1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-NXe-Temp N Drop-Temp-If-NXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-TN-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_2, nt_tmp_2; +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TN-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_2, nt_tmp_2 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TN-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-TN-Temp N Drop-Temp-TN-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_2, nt_tmp_2; +INSERT INTO nt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_1, nt_tmp_2; +ERROR 42S02: Unknown table 'nt_tmp_2' +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TN-Temp N Drop-Temp-TN-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_2, nt_tmp_2 +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_1, nt_tmp_2 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TN-Temp N Drop-Temp-TN-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-TT-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_1, tt_tmp_2; +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TT-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_1, tt_tmp_2 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TT-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-TT-Temp N Drop-Temp-TT-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_1, tt_tmp_2; +INSERT INTO nt_xx_1() VALUES (1); +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TT-Temp N Drop-Temp-TT-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_1, tt_tmp_2 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TT-Temp N Drop-Temp-TT-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-NN-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_1, nt_tmp_2; +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-NN-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_1, nt_tmp_2 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-NN-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-NN-Temp N Drop-Temp-NN-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_1, nt_tmp_2; +INSERT INTO nt_xx_1() VALUES (1); +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-NN-Temp N Drop-Temp-NN-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_1, nt_tmp_2 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-NN-Temp N Drop-Temp-NN-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + + +# +#3) Generates in the binlog what follows: +# +SET @commands= 'B T Drop-Temp-T-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_2; +ROLLBACK; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-T-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_2 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-T-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-T-Temp N Drop-Temp-T-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_2; +INSERT INTO nt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_1; +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-T-Temp N Drop-Temp-T-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_2 +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_1 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-T-Temp N Drop-Temp-T-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-N-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_2; +ROLLBACK; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-N-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_2 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-N-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-N-Temp N Drop-Temp-N-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_2; +INSERT INTO nt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_1; +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-N-Temp N Drop-Temp-N-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_2 +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_1 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-N-Temp N Drop-Temp-N-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-Xe-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_xx_1; +ERROR 42S02: Unknown table 'tt_xx_1' +ROLLBACK; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-Xe-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-Xe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-Xe-Temp N Drop-Temp-Xe-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_xx_1; +ERROR 42S02: Unknown table 'tt_xx_1' +INSERT INTO nt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_xx_1; +ERROR 42S02: Unknown table 'tt_xx_1' +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-Xe-Temp N Drop-Temp-Xe-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-Xe-Temp N Drop-Temp-Xe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-If-Xe-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE IF EXISTS tt_xx_1; +Warnings: +Note 1051 Unknown table 'tt_xx_1' +ROLLBACK; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-If-Xe-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS tt_xx_1 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-Xe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-If-Xe-Temp N Drop-Temp-If-Xe-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE IF EXISTS tt_xx_1; +Warnings: +Note 1051 Unknown table 'tt_xx_1' +INSERT INTO nt_xx_1() VALUES (1); +DROP TEMPORARY TABLE IF EXISTS tt_xx_1; +Warnings: +Note 1051 Unknown table 'tt_xx_1' +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-If-Xe-Temp N Drop-Temp-If-Xe-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS tt_xx_1 +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS tt_xx_1 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-Xe-Temp N Drop-Temp-If-Xe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-TXe-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_2, tt_1; +ERROR 42S02: Unknown table 'tt_1' +ROLLBACK; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TXe-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_2, tt_1 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-TXe-Temp N Drop-Temp-TXe-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_2, tt_1; +ERROR 42S02: Unknown table 'tt_1' +INSERT INTO nt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_1, tt_1; +ERROR 42S02: Unknown table 'tt_1' +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TXe-Temp N Drop-Temp-TXe-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_2, tt_1 +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_1, tt_1 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TXe-Temp N Drop-Temp-TXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-If-TXe-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE IF EXISTS tt_tmp_2, tt_1; +Warnings: +Note 1051 Unknown table 'tt_1' +ROLLBACK; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-If-TXe-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS tt_tmp_2, tt_1 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-TXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-If-TXe-Temp N Drop-Temp-If-TXe-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE IF EXISTS tt_tmp_2, tt_1; +Warnings: +Note 1051 Unknown table 'tt_1' +INSERT INTO nt_xx_1() VALUES (1); +DROP TEMPORARY TABLE IF EXISTS tt_tmp_1, tt_1; +Warnings: +Note 1051 Unknown table 'tt_1' +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-If-TXe-Temp N Drop-Temp-If-TXe-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS tt_tmp_2, tt_1 +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS tt_tmp_1, tt_1 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-TXe-Temp N Drop-Temp-If-TXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-NXe-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_2, tt_1; +ERROR 42S02: Unknown table 'tt_1' +ROLLBACK; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-NXe-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_2, tt_1 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-NXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-NXe-Temp N Drop-Temp-NXe-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_2, tt_1; +ERROR 42S02: Unknown table 'tt_1' +INSERT INTO nt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_1, tt_1; +ERROR 42S02: Unknown table 'tt_1' +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-NXe-Temp N Drop-Temp-NXe-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_2, tt_1 +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_1, tt_1 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-NXe-Temp N Drop-Temp-NXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-If-NXe-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE IF EXISTS nt_tmp_2, tt_1; +Warnings: +Note 1051 Unknown table 'tt_1' +ROLLBACK; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-If-NXe-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS nt_tmp_2, tt_1 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-NXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-If-NXe-Temp N Drop-Temp-If-NXe-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE IF EXISTS nt_tmp_2, tt_1; +Warnings: +Note 1051 Unknown table 'tt_1' +INSERT INTO nt_xx_1() VALUES (1); +DROP TEMPORARY TABLE IF EXISTS nt_tmp_1, tt_1; +Warnings: +Note 1051 Unknown table 'tt_1' +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-If-NXe-Temp N Drop-Temp-If-NXe-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS nt_tmp_2, tt_1 +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS nt_tmp_1, tt_1 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-NXe-Temp N Drop-Temp-If-NXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-TN-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_2, nt_tmp_2; +ROLLBACK; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TN-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_2, nt_tmp_2 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TN-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-TN-Temp N Drop-Temp-TN-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_2, nt_tmp_2; +INSERT INTO nt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_1, nt_tmp_2; +ERROR 42S02: Unknown table 'nt_tmp_2' +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TN-Temp N Drop-Temp-TN-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_2, nt_tmp_2 +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_1, nt_tmp_2 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TN-Temp N Drop-Temp-TN-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-TT-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_1, tt_tmp_2; +ROLLBACK; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TT-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_1, tt_tmp_2 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TT-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-TT-Temp N Drop-Temp-TT-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_1, tt_tmp_2; +INSERT INTO nt_xx_1() VALUES (1); +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TT-Temp N Drop-Temp-TT-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_1, tt_tmp_2 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TT-Temp N Drop-Temp-TT-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-NN-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_1, nt_tmp_2; +ROLLBACK; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-NN-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_1, nt_tmp_2 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-NN-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-NN-Temp N Drop-Temp-NN-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_1, nt_tmp_2; +INSERT INTO nt_xx_1() VALUES (1); +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-NN-Temp N Drop-Temp-NN-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_1, nt_tmp_2 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-NN-Temp N Drop-Temp-NN-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +######################################################################### +# 2 - Tables dropped by "DROP TABLE" +######################################################################### + +# +#1) Generates in the binlog what follows: +# +SET @commands= 'Drop-T'; +DROP TABLE tt_2; +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-T << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE tt_2 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-T << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-N'; +DROP TABLE nt_2; +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-N << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE nt_2 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-N << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-Xe'; +DROP TABLE xx_1; +ERROR 42S02: Unknown table 'xx_1' +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Xe << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Xe << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-If-Xe'; +DROP TABLE IF EXISTS xx_1; +Warnings: +Note 1051 Unknown table 'xx_1' +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-If-Xe << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS xx_1 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-If-Xe << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-TXe'; +DROP TABLE tt_2, xx_1; +ERROR 42S02: Unknown table 'xx_1' +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-TXe << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE tt_2, xx_1 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-TXe << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-If-TXe'; +DROP TABLE IF EXISTS tt_2, xx_1; +Warnings: +Note 1051 Unknown table 'xx_1' +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-If-TXe << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_2, xx_1 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-If-TXe << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-NXe'; +DROP TABLE nt_2, xx_1; +ERROR 42S02: Unknown table 'xx_1' +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-NXe << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE nt_2, xx_1 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-NXe << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-If-NXe'; +DROP TABLE IF EXISTS nt_2, xx_1; +Warnings: +Note 1051 Unknown table 'xx_1' +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-If-NXe << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS nt_2, xx_1 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-If-NXe << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-TN'; +DROP TABLE tt_2, nt_2; +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-TN << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE tt_2, nt_2 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-TN << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-TT'; +DROP TABLE tt_1, tt_2; +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-TT << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE tt_1, tt_2 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-TT << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-NN'; +DROP TABLE nt_1, nt_2; +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-NN << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE nt_1, nt_2 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-NN << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-N-TN-Temp'; +DROP TABLE tt_tmp_2, nt_tmp_2, nt_2; +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-N-TN-Temp << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE tt_tmp_2, nt_tmp_2, nt_2 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-N-TN-Temp << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-TN-Temp'; +DROP TABLE tt_tmp_2, nt_tmp_2; +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-TN-Temp << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE tt_tmp_2, nt_tmp_2 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-TN-Temp << -e-e-e-e-e-e-e-e-e-e-e- + + +# +#2) Generates in the binlog what follows: +# +SET @commands= 'B T Drop-T'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TABLE tt_2; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-T << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP TABLE tt_2 +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-T << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-N'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TABLE nt_2; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-N << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP TABLE nt_2 +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-N << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Xe'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TABLE xx_1; +ERROR 42S02: Unknown table 'xx_1' +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Xe << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Xe << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-If-Xe'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TABLE IF EXISTS xx_1; +Warnings: +Note 1051 Unknown table 'xx_1' +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-If-Xe << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS xx_1 +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-If-Xe << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-TXe'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TABLE tt_2, xx_1; +ERROR 42S02: Unknown table 'xx_1' +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-TXe << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP TABLE tt_2, xx_1 +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-TXe << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-If-TXe'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TABLE IF EXISTS tt_2, xx_1; +Warnings: +Note 1051 Unknown table 'xx_1' +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-If-TXe << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_2, xx_1 +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-If-TXe << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-NXe'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TABLE nt_2, xx_1; +ERROR 42S02: Unknown table 'xx_1' +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-NXe << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP TABLE nt_2, xx_1 +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-NXe << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-If-NXe'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TABLE IF EXISTS nt_2, xx_1; +Warnings: +Note 1051 Unknown table 'xx_1' +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-If-NXe << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS nt_2, xx_1 +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-If-NXe << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-TN'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TABLE tt_2, nt_2; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-TN << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP TABLE tt_2, nt_2 +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-TN << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-TT'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TABLE tt_1, tt_2; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-TT << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP TABLE tt_1, tt_2 +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-TT << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-NN'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TABLE nt_1, nt_2; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-NN << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP TABLE nt_1, nt_2 +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-NN << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-N-TN-Temp'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TABLE tt_tmp_2, nt_tmp_2, nt_2; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-N-TN-Temp << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP TABLE tt_tmp_2, nt_tmp_2, nt_2 +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-N-TN-Temp << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-TN-Temp'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TABLE tt_tmp_2, nt_tmp_2; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-TN-Temp << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP TABLE tt_tmp_2, nt_tmp_2 +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-TN-Temp << -e-e-e-e-e-e-e-e-e-e-e- + +######################################################################### +# 3 - CREATE TEMPORARY TABLE +######################################################################### + +# +#1) Generates in the binlog what follows: +# +SET @commands= 'Drop-Temp-N-Temp Create-N-Temp Drop-Temp-N-Temp Drop-Temp-N-Temp'; +DROP TEMPORARY TABLE nt_tmp_2; +CREATE TEMPORARY TABLE nt_tmp_2 ( id INT ) engine= MyIsam; +DROP TEMPORARY TABLE nt_tmp_1; +DROP TEMPORARY TABLE nt_tmp_2; +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-N-Temp Create-N-Temp Drop-Temp-N-Temp Drop-Temp-N-Temp << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_2 +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE nt_tmp_2 ( id INT ) engine= MyIsam +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_1 +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_2 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-N-Temp Create-N-Temp Drop-Temp-N-Temp Drop-Temp-N-Temp << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp'; +DROP TEMPORARY TABLE tt_tmp_2; +CREATE TEMPORARY TABLE tt_tmp_2 ( id INT ) engine= Innodb; +DROP TEMPORARY TABLE tt_tmp_1; +DROP TEMPORARY TABLE tt_tmp_2; +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_2 +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_tmp_2 ( id INT ) engine= Innodb +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_1 +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_2 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp << -e-e-e-e-e-e-e-e-e-e-e- + + +# +#2) Generates in the binlog what follows: +# +SET @commands= 'B T Drop-Temp-N-Temp Create-N-Temp Drop-Temp-N-Temp Drop-Temp-N-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_2; +CREATE TEMPORARY TABLE nt_tmp_2 ( id INT ) engine= MyIsam; +DROP TEMPORARY TABLE nt_tmp_1; +DROP TEMPORARY TABLE nt_tmp_2; +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-N-Temp Create-N-Temp Drop-Temp-N-Temp Drop-Temp-N-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_2 +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE nt_tmp_2 ( id INT ) engine= MyIsam +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_1 +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_2 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-N-Temp Create-N-Temp Drop-Temp-N-Temp Drop-Temp-N-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp C'; +BEGIN; +DROP TEMPORARY TABLE tt_tmp_2; +CREATE TEMPORARY TABLE tt_tmp_2 ( id INT ) engine= Innodb; +DROP TEMPORARY TABLE tt_tmp_1; +DROP TEMPORARY TABLE tt_tmp_2; +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_2 +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_tmp_2 ( id INT ) engine= Innodb +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_1 +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_2 +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + + +# +#3) Generates in the binlog what follows: +# +SET @commands= 'B T Drop-Temp-N-Temp Create-N-Temp Drop-Temp-N-Temp Drop-Temp-N-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_2; +CREATE TEMPORARY TABLE nt_tmp_2 ( id INT ) engine= MyIsam; +DROP TEMPORARY TABLE nt_tmp_1; +DROP TEMPORARY TABLE nt_tmp_2; +ROLLBACK; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-N-Temp Create-N-Temp Drop-Temp-N-Temp Drop-Temp-N-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_2 +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE nt_tmp_2 ( id INT ) engine= MyIsam +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_1 +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_2 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-N-Temp Create-N-Temp Drop-Temp-N-Temp Drop-Temp-N-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp R'; +BEGIN; +DROP TEMPORARY TABLE tt_tmp_2; +CREATE TEMPORARY TABLE tt_tmp_2 ( id INT ) engine= Innodb; +DROP TEMPORARY TABLE tt_tmp_1; +DROP TEMPORARY TABLE tt_tmp_2; +ROLLBACK; +-b-b-b-b-b-b-b-b-b-b-b- >> B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_2 +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_tmp_2 ( id INT ) engine= Innodb +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_1 +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_2 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +######################################################################### +# 4 - CHANGING TEMPORARY TABLES +######################################################################### + +# +#1) Generates in the binlog what follows: +# +SET @commands= 'B N N-Temp N-SELECT-N-Temp N-Temp C'; +BEGIN; +INSERT INTO nt_xx_1() VALUES (1); +INSERT INTO nt_tmp_xx_1() VALUES (1); +INSERT INTO nt_xx_1 SELECT * FROM nt_tmp_xx_1; +INSERT INTO nt_tmp_xx_1() VALUES (1); +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B N N-Temp N-SELECT-N-Temp N-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_tmp_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1 SELECT * FROM nt_tmp_xx_1 +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_tmp_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N N-Temp N-SELECT-N-Temp N-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B N N-Temp T-SELECT-N-Temp N-Temp C'; +BEGIN; +INSERT INTO nt_xx_1() VALUES (1); +INSERT INTO nt_tmp_xx_1() VALUES (1); +INSERT INTO tt_xx_1 SELECT * FROM nt_tmp_xx_1; +INSERT INTO nt_tmp_xx_1() VALUES (1); +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B N N-Temp T-SELECT-N-Temp N-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_tmp_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1 SELECT * FROM nt_tmp_xx_1 +master-bin.000001 # Query # # use `test`; INSERT INTO nt_tmp_xx_1() VALUES (1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N N-Temp T-SELECT-N-Temp N-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B N N-Temp N-SELECT-T-Temp N-Temp C'; +BEGIN; +INSERT INTO nt_xx_1() VALUES (1); +INSERT INTO nt_tmp_xx_1() VALUES (1); +INSERT INTO nt_xx_1 SELECT * FROM tt_tmp_xx_1; +INSERT INTO nt_tmp_xx_1() VALUES (1); +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B N N-Temp N-SELECT-T-Temp N-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_tmp_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1 SELECT * FROM tt_tmp_xx_1 +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_tmp_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N N-Temp N-SELECT-T-Temp N-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B N N-Temp T-SELECT-T-Temp N-Temp C'; +BEGIN; +INSERT INTO nt_xx_1() VALUES (1); +INSERT INTO nt_tmp_xx_1() VALUES (1); +INSERT INTO tt_xx_1 SELECT * FROM tt_tmp_xx_1; +INSERT INTO nt_tmp_xx_1() VALUES (1); +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B N N-Temp T-SELECT-T-Temp N-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_tmp_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1 SELECT * FROM tt_tmp_xx_1 +master-bin.000001 # Query # # use `test`; INSERT INTO nt_tmp_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N N-Temp T-SELECT-T-Temp N-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + + + +# +#2) Generates in the binlog what follows: +# +SET @commands= 'B N N-Temp N-SELECT-N-Temp N-Temp R'; +BEGIN; +INSERT INTO nt_xx_1() VALUES (1); +INSERT INTO nt_tmp_xx_1() VALUES (1); +INSERT INTO nt_xx_1 SELECT * FROM nt_tmp_xx_1; +INSERT INTO nt_tmp_xx_1() VALUES (1); +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +-b-b-b-b-b-b-b-b-b-b-b- >> B N N-Temp N-SELECT-N-Temp N-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_tmp_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1 SELECT * FROM nt_tmp_xx_1 +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_tmp_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N N-Temp N-SELECT-N-Temp N-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B N N-Temp T-SELECT-N-Temp N-Temp R'; +BEGIN; +INSERT INTO nt_xx_1() VALUES (1); +INSERT INTO nt_tmp_xx_1() VALUES (1); +INSERT INTO tt_xx_1 SELECT * FROM nt_tmp_xx_1; +INSERT INTO nt_tmp_xx_1() VALUES (1); +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +-b-b-b-b-b-b-b-b-b-b-b- >> B N N-Temp T-SELECT-N-Temp N-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_tmp_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1 SELECT * FROM nt_tmp_xx_1 +master-bin.000001 # Query # # use `test`; INSERT INTO nt_tmp_xx_1() VALUES (1) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B N N-Temp T-SELECT-N-Temp N-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B N N-Temp N-SELECT-T-Temp N-Temp R'; +BEGIN; +INSERT INTO nt_xx_1() VALUES (1); +INSERT INTO nt_tmp_xx_1() VALUES (1); +INSERT INTO nt_xx_1 SELECT * FROM tt_tmp_xx_1; +INSERT INTO nt_tmp_xx_1() VALUES (1); +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +-b-b-b-b-b-b-b-b-b-b-b- >> B N N-Temp N-SELECT-T-Temp N-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_tmp_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1 SELECT * FROM tt_tmp_xx_1 +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_tmp_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N N-Temp N-SELECT-T-Temp N-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B N N-Temp T-SELECT-T-Temp N-Temp R'; +BEGIN; +INSERT INTO nt_xx_1() VALUES (1); +INSERT INTO nt_tmp_xx_1() VALUES (1); +INSERT INTO tt_xx_1 SELECT * FROM tt_tmp_xx_1; +INSERT INTO nt_tmp_xx_1() VALUES (1); +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +-b-b-b-b-b-b-b-b-b-b-b- >> B N N-Temp T-SELECT-T-Temp N-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_tmp_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1 SELECT * FROM tt_tmp_xx_1 +master-bin.000001 # Query # # use `test`; INSERT INTO nt_tmp_xx_1() VALUES (1) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B N N-Temp T-SELECT-T-Temp N-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +################################################################################### +# CHECK CONSISTENCY +################################################################################### +######################################################################### +# CLEAN +######################################################################### +SET @commands= 'clean'; +DROP TABLE IF EXISTS tt_xx_1; +DROP TABLE IF EXISTS nt_xx_1; +DROP TABLE IF EXISTS nt_2; +DROP TABLE IF EXISTS nt_1; +DROP TABLE IF EXISTS tt_2; +DROP TABLE IF EXISTS tt_1; +SET @commands= ''; diff --git a/mysql-test/suite/rpl/r/rpl_row_drop_create_temp_table.result b/mysql-test/suite/rpl/r/rpl_row_drop_create_temp_table.result new file mode 100644 index 00000000000..fa9412de67e --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_row_drop_create_temp_table.result @@ -0,0 +1,1539 @@ +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; +######################################################################### +# CONFIGURATION +######################################################################### +call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT."); +SET @commands= 'configure'; +CREATE TABLE tt_xx_1 ( id INT ) ENGINE = Innodb; +CREATE TABLE nt_xx_1 ( id INT ) ENGINE = MyIsam; +CREATE TEMPORARY TABLE nt_tmp_xx_1 ( id INT ) ENGINE = MyIsam; +CREATE TEMPORARY TABLE tt_tmp_xx_1 ( id INT ) ENGINE = Innodb; +DROP TEMPORARY TABLE IF EXISTS nt_tmp_2; +Warnings: +Note 1051 Unknown table 'nt_tmp_2' +CREATE TEMPORARY TABLE nt_tmp_2 ( id INT ) ENGINE = MyIsam; +DROP TEMPORARY TABLE IF EXISTS nt_tmp_1; +Warnings: +Note 1051 Unknown table 'nt_tmp_1' +CREATE TEMPORARY TABLE nt_tmp_1 ( id INT ) ENGINE = MyIsam; +DROP TEMPORARY TABLE IF EXISTS tt_tmp_2; +Warnings: +Note 1051 Unknown table 'tt_tmp_2' +CREATE TEMPORARY TABLE tt_tmp_2 ( id INT ) ENGINE = Innodb; +DROP TEMPORARY TABLE IF EXISTS tt_tmp_1; +Warnings: +Note 1051 Unknown table 'tt_tmp_1' +CREATE TEMPORARY TABLE tt_tmp_1 ( id INT ) ENGINE = Innodb; +DROP TABLE IF EXISTS nt_2; +Warnings: +Note 1051 Unknown table 'nt_2' +CREATE TABLE nt_2 ( id INT ) ENGINE = MyIsam; +DROP TABLE IF EXISTS nt_1; +Warnings: +Note 1051 Unknown table 'nt_1' +CREATE TABLE nt_1 ( id INT ) ENGINE = MyIsam; +DROP TABLE IF EXISTS tt_2; +Warnings: +Note 1051 Unknown table 'tt_2' +CREATE TABLE tt_2 ( id INT ) ENGINE = Innodb; +DROP TABLE IF EXISTS tt_1; +Warnings: +Note 1051 Unknown table 'tt_1' +CREATE TABLE tt_1 ( id INT ) ENGINE = Innodb; +SET @commands= ''; +######################################################################### +# 1 - Tables dropped by "DROP TEMPORARY TABLE" +######################################################################### + +# +#1) Generates in the binlog what follows: +# +SET @commands= 'Drop-Temp-T-Temp'; +DROP TEMPORARY TABLE tt_tmp_2; +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-Temp-N-Temp'; +DROP TEMPORARY TABLE nt_tmp_2; +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-N-Temp << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-N-Temp << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-Temp-Xe-Temp'; +DROP TEMPORARY TABLE tt_xx_1; +ERROR 42S02: Unknown table 'tt_xx_1' +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-Xe-Temp << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-Xe-Temp << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-Temp-If-Xe-Temp'; +DROP TEMPORARY TABLE IF EXISTS tt_xx_1; +Warnings: +Note 1051 Unknown table 'tt_xx_1' +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-If-Xe-Temp << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-If-Xe-Temp << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-Temp-TXe-Temp'; +DROP TEMPORARY TABLE tt_tmp_2, tt_1; +ERROR 42S02: Unknown table 'tt_1' +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-TXe-Temp << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-TXe-Temp << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-Temp-If-TXe-Temp'; +DROP TEMPORARY TABLE IF EXISTS tt_tmp_2, tt_1; +Warnings: +Note 1051 Unknown table 'tt_1' +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-If-TXe-Temp << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-If-TXe-Temp << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-Temp-NXe-Temp'; +DROP TEMPORARY TABLE nt_tmp_2, tt_1; +ERROR 42S02: Unknown table 'tt_1' +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-NXe-Temp << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-NXe-Temp << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-Temp-If-NXe-Temp'; +DROP TEMPORARY TABLE IF EXISTS nt_tmp_2, tt_1; +Warnings: +Note 1051 Unknown table 'tt_1' +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-If-NXe-Temp << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-If-NXe-Temp << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-Temp-TN-Temp'; +DROP TEMPORARY TABLE tt_tmp_2, nt_tmp_2; +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-TN-Temp << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2`,`nt_tmp_2` /* generated by server */ +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-TN-Temp << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-Temp-TT-Temp'; +DROP TEMPORARY TABLE tt_tmp_1, tt_tmp_2; +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-TT-Temp << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1`,`tt_tmp_2` /* generated by server */ +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-TT-Temp << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-Temp-NN-Temp'; +DROP TEMPORARY TABLE nt_tmp_1, nt_tmp_2; +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-NN-Temp << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1`,`nt_tmp_2` /* generated by server */ +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-NN-Temp << -e-e-e-e-e-e-e-e-e-e-e- + + +# +#2) Generates in the binlog what follows: +# +SET @commands= 'B T Drop-Temp-T-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_2; +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-T-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-T-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-T-Temp N Drop-Temp-T-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_2; +INSERT INTO nt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_1; +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-T-Temp N Drop-Temp-T-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1` /* generated by server */ +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-T-Temp N Drop-Temp-T-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-N-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_2; +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-N-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-N-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-N-Temp N Drop-Temp-N-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_2; +INSERT INTO nt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_1; +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-N-Temp N Drop-Temp-N-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1` /* generated by server */ +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-N-Temp N Drop-Temp-N-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-Xe-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_xx_1; +ERROR 42S02: Unknown table 'tt_xx_1' +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-Xe-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-Xe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-Xe-Temp N Drop-Temp-Xe-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_xx_1; +ERROR 42S02: Unknown table 'tt_xx_1' +INSERT INTO nt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_xx_1; +ERROR 42S02: Unknown table 'tt_xx_1' +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-Xe-Temp N Drop-Temp-Xe-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-Xe-Temp N Drop-Temp-Xe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-If-Xe-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE IF EXISTS tt_xx_1; +Warnings: +Note 1051 Unknown table 'tt_xx_1' +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-If-Xe-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-Xe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-If-Xe-Temp N Drop-Temp-If-Xe-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE IF EXISTS tt_xx_1; +Warnings: +Note 1051 Unknown table 'tt_xx_1' +INSERT INTO nt_xx_1() VALUES (1); +DROP TEMPORARY TABLE IF EXISTS tt_xx_1; +Warnings: +Note 1051 Unknown table 'tt_xx_1' +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-If-Xe-Temp N Drop-Temp-If-Xe-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-Xe-Temp N Drop-Temp-If-Xe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-TXe-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_2, tt_1; +ERROR 42S02: Unknown table 'tt_1' +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TXe-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-TXe-Temp N Drop-Temp-TXe-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_2, tt_1; +ERROR 42S02: Unknown table 'tt_1' +INSERT INTO nt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_1, tt_1; +ERROR 42S02: Unknown table 'tt_1' +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TXe-Temp N Drop-Temp-TXe-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1` /* generated by server */ +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TXe-Temp N Drop-Temp-TXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-If-TXe-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE IF EXISTS tt_tmp_2, tt_1; +Warnings: +Note 1051 Unknown table 'tt_1' +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-If-TXe-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-TXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-If-TXe-Temp N Drop-Temp-If-TXe-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE IF EXISTS tt_tmp_2, tt_1; +Warnings: +Note 1051 Unknown table 'tt_1' +INSERT INTO nt_xx_1() VALUES (1); +DROP TEMPORARY TABLE IF EXISTS tt_tmp_1, tt_1; +Warnings: +Note 1051 Unknown table 'tt_1' +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-If-TXe-Temp N Drop-Temp-If-TXe-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1` /* generated by server */ +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-TXe-Temp N Drop-Temp-If-TXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-NXe-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_2, tt_1; +ERROR 42S02: Unknown table 'tt_1' +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-NXe-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-NXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-NXe-Temp N Drop-Temp-NXe-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_2, tt_1; +ERROR 42S02: Unknown table 'tt_1' +INSERT INTO nt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_1, tt_1; +ERROR 42S02: Unknown table 'tt_1' +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-NXe-Temp N Drop-Temp-NXe-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1` /* generated by server */ +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-NXe-Temp N Drop-Temp-NXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-If-NXe-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE IF EXISTS nt_tmp_2, tt_1; +Warnings: +Note 1051 Unknown table 'tt_1' +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-If-NXe-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-NXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-If-NXe-Temp N Drop-Temp-If-NXe-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE IF EXISTS nt_tmp_2, tt_1; +Warnings: +Note 1051 Unknown table 'tt_1' +INSERT INTO nt_xx_1() VALUES (1); +DROP TEMPORARY TABLE IF EXISTS nt_tmp_1, tt_1; +Warnings: +Note 1051 Unknown table 'tt_1' +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-If-NXe-Temp N Drop-Temp-If-NXe-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1` /* generated by server */ +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-NXe-Temp N Drop-Temp-If-NXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-TN-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_2, nt_tmp_2; +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TN-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2`,`nt_tmp_2` /* generated by server */ +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TN-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-TN-Temp N Drop-Temp-TN-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_2, nt_tmp_2; +INSERT INTO nt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_1, nt_tmp_2; +ERROR 42S02: Unknown table 'nt_tmp_2' +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TN-Temp N Drop-Temp-TN-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2`,`nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1` /* generated by server */ +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TN-Temp N Drop-Temp-TN-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-TT-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_1, tt_tmp_2; +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TT-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1`,`tt_tmp_2` /* generated by server */ +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TT-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-TT-Temp N Drop-Temp-TT-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_1, tt_tmp_2; +INSERT INTO nt_xx_1() VALUES (1); +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TT-Temp N Drop-Temp-TT-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1`,`tt_tmp_2` /* generated by server */ +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TT-Temp N Drop-Temp-TT-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-NN-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_1, nt_tmp_2; +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-NN-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1`,`nt_tmp_2` /* generated by server */ +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-NN-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-NN-Temp N Drop-Temp-NN-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_1, nt_tmp_2; +INSERT INTO nt_xx_1() VALUES (1); +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-NN-Temp N Drop-Temp-NN-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1`,`nt_tmp_2` /* generated by server */ +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-NN-Temp N Drop-Temp-NN-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + + +# +#3) Generates in the binlog what follows: +# +SET @commands= 'B T Drop-Temp-T-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_2; +ROLLBACK; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-T-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-T-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-T-Temp N Drop-Temp-T-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_2; +INSERT INTO nt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_1; +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-T-Temp N Drop-Temp-T-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-T-Temp N Drop-Temp-T-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-N-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_2; +ROLLBACK; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-N-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-N-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-N-Temp N Drop-Temp-N-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_2; +INSERT INTO nt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_1; +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-N-Temp N Drop-Temp-N-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-N-Temp N Drop-Temp-N-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-Xe-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_xx_1; +ERROR 42S02: Unknown table 'tt_xx_1' +ROLLBACK; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-Xe-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-Xe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-Xe-Temp N Drop-Temp-Xe-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_xx_1; +ERROR 42S02: Unknown table 'tt_xx_1' +INSERT INTO nt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_xx_1; +ERROR 42S02: Unknown table 'tt_xx_1' +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-Xe-Temp N Drop-Temp-Xe-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-Xe-Temp N Drop-Temp-Xe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-If-Xe-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE IF EXISTS tt_xx_1; +Warnings: +Note 1051 Unknown table 'tt_xx_1' +ROLLBACK; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-If-Xe-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-Xe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-If-Xe-Temp N Drop-Temp-If-Xe-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE IF EXISTS tt_xx_1; +Warnings: +Note 1051 Unknown table 'tt_xx_1' +INSERT INTO nt_xx_1() VALUES (1); +DROP TEMPORARY TABLE IF EXISTS tt_xx_1; +Warnings: +Note 1051 Unknown table 'tt_xx_1' +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-If-Xe-Temp N Drop-Temp-If-Xe-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-Xe-Temp N Drop-Temp-If-Xe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-TXe-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_2, tt_1; +ERROR 42S02: Unknown table 'tt_1' +ROLLBACK; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TXe-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-TXe-Temp N Drop-Temp-TXe-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_2, tt_1; +ERROR 42S02: Unknown table 'tt_1' +INSERT INTO nt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_1, tt_1; +ERROR 42S02: Unknown table 'tt_1' +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TXe-Temp N Drop-Temp-TXe-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TXe-Temp N Drop-Temp-TXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-If-TXe-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE IF EXISTS tt_tmp_2, tt_1; +Warnings: +Note 1051 Unknown table 'tt_1' +ROLLBACK; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-If-TXe-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-TXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-If-TXe-Temp N Drop-Temp-If-TXe-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE IF EXISTS tt_tmp_2, tt_1; +Warnings: +Note 1051 Unknown table 'tt_1' +INSERT INTO nt_xx_1() VALUES (1); +DROP TEMPORARY TABLE IF EXISTS tt_tmp_1, tt_1; +Warnings: +Note 1051 Unknown table 'tt_1' +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-If-TXe-Temp N Drop-Temp-If-TXe-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-TXe-Temp N Drop-Temp-If-TXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-NXe-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_2, tt_1; +ERROR 42S02: Unknown table 'tt_1' +ROLLBACK; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-NXe-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-NXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-NXe-Temp N Drop-Temp-NXe-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_2, tt_1; +ERROR 42S02: Unknown table 'tt_1' +INSERT INTO nt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_1, tt_1; +ERROR 42S02: Unknown table 'tt_1' +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-NXe-Temp N Drop-Temp-NXe-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-NXe-Temp N Drop-Temp-NXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-If-NXe-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE IF EXISTS nt_tmp_2, tt_1; +Warnings: +Note 1051 Unknown table 'tt_1' +ROLLBACK; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-If-NXe-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-NXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-If-NXe-Temp N Drop-Temp-If-NXe-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE IF EXISTS nt_tmp_2, tt_1; +Warnings: +Note 1051 Unknown table 'tt_1' +INSERT INTO nt_xx_1() VALUES (1); +DROP TEMPORARY TABLE IF EXISTS nt_tmp_1, tt_1; +Warnings: +Note 1051 Unknown table 'tt_1' +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-If-NXe-Temp N Drop-Temp-If-NXe-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-NXe-Temp N Drop-Temp-If-NXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-TN-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_2, nt_tmp_2; +ROLLBACK; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TN-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2`,`nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TN-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-TN-Temp N Drop-Temp-TN-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_2, nt_tmp_2; +INSERT INTO nt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_1, nt_tmp_2; +ERROR 42S02: Unknown table 'nt_tmp_2' +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TN-Temp N Drop-Temp-TN-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2`,`nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TN-Temp N Drop-Temp-TN-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-TT-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_1, tt_tmp_2; +ROLLBACK; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TT-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1`,`tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TT-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-TT-Temp N Drop-Temp-TT-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_1, tt_tmp_2; +INSERT INTO nt_xx_1() VALUES (1); +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TT-Temp N Drop-Temp-TT-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1`,`tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TT-Temp N Drop-Temp-TT-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-NN-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_1, nt_tmp_2; +ROLLBACK; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-NN-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1`,`nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-NN-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-NN-Temp N Drop-Temp-NN-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_1, nt_tmp_2; +INSERT INTO nt_xx_1() VALUES (1); +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-NN-Temp N Drop-Temp-NN-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1`,`nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-NN-Temp N Drop-Temp-NN-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +######################################################################### +# 2 - Tables dropped by "DROP TABLE" +######################################################################### + +# +#1) Generates in the binlog what follows: +# +SET @commands= 'Drop-T'; +DROP TABLE tt_2; +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-T << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE tt_2 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-T << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-N'; +DROP TABLE nt_2; +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-N << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE nt_2 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-N << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-Xe'; +DROP TABLE xx_1; +ERROR 42S02: Unknown table 'xx_1' +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Xe << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Xe << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-If-Xe'; +DROP TABLE IF EXISTS xx_1; +Warnings: +Note 1051 Unknown table 'xx_1' +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-If-Xe << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS xx_1 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-If-Xe << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-TXe'; +DROP TABLE tt_2, xx_1; +ERROR 42S02: Unknown table 'xx_1' +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-TXe << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE tt_2, xx_1 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-TXe << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-If-TXe'; +DROP TABLE IF EXISTS tt_2, xx_1; +Warnings: +Note 1051 Unknown table 'xx_1' +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-If-TXe << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_2, xx_1 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-If-TXe << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-NXe'; +DROP TABLE nt_2, xx_1; +ERROR 42S02: Unknown table 'xx_1' +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-NXe << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE nt_2, xx_1 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-NXe << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-If-NXe'; +DROP TABLE IF EXISTS nt_2, xx_1; +Warnings: +Note 1051 Unknown table 'xx_1' +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-If-NXe << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS nt_2, xx_1 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-If-NXe << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-TN'; +DROP TABLE tt_2, nt_2; +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-TN << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE tt_2, nt_2 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-TN << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-TT'; +DROP TABLE tt_1, tt_2; +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-TT << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE tt_1, tt_2 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-TT << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-NN'; +DROP TABLE nt_1, nt_2; +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-NN << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE nt_1, nt_2 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-NN << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-N-TN-Temp'; +DROP TABLE tt_tmp_2, nt_tmp_2, nt_2; +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-N-TN-Temp << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE `nt_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2`,`nt_tmp_2` /* generated by server */ +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-N-TN-Temp << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-TN-Temp'; +DROP TABLE tt_tmp_2, nt_tmp_2; +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-TN-Temp << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2`,`nt_tmp_2` /* generated by server */ +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-TN-Temp << -e-e-e-e-e-e-e-e-e-e-e- + + +# +#2) Generates in the binlog what follows: +# +SET @commands= 'B T Drop-T'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TABLE tt_2; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-T << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP TABLE tt_2 +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-T << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-N'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TABLE nt_2; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-N << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP TABLE nt_2 +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-N << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Xe'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TABLE xx_1; +ERROR 42S02: Unknown table 'xx_1' +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Xe << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Xe << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-If-Xe'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TABLE IF EXISTS xx_1; +Warnings: +Note 1051 Unknown table 'xx_1' +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-If-Xe << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS xx_1 +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-If-Xe << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-TXe'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TABLE tt_2, xx_1; +ERROR 42S02: Unknown table 'xx_1' +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-TXe << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP TABLE tt_2, xx_1 +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-TXe << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-If-TXe'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TABLE IF EXISTS tt_2, xx_1; +Warnings: +Note 1051 Unknown table 'xx_1' +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-If-TXe << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_2, xx_1 +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-If-TXe << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-NXe'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TABLE nt_2, xx_1; +ERROR 42S02: Unknown table 'xx_1' +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-NXe << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP TABLE nt_2, xx_1 +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-NXe << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-If-NXe'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TABLE IF EXISTS nt_2, xx_1; +Warnings: +Note 1051 Unknown table 'xx_1' +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-If-NXe << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS nt_2, xx_1 +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-If-NXe << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-TN'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TABLE tt_2, nt_2; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-TN << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP TABLE tt_2, nt_2 +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-TN << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-TT'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TABLE tt_1, tt_2; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-TT << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP TABLE tt_1, tt_2 +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-TT << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-NN'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TABLE nt_1, nt_2; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-NN << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP TABLE nt_1, nt_2 +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-NN << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-N-TN-Temp'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TABLE tt_tmp_2, nt_tmp_2, nt_2; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-N-TN-Temp << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP TABLE `nt_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2`,`nt_tmp_2` /* generated by server */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-N-TN-Temp << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-TN-Temp'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TABLE tt_tmp_2, nt_tmp_2; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-TN-Temp << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2`,`nt_tmp_2` /* generated by server */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-TN-Temp << -e-e-e-e-e-e-e-e-e-e-e- + +######################################################################### +# 3 - CREATE TEMPORARY TABLE +######################################################################### + +# +#1) Generates in the binlog what follows: +# +SET @commands= 'Drop-Temp-N-Temp Create-N-Temp Drop-Temp-N-Temp Drop-Temp-N-Temp'; +DROP TEMPORARY TABLE nt_tmp_2; +CREATE TEMPORARY TABLE nt_tmp_2 ( id INT ) engine= MyIsam; +DROP TEMPORARY TABLE nt_tmp_1; +DROP TEMPORARY TABLE nt_tmp_2; +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-N-Temp Create-N-Temp Drop-Temp-N-Temp Drop-Temp-N-Temp << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-N-Temp Create-N-Temp Drop-Temp-N-Temp Drop-Temp-N-Temp << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp'; +DROP TEMPORARY TABLE tt_tmp_2; +CREATE TEMPORARY TABLE tt_tmp_2 ( id INT ) engine= Innodb; +DROP TEMPORARY TABLE tt_tmp_1; +DROP TEMPORARY TABLE tt_tmp_2; +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp << -e-e-e-e-e-e-e-e-e-e-e- + + +# +#2) Generates in the binlog what follows: +# +SET @commands= 'B T Drop-Temp-N-Temp Create-N-Temp Drop-Temp-N-Temp Drop-Temp-N-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_2; +CREATE TEMPORARY TABLE nt_tmp_2 ( id INT ) engine= MyIsam; +DROP TEMPORARY TABLE nt_tmp_1; +DROP TEMPORARY TABLE nt_tmp_2; +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-N-Temp Create-N-Temp Drop-Temp-N-Temp Drop-Temp-N-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-N-Temp Create-N-Temp Drop-Temp-N-Temp Drop-Temp-N-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp C'; +BEGIN; +DROP TEMPORARY TABLE tt_tmp_2; +CREATE TEMPORARY TABLE tt_tmp_2 ( id INT ) engine= Innodb; +DROP TEMPORARY TABLE tt_tmp_1; +DROP TEMPORARY TABLE tt_tmp_2; +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + + +# +#3) Generates in the binlog what follows: +# +SET @commands= 'B T Drop-Temp-N-Temp Create-N-Temp Drop-Temp-N-Temp Drop-Temp-N-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_2; +CREATE TEMPORARY TABLE nt_tmp_2 ( id INT ) engine= MyIsam; +DROP TEMPORARY TABLE nt_tmp_1; +DROP TEMPORARY TABLE nt_tmp_2; +ROLLBACK; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-N-Temp Create-N-Temp Drop-Temp-N-Temp Drop-Temp-N-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `nt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-N-Temp Create-N-Temp Drop-Temp-N-Temp Drop-Temp-N-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp R'; +BEGIN; +DROP TEMPORARY TABLE tt_tmp_2; +CREATE TEMPORARY TABLE tt_tmp_2 ( id INT ) engine= Innodb; +DROP TEMPORARY TABLE tt_tmp_1; +DROP TEMPORARY TABLE tt_tmp_2; +ROLLBACK; +-b-b-b-b-b-b-b-b-b-b-b- >> B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_1` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt_tmp_2` /* generated by server */ +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +######################################################################### +# 4 - CHANGING TEMPORARY TABLES +######################################################################### + +# +#1) Generates in the binlog what follows: +# +SET @commands= 'B N N-Temp N-SELECT-N-Temp N-Temp C'; +BEGIN; +INSERT INTO nt_xx_1() VALUES (1); +INSERT INTO nt_tmp_xx_1() VALUES (1); +INSERT INTO nt_xx_1 SELECT * FROM nt_tmp_xx_1; +INSERT INTO nt_tmp_xx_1() VALUES (1); +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B N N-Temp N-SELECT-N-Temp N-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N N-Temp N-SELECT-N-Temp N-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B N N-Temp T-SELECT-N-Temp N-Temp C'; +BEGIN; +INSERT INTO nt_xx_1() VALUES (1); +INSERT INTO nt_tmp_xx_1() VALUES (1); +INSERT INTO tt_xx_1 SELECT * FROM nt_tmp_xx_1; +INSERT INTO nt_tmp_xx_1() VALUES (1); +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B N N-Temp T-SELECT-N-Temp N-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N N-Temp T-SELECT-N-Temp N-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B N N-Temp N-SELECT-T-Temp N-Temp C'; +BEGIN; +INSERT INTO nt_xx_1() VALUES (1); +INSERT INTO nt_tmp_xx_1() VALUES (1); +INSERT INTO nt_xx_1 SELECT * FROM tt_tmp_xx_1; +INSERT INTO nt_tmp_xx_1() VALUES (1); +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B N N-Temp N-SELECT-T-Temp N-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N N-Temp N-SELECT-T-Temp N-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B N N-Temp T-SELECT-T-Temp N-Temp C'; +BEGIN; +INSERT INTO nt_xx_1() VALUES (1); +INSERT INTO nt_tmp_xx_1() VALUES (1); +INSERT INTO tt_xx_1 SELECT * FROM tt_tmp_xx_1; +INSERT INTO nt_tmp_xx_1() VALUES (1); +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B N N-Temp T-SELECT-T-Temp N-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N N-Temp T-SELECT-T-Temp N-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + + + +# +#2) Generates in the binlog what follows: +# +SET @commands= 'B N N-Temp N-SELECT-N-Temp N-Temp R'; +BEGIN; +INSERT INTO nt_xx_1() VALUES (1); +INSERT INTO nt_tmp_xx_1() VALUES (1); +INSERT INTO nt_xx_1 SELECT * FROM nt_tmp_xx_1; +INSERT INTO nt_tmp_xx_1() VALUES (1); +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +-b-b-b-b-b-b-b-b-b-b-b- >> B N N-Temp N-SELECT-N-Temp N-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N N-Temp N-SELECT-N-Temp N-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B N N-Temp T-SELECT-N-Temp N-Temp R'; +BEGIN; +INSERT INTO nt_xx_1() VALUES (1); +INSERT INTO nt_tmp_xx_1() VALUES (1); +INSERT INTO tt_xx_1 SELECT * FROM nt_tmp_xx_1; +INSERT INTO nt_tmp_xx_1() VALUES (1); +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +-b-b-b-b-b-b-b-b-b-b-b- >> B N N-Temp T-SELECT-N-Temp N-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N N-Temp T-SELECT-N-Temp N-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B N N-Temp N-SELECT-T-Temp N-Temp R'; +BEGIN; +INSERT INTO nt_xx_1() VALUES (1); +INSERT INTO nt_tmp_xx_1() VALUES (1); +INSERT INTO nt_xx_1 SELECT * FROM tt_tmp_xx_1; +INSERT INTO nt_tmp_xx_1() VALUES (1); +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +-b-b-b-b-b-b-b-b-b-b-b- >> B N N-Temp N-SELECT-T-Temp N-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N N-Temp N-SELECT-T-Temp N-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B N N-Temp T-SELECT-T-Temp N-Temp R'; +BEGIN; +INSERT INTO nt_xx_1() VALUES (1); +INSERT INTO nt_tmp_xx_1() VALUES (1); +INSERT INTO tt_xx_1 SELECT * FROM tt_tmp_xx_1; +INSERT INTO nt_tmp_xx_1() VALUES (1); +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +-b-b-b-b-b-b-b-b-b-b-b- >> B N N-Temp T-SELECT-T-Temp N-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N N-Temp T-SELECT-T-Temp N-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +################################################################################### +# CHECK CONSISTENCY +################################################################################### +######################################################################### +# CLEAN +######################################################################### +SET @commands= 'clean'; +DROP TABLE IF EXISTS tt_xx_1; +DROP TABLE IF EXISTS nt_xx_1; +DROP TABLE IF EXISTS nt_2; +DROP TABLE IF EXISTS nt_1; +DROP TABLE IF EXISTS tt_2; +DROP TABLE IF EXISTS tt_1; +SET @commands= ''; diff --git a/mysql-test/suite/rpl/r/rpl_stm_drop_create_temp_table.result b/mysql-test/suite/rpl/r/rpl_stm_drop_create_temp_table.result new file mode 100644 index 00000000000..c752e836ebb --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_stm_drop_create_temp_table.result @@ -0,0 +1,1513 @@ +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; +######################################################################### +# CONFIGURATION +######################################################################### +call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT."); +SET @commands= 'configure'; +CREATE TABLE tt_xx_1 ( id INT ) ENGINE = Innodb; +CREATE TABLE nt_xx_1 ( id INT ) ENGINE = MyIsam; +CREATE TEMPORARY TABLE nt_tmp_xx_1 ( id INT ) ENGINE = MyIsam; +CREATE TEMPORARY TABLE tt_tmp_xx_1 ( id INT ) ENGINE = Innodb; +DROP TEMPORARY TABLE IF EXISTS nt_tmp_2; +Warnings: +Note 1051 Unknown table 'nt_tmp_2' +CREATE TEMPORARY TABLE nt_tmp_2 ( id INT ) ENGINE = MyIsam; +DROP TEMPORARY TABLE IF EXISTS nt_tmp_1; +Warnings: +Note 1051 Unknown table 'nt_tmp_1' +CREATE TEMPORARY TABLE nt_tmp_1 ( id INT ) ENGINE = MyIsam; +DROP TEMPORARY TABLE IF EXISTS tt_tmp_2; +Warnings: +Note 1051 Unknown table 'tt_tmp_2' +CREATE TEMPORARY TABLE tt_tmp_2 ( id INT ) ENGINE = Innodb; +DROP TEMPORARY TABLE IF EXISTS tt_tmp_1; +Warnings: +Note 1051 Unknown table 'tt_tmp_1' +CREATE TEMPORARY TABLE tt_tmp_1 ( id INT ) ENGINE = Innodb; +DROP TABLE IF EXISTS nt_2; +Warnings: +Note 1051 Unknown table 'nt_2' +CREATE TABLE nt_2 ( id INT ) ENGINE = MyIsam; +DROP TABLE IF EXISTS nt_1; +Warnings: +Note 1051 Unknown table 'nt_1' +CREATE TABLE nt_1 ( id INT ) ENGINE = MyIsam; +DROP TABLE IF EXISTS tt_2; +Warnings: +Note 1051 Unknown table 'tt_2' +CREATE TABLE tt_2 ( id INT ) ENGINE = Innodb; +DROP TABLE IF EXISTS tt_1; +Warnings: +Note 1051 Unknown table 'tt_1' +CREATE TABLE tt_1 ( id INT ) ENGINE = Innodb; +SET @commands= ''; +######################################################################### +# 1 - Tables dropped by "DROP TEMPORARY TABLE" +######################################################################### + +# +#1) Generates in the binlog what follows: +# +SET @commands= 'Drop-Temp-T-Temp'; +DROP TEMPORARY TABLE tt_tmp_2; +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_2 +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-Temp-N-Temp'; +DROP TEMPORARY TABLE nt_tmp_2; +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-N-Temp << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_2 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-N-Temp << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-Temp-Xe-Temp'; +DROP TEMPORARY TABLE tt_xx_1; +ERROR 42S02: Unknown table 'tt_xx_1' +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-Xe-Temp << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-Xe-Temp << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-Temp-If-Xe-Temp'; +DROP TEMPORARY TABLE IF EXISTS tt_xx_1; +Warnings: +Note 1051 Unknown table 'tt_xx_1' +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-If-Xe-Temp << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS tt_xx_1 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-If-Xe-Temp << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-Temp-TXe-Temp'; +DROP TEMPORARY TABLE tt_tmp_2, tt_1; +ERROR 42S02: Unknown table 'tt_1' +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-TXe-Temp << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_2, tt_1 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-TXe-Temp << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-Temp-If-TXe-Temp'; +DROP TEMPORARY TABLE IF EXISTS tt_tmp_2, tt_1; +Warnings: +Note 1051 Unknown table 'tt_1' +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-If-TXe-Temp << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS tt_tmp_2, tt_1 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-If-TXe-Temp << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-Temp-NXe-Temp'; +DROP TEMPORARY TABLE nt_tmp_2, tt_1; +ERROR 42S02: Unknown table 'tt_1' +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-NXe-Temp << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_2, tt_1 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-NXe-Temp << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-Temp-If-NXe-Temp'; +DROP TEMPORARY TABLE IF EXISTS nt_tmp_2, tt_1; +Warnings: +Note 1051 Unknown table 'tt_1' +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-If-NXe-Temp << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS nt_tmp_2, tt_1 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-If-NXe-Temp << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-Temp-TN-Temp'; +DROP TEMPORARY TABLE tt_tmp_2, nt_tmp_2; +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-TN-Temp << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_2, nt_tmp_2 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-TN-Temp << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-Temp-TT-Temp'; +DROP TEMPORARY TABLE tt_tmp_1, tt_tmp_2; +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-TT-Temp << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_1, tt_tmp_2 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-TT-Temp << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-Temp-NN-Temp'; +DROP TEMPORARY TABLE nt_tmp_1, nt_tmp_2; +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-NN-Temp << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_1, nt_tmp_2 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-NN-Temp << -e-e-e-e-e-e-e-e-e-e-e- + + +# +#2) Generates in the binlog what follows: +# +SET @commands= 'B T Drop-Temp-T-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_2; +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-T-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_2 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-T-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-T-Temp N Drop-Temp-T-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_2; +INSERT INTO nt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_1; +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-T-Temp N Drop-Temp-T-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_2 +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-T-Temp N Drop-Temp-T-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-N-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_2; +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-N-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_2 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-N-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-N-Temp N Drop-Temp-N-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_2; +INSERT INTO nt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_1; +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-N-Temp N Drop-Temp-N-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_2 +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-N-Temp N Drop-Temp-N-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-Xe-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_xx_1; +ERROR 42S02: Unknown table 'tt_xx_1' +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-Xe-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-Xe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-Xe-Temp N Drop-Temp-Xe-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_xx_1; +ERROR 42S02: Unknown table 'tt_xx_1' +INSERT INTO nt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_xx_1; +ERROR 42S02: Unknown table 'tt_xx_1' +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-Xe-Temp N Drop-Temp-Xe-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-Xe-Temp N Drop-Temp-Xe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-If-Xe-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE IF EXISTS tt_xx_1; +Warnings: +Note 1051 Unknown table 'tt_xx_1' +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-If-Xe-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS tt_xx_1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-Xe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-If-Xe-Temp N Drop-Temp-If-Xe-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE IF EXISTS tt_xx_1; +Warnings: +Note 1051 Unknown table 'tt_xx_1' +INSERT INTO nt_xx_1() VALUES (1); +DROP TEMPORARY TABLE IF EXISTS tt_xx_1; +Warnings: +Note 1051 Unknown table 'tt_xx_1' +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-If-Xe-Temp N Drop-Temp-If-Xe-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS tt_xx_1 +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS tt_xx_1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-Xe-Temp N Drop-Temp-If-Xe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-TXe-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_2, tt_1; +ERROR 42S02: Unknown table 'tt_1' +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TXe-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_2, tt_1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-TXe-Temp N Drop-Temp-TXe-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_2, tt_1; +ERROR 42S02: Unknown table 'tt_1' +INSERT INTO nt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_1, tt_1; +ERROR 42S02: Unknown table 'tt_1' +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TXe-Temp N Drop-Temp-TXe-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_2, tt_1 +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_1, tt_1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TXe-Temp N Drop-Temp-TXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-If-TXe-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE IF EXISTS tt_tmp_2, tt_1; +Warnings: +Note 1051 Unknown table 'tt_1' +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-If-TXe-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS tt_tmp_2, tt_1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-TXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-If-TXe-Temp N Drop-Temp-If-TXe-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE IF EXISTS tt_tmp_2, tt_1; +Warnings: +Note 1051 Unknown table 'tt_1' +INSERT INTO nt_xx_1() VALUES (1); +DROP TEMPORARY TABLE IF EXISTS tt_tmp_1, tt_1; +Warnings: +Note 1051 Unknown table 'tt_1' +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-If-TXe-Temp N Drop-Temp-If-TXe-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS tt_tmp_2, tt_1 +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS tt_tmp_1, tt_1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-TXe-Temp N Drop-Temp-If-TXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-NXe-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_2, tt_1; +ERROR 42S02: Unknown table 'tt_1' +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-NXe-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_2, tt_1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-NXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-NXe-Temp N Drop-Temp-NXe-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_2, tt_1; +ERROR 42S02: Unknown table 'tt_1' +INSERT INTO nt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_1, tt_1; +ERROR 42S02: Unknown table 'tt_1' +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-NXe-Temp N Drop-Temp-NXe-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_2, tt_1 +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_1, tt_1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-NXe-Temp N Drop-Temp-NXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-If-NXe-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE IF EXISTS nt_tmp_2, tt_1; +Warnings: +Note 1051 Unknown table 'tt_1' +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-If-NXe-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS nt_tmp_2, tt_1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-NXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-If-NXe-Temp N Drop-Temp-If-NXe-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE IF EXISTS nt_tmp_2, tt_1; +Warnings: +Note 1051 Unknown table 'tt_1' +INSERT INTO nt_xx_1() VALUES (1); +DROP TEMPORARY TABLE IF EXISTS nt_tmp_1, tt_1; +Warnings: +Note 1051 Unknown table 'tt_1' +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-If-NXe-Temp N Drop-Temp-If-NXe-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS nt_tmp_2, tt_1 +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS nt_tmp_1, tt_1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-NXe-Temp N Drop-Temp-If-NXe-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-TN-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_2, nt_tmp_2; +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TN-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_2, nt_tmp_2 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TN-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-TN-Temp N Drop-Temp-TN-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_2, nt_tmp_2; +INSERT INTO nt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_1, nt_tmp_2; +ERROR 42S02: Unknown table 'nt_tmp_2' +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TN-Temp N Drop-Temp-TN-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_2, nt_tmp_2 +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_1, nt_tmp_2 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TN-Temp N Drop-Temp-TN-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-TT-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_1, tt_tmp_2; +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TT-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_1, tt_tmp_2 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TT-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-TT-Temp N Drop-Temp-TT-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_1, tt_tmp_2; +INSERT INTO nt_xx_1() VALUES (1); +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TT-Temp N Drop-Temp-TT-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_1, tt_tmp_2 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TT-Temp N Drop-Temp-TT-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-NN-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_1, nt_tmp_2; +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-NN-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_1, nt_tmp_2 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-NN-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-NN-Temp N Drop-Temp-NN-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_1, nt_tmp_2; +INSERT INTO nt_xx_1() VALUES (1); +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-NN-Temp N Drop-Temp-NN-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_1, nt_tmp_2 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-NN-Temp N Drop-Temp-NN-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + + +# +#3) Generates in the binlog what follows: +# +SET @commands= 'B T Drop-Temp-T-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_2; +ROLLBACK; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-T-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_2 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-T-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-T-Temp N Drop-Temp-T-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_2; +INSERT INTO nt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_1; +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-T-Temp N Drop-Temp-T-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_2 +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_1 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-T-Temp N Drop-Temp-T-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-N-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_2; +ROLLBACK; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-N-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_2 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-N-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-N-Temp N Drop-Temp-N-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_2; +INSERT INTO nt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_1; +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-N-Temp N Drop-Temp-N-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_2 +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_1 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-N-Temp N Drop-Temp-N-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-Xe-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_xx_1; +ERROR 42S02: Unknown table 'tt_xx_1' +ROLLBACK; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-Xe-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-Xe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-Xe-Temp N Drop-Temp-Xe-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_xx_1; +ERROR 42S02: Unknown table 'tt_xx_1' +INSERT INTO nt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_xx_1; +ERROR 42S02: Unknown table 'tt_xx_1' +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-Xe-Temp N Drop-Temp-Xe-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-Xe-Temp N Drop-Temp-Xe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-If-Xe-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE IF EXISTS tt_xx_1; +Warnings: +Note 1051 Unknown table 'tt_xx_1' +ROLLBACK; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-If-Xe-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS tt_xx_1 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-Xe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-If-Xe-Temp N Drop-Temp-If-Xe-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE IF EXISTS tt_xx_1; +Warnings: +Note 1051 Unknown table 'tt_xx_1' +INSERT INTO nt_xx_1() VALUES (1); +DROP TEMPORARY TABLE IF EXISTS tt_xx_1; +Warnings: +Note 1051 Unknown table 'tt_xx_1' +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-If-Xe-Temp N Drop-Temp-If-Xe-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS tt_xx_1 +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS tt_xx_1 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-Xe-Temp N Drop-Temp-If-Xe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-TXe-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_2, tt_1; +ERROR 42S02: Unknown table 'tt_1' +ROLLBACK; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TXe-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_2, tt_1 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-TXe-Temp N Drop-Temp-TXe-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_2, tt_1; +ERROR 42S02: Unknown table 'tt_1' +INSERT INTO nt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_1, tt_1; +ERROR 42S02: Unknown table 'tt_1' +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TXe-Temp N Drop-Temp-TXe-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_2, tt_1 +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_1, tt_1 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TXe-Temp N Drop-Temp-TXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-If-TXe-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE IF EXISTS tt_tmp_2, tt_1; +Warnings: +Note 1051 Unknown table 'tt_1' +ROLLBACK; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-If-TXe-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS tt_tmp_2, tt_1 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-TXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-If-TXe-Temp N Drop-Temp-If-TXe-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE IF EXISTS tt_tmp_2, tt_1; +Warnings: +Note 1051 Unknown table 'tt_1' +INSERT INTO nt_xx_1() VALUES (1); +DROP TEMPORARY TABLE IF EXISTS tt_tmp_1, tt_1; +Warnings: +Note 1051 Unknown table 'tt_1' +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-If-TXe-Temp N Drop-Temp-If-TXe-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS tt_tmp_2, tt_1 +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS tt_tmp_1, tt_1 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-TXe-Temp N Drop-Temp-If-TXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-NXe-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_2, tt_1; +ERROR 42S02: Unknown table 'tt_1' +ROLLBACK; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-NXe-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_2, tt_1 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-NXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-NXe-Temp N Drop-Temp-NXe-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_2, tt_1; +ERROR 42S02: Unknown table 'tt_1' +INSERT INTO nt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_1, tt_1; +ERROR 42S02: Unknown table 'tt_1' +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-NXe-Temp N Drop-Temp-NXe-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_2, tt_1 +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_1, tt_1 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-NXe-Temp N Drop-Temp-NXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-If-NXe-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE IF EXISTS nt_tmp_2, tt_1; +Warnings: +Note 1051 Unknown table 'tt_1' +ROLLBACK; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-If-NXe-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS nt_tmp_2, tt_1 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-NXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-If-NXe-Temp N Drop-Temp-If-NXe-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE IF EXISTS nt_tmp_2, tt_1; +Warnings: +Note 1051 Unknown table 'tt_1' +INSERT INTO nt_xx_1() VALUES (1); +DROP TEMPORARY TABLE IF EXISTS nt_tmp_1, tt_1; +Warnings: +Note 1051 Unknown table 'tt_1' +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-If-NXe-Temp N Drop-Temp-If-NXe-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS nt_tmp_2, tt_1 +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS nt_tmp_1, tt_1 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-If-NXe-Temp N Drop-Temp-If-NXe-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-TN-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_2, nt_tmp_2; +ROLLBACK; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TN-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_2, nt_tmp_2 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TN-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-TN-Temp N Drop-Temp-TN-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_2, nt_tmp_2; +INSERT INTO nt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_1, nt_tmp_2; +ERROR 42S02: Unknown table 'nt_tmp_2' +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TN-Temp N Drop-Temp-TN-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_2, nt_tmp_2 +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_1, nt_tmp_2 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TN-Temp N Drop-Temp-TN-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-TT-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_1, tt_tmp_2; +ROLLBACK; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TT-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_1, tt_tmp_2 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TT-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-TT-Temp N Drop-Temp-TT-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE tt_tmp_1, tt_tmp_2; +INSERT INTO nt_xx_1() VALUES (1); +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-TT-Temp N Drop-Temp-TT-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_1, tt_tmp_2 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-TT-Temp N Drop-Temp-TT-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-NN-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_1, nt_tmp_2; +ROLLBACK; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-NN-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_1, nt_tmp_2 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-NN-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Temp-NN-Temp N Drop-Temp-NN-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_1, nt_tmp_2; +INSERT INTO nt_xx_1() VALUES (1); +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-NN-Temp N Drop-Temp-NN-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_1, nt_tmp_2 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-NN-Temp N Drop-Temp-NN-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +######################################################################### +# 2 - Tables dropped by "DROP TABLE" +######################################################################### + +# +#1) Generates in the binlog what follows: +# +SET @commands= 'Drop-T'; +DROP TABLE tt_2; +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-T << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE tt_2 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-T << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-N'; +DROP TABLE nt_2; +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-N << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE nt_2 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-N << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-Xe'; +DROP TABLE xx_1; +ERROR 42S02: Unknown table 'xx_1' +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Xe << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Xe << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-If-Xe'; +DROP TABLE IF EXISTS xx_1; +Warnings: +Note 1051 Unknown table 'xx_1' +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-If-Xe << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS xx_1 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-If-Xe << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-TXe'; +DROP TABLE tt_2, xx_1; +ERROR 42S02: Unknown table 'xx_1' +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-TXe << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE tt_2, xx_1 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-TXe << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-If-TXe'; +DROP TABLE IF EXISTS tt_2, xx_1; +Warnings: +Note 1051 Unknown table 'xx_1' +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-If-TXe << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_2, xx_1 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-If-TXe << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-NXe'; +DROP TABLE nt_2, xx_1; +ERROR 42S02: Unknown table 'xx_1' +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-NXe << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE nt_2, xx_1 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-NXe << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-If-NXe'; +DROP TABLE IF EXISTS nt_2, xx_1; +Warnings: +Note 1051 Unknown table 'xx_1' +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-If-NXe << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS nt_2, xx_1 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-If-NXe << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-TN'; +DROP TABLE tt_2, nt_2; +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-TN << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE tt_2, nt_2 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-TN << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-TT'; +DROP TABLE tt_1, tt_2; +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-TT << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE tt_1, tt_2 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-TT << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-NN'; +DROP TABLE nt_1, nt_2; +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-NN << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE nt_1, nt_2 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-NN << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-N-TN-Temp'; +DROP TABLE tt_tmp_2, nt_tmp_2, nt_2; +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-N-TN-Temp << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE tt_tmp_2, nt_tmp_2, nt_2 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-N-TN-Temp << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-TN-Temp'; +DROP TABLE tt_tmp_2, nt_tmp_2; +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-TN-Temp << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE tt_tmp_2, nt_tmp_2 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-TN-Temp << -e-e-e-e-e-e-e-e-e-e-e- + + +# +#2) Generates in the binlog what follows: +# +SET @commands= 'B T Drop-T'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TABLE tt_2; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-T << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP TABLE tt_2 +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-T << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-N'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TABLE nt_2; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-N << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP TABLE nt_2 +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-N << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-Xe'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TABLE xx_1; +ERROR 42S02: Unknown table 'xx_1' +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Xe << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Xe << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-If-Xe'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TABLE IF EXISTS xx_1; +Warnings: +Note 1051 Unknown table 'xx_1' +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-If-Xe << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS xx_1 +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-If-Xe << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-TXe'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TABLE tt_2, xx_1; +ERROR 42S02: Unknown table 'xx_1' +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-TXe << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP TABLE tt_2, xx_1 +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-TXe << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-If-TXe'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TABLE IF EXISTS tt_2, xx_1; +Warnings: +Note 1051 Unknown table 'xx_1' +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-If-TXe << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_2, xx_1 +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-If-TXe << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-NXe'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TABLE nt_2, xx_1; +ERROR 42S02: Unknown table 'xx_1' +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-NXe << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP TABLE nt_2, xx_1 +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-NXe << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-If-NXe'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TABLE IF EXISTS nt_2, xx_1; +Warnings: +Note 1051 Unknown table 'xx_1' +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-If-NXe << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS nt_2, xx_1 +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-If-NXe << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-TN'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TABLE tt_2, nt_2; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-TN << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP TABLE tt_2, nt_2 +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-TN << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-TT'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TABLE tt_1, tt_2; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-TT << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP TABLE tt_1, tt_2 +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-TT << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-NN'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TABLE nt_1, nt_2; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-NN << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP TABLE nt_1, nt_2 +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-NN << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-N-TN-Temp'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TABLE tt_tmp_2, nt_tmp_2, nt_2; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-N-TN-Temp << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP TABLE tt_tmp_2, nt_tmp_2, nt_2 +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-N-TN-Temp << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B T Drop-TN-Temp'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TABLE tt_tmp_2, nt_tmp_2; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-TN-Temp << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP TABLE tt_tmp_2, nt_tmp_2 +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-TN-Temp << -e-e-e-e-e-e-e-e-e-e-e- + +######################################################################### +# 3 - CREATE TEMPORARY TABLE +######################################################################### + +# +#1) Generates in the binlog what follows: +# +SET @commands= 'Drop-Temp-N-Temp Create-N-Temp Drop-Temp-N-Temp Drop-Temp-N-Temp'; +DROP TEMPORARY TABLE nt_tmp_2; +CREATE TEMPORARY TABLE nt_tmp_2 ( id INT ) engine= MyIsam; +DROP TEMPORARY TABLE nt_tmp_1; +DROP TEMPORARY TABLE nt_tmp_2; +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-N-Temp Create-N-Temp Drop-Temp-N-Temp Drop-Temp-N-Temp << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_2 +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE nt_tmp_2 ( id INT ) engine= MyIsam +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_1 +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_2 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-N-Temp Create-N-Temp Drop-Temp-N-Temp Drop-Temp-N-Temp << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp'; +DROP TEMPORARY TABLE tt_tmp_2; +CREATE TEMPORARY TABLE tt_tmp_2 ( id INT ) engine= Innodb; +DROP TEMPORARY TABLE tt_tmp_1; +DROP TEMPORARY TABLE tt_tmp_2; +-b-b-b-b-b-b-b-b-b-b-b- >> Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_2 +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_tmp_2 ( id INT ) engine= Innodb +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_1 +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_2 +-e-e-e-e-e-e-e-e-e-e-e- >> Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp << -e-e-e-e-e-e-e-e-e-e-e- + + +# +#2) Generates in the binlog what follows: +# +SET @commands= 'B T Drop-Temp-N-Temp Create-N-Temp Drop-Temp-N-Temp Drop-Temp-N-Temp C'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_2; +CREATE TEMPORARY TABLE nt_tmp_2 ( id INT ) engine= MyIsam; +DROP TEMPORARY TABLE nt_tmp_1; +DROP TEMPORARY TABLE nt_tmp_2; +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-N-Temp Create-N-Temp Drop-Temp-N-Temp Drop-Temp-N-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_2 +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE nt_tmp_2 ( id INT ) engine= MyIsam +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_1 +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_2 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-N-Temp Create-N-Temp Drop-Temp-N-Temp Drop-Temp-N-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp C'; +BEGIN; +DROP TEMPORARY TABLE tt_tmp_2; +CREATE TEMPORARY TABLE tt_tmp_2 ( id INT ) engine= Innodb; +DROP TEMPORARY TABLE tt_tmp_1; +DROP TEMPORARY TABLE tt_tmp_2; +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_2 +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_tmp_2 ( id INT ) engine= Innodb +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_1 +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_2 +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + + +# +#3) Generates in the binlog what follows: +# +SET @commands= 'B T Drop-Temp-N-Temp Create-N-Temp Drop-Temp-N-Temp Drop-Temp-N-Temp R'; +BEGIN; +INSERT INTO tt_xx_1() VALUES (1); +DROP TEMPORARY TABLE nt_tmp_2; +CREATE TEMPORARY TABLE nt_tmp_2 ( id INT ) engine= MyIsam; +DROP TEMPORARY TABLE nt_tmp_1; +DROP TEMPORARY TABLE nt_tmp_2; +ROLLBACK; +-b-b-b-b-b-b-b-b-b-b-b- >> B T Drop-Temp-N-Temp Create-N-Temp Drop-Temp-N-Temp Drop-Temp-N-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1() VALUES (1) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_2 +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE nt_tmp_2 ( id INT ) engine= MyIsam +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_1 +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE nt_tmp_2 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Drop-Temp-N-Temp Create-N-Temp Drop-Temp-N-Temp Drop-Temp-N-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp R'; +BEGIN; +DROP TEMPORARY TABLE tt_tmp_2; +CREATE TEMPORARY TABLE tt_tmp_2 ( id INT ) engine= Innodb; +DROP TEMPORARY TABLE tt_tmp_1; +DROP TEMPORARY TABLE tt_tmp_2; +ROLLBACK; +-b-b-b-b-b-b-b-b-b-b-b- >> B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_2 +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_tmp_2 ( id INT ) engine= Innodb +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_1 +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tt_tmp_2 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B Drop-Temp-T-Temp Create-T-Temp Drop-Temp-T-Temp Drop-Temp-T-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +######################################################################### +# 4 - CHANGING TEMPORARY TABLES +######################################################################### + +# +#1) Generates in the binlog what follows: +# +SET @commands= 'B N N-Temp N-SELECT-N-Temp N-Temp C'; +BEGIN; +INSERT INTO nt_xx_1() VALUES (1); +INSERT INTO nt_tmp_xx_1() VALUES (1); +INSERT INTO nt_xx_1 SELECT * FROM nt_tmp_xx_1; +INSERT INTO nt_tmp_xx_1() VALUES (1); +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B N N-Temp N-SELECT-N-Temp N-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_tmp_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1 SELECT * FROM nt_tmp_xx_1 +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_tmp_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N N-Temp N-SELECT-N-Temp N-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B N N-Temp T-SELECT-N-Temp N-Temp C'; +BEGIN; +INSERT INTO nt_xx_1() VALUES (1); +INSERT INTO nt_tmp_xx_1() VALUES (1); +INSERT INTO tt_xx_1 SELECT * FROM nt_tmp_xx_1; +INSERT INTO nt_tmp_xx_1() VALUES (1); +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B N N-Temp T-SELECT-N-Temp N-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_tmp_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1 SELECT * FROM nt_tmp_xx_1 +master-bin.000001 # Query # # use `test`; INSERT INTO nt_tmp_xx_1() VALUES (1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N N-Temp T-SELECT-N-Temp N-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B N N-Temp N-SELECT-T-Temp N-Temp C'; +BEGIN; +INSERT INTO nt_xx_1() VALUES (1); +INSERT INTO nt_tmp_xx_1() VALUES (1); +INSERT INTO nt_xx_1 SELECT * FROM tt_tmp_xx_1; +INSERT INTO nt_tmp_xx_1() VALUES (1); +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B N N-Temp N-SELECT-T-Temp N-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_tmp_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1 SELECT * FROM tt_tmp_xx_1 +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_tmp_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N N-Temp N-SELECT-T-Temp N-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B N N-Temp T-SELECT-T-Temp N-Temp C'; +BEGIN; +INSERT INTO nt_xx_1() VALUES (1); +INSERT INTO nt_tmp_xx_1() VALUES (1); +INSERT INTO tt_xx_1 SELECT * FROM tt_tmp_xx_1; +INSERT INTO nt_tmp_xx_1() VALUES (1); +COMMIT; +-b-b-b-b-b-b-b-b-b-b-b- >> B N N-Temp T-SELECT-T-Temp N-Temp C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_tmp_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1 SELECT * FROM tt_tmp_xx_1 +master-bin.000001 # Query # # use `test`; INSERT INTO nt_tmp_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N N-Temp T-SELECT-T-Temp N-Temp C << -e-e-e-e-e-e-e-e-e-e-e- + + + +# +#2) Generates in the binlog what follows: +# +SET @commands= 'B N N-Temp N-SELECT-N-Temp N-Temp R'; +BEGIN; +INSERT INTO nt_xx_1() VALUES (1); +INSERT INTO nt_tmp_xx_1() VALUES (1); +INSERT INTO nt_xx_1 SELECT * FROM nt_tmp_xx_1; +INSERT INTO nt_tmp_xx_1() VALUES (1); +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +-b-b-b-b-b-b-b-b-b-b-b- >> B N N-Temp N-SELECT-N-Temp N-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_tmp_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1 SELECT * FROM nt_tmp_xx_1 +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_tmp_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N N-Temp N-SELECT-N-Temp N-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B N N-Temp T-SELECT-N-Temp N-Temp R'; +BEGIN; +INSERT INTO nt_xx_1() VALUES (1); +INSERT INTO nt_tmp_xx_1() VALUES (1); +INSERT INTO tt_xx_1 SELECT * FROM nt_tmp_xx_1; +INSERT INTO nt_tmp_xx_1() VALUES (1); +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +-b-b-b-b-b-b-b-b-b-b-b- >> B N N-Temp T-SELECT-N-Temp N-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_tmp_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1 SELECT * FROM nt_tmp_xx_1 +master-bin.000001 # Query # # use `test`; INSERT INTO nt_tmp_xx_1() VALUES (1) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B N N-Temp T-SELECT-N-Temp N-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B N N-Temp N-SELECT-T-Temp N-Temp R'; +BEGIN; +INSERT INTO nt_xx_1() VALUES (1); +INSERT INTO nt_tmp_xx_1() VALUES (1); +INSERT INTO nt_xx_1 SELECT * FROM tt_tmp_xx_1; +INSERT INTO nt_tmp_xx_1() VALUES (1); +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +-b-b-b-b-b-b-b-b-b-b-b- >> B N N-Temp N-SELECT-T-Temp N-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_tmp_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1 SELECT * FROM tt_tmp_xx_1 +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_tmp_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N N-Temp N-SELECT-T-Temp N-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +SET @commands= 'B N N-Temp T-SELECT-T-Temp N-Temp R'; +BEGIN; +INSERT INTO nt_xx_1() VALUES (1); +INSERT INTO nt_tmp_xx_1() VALUES (1); +INSERT INTO tt_xx_1 SELECT * FROM tt_tmp_xx_1; +INSERT INTO nt_tmp_xx_1() VALUES (1); +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +-b-b-b-b-b-b-b-b-b-b-b- >> B N N-Temp T-SELECT-T-Temp N-Temp R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_tmp_xx_1() VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_1 SELECT * FROM tt_tmp_xx_1 +master-bin.000001 # Query # # use `test`; INSERT INTO nt_tmp_xx_1() VALUES (1) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B N N-Temp T-SELECT-T-Temp N-Temp R << -e-e-e-e-e-e-e-e-e-e-e- + +################################################################################### +# CHECK CONSISTENCY +################################################################################### +######################################################################### +# CLEAN +######################################################################### +SET @commands= 'clean'; +DROP TABLE IF EXISTS tt_xx_1; +DROP TABLE IF EXISTS nt_xx_1; +DROP TABLE IF EXISTS nt_2; +DROP TABLE IF EXISTS nt_1; +DROP TABLE IF EXISTS tt_2; +DROP TABLE IF EXISTS tt_1; +SET @commands= ''; diff --git a/mysql-test/suite/rpl/r/rpl_temp_temporary.result b/mysql-test/suite/rpl/r/rpl_temp_temporary.result deleted file mode 100644 index 9c667963f77..00000000000 --- a/mysql-test/suite/rpl/r/rpl_temp_temporary.result +++ /dev/null @@ -1,238 +0,0 @@ -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; -CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); -######################################################################## -# VERIFY ITEMS 1 and 2 -######################################################################## -# -# Create temporary tables to verify when statements involving temporary -# tables are classified as safe or unsafe by printing out the warning -# messages. -# -CREATE TABLE t_myisam(id int) engine= MyIsam; -INSERT INTO t_myisam VALUES(1); -CREATE TABLE t_innodb(id int) engine= Innodb; -INSERT INTO t_innodb VALUES(1); -CREATE TEMPORARY TABLE t_myisam_temp(id int) engine= MyIsam; -INSERT INTO t_myisam_temp VALUES(1); -CREATE TEMPORARY TABLE t_innodb_temp(id int) engine= Innodb; -INSERT INTO t_innodb_temp VALUES(1); -BEGIN; -INSERT INTO t_myisam SELECT * FROM t_myisam_temp; -INSERT INTO t_innodb SELECT * FROM t_myisam_temp; -INSERT INTO t_innodb SELECT * FROM t_innodb_temp; -ROLLBACK; -Warnings: -Warning 1196 Some non-transactional changed tables couldn't be rolled back -BEGIN; -INSERT INTO t_myisam SELECT * FROM t_innodb_temp; -INSERT INTO t_innodb SELECT * FROM t_myisam_temp; -INSERT INTO t_innodb SELECT * FROM t_innodb_temp; -ROLLBACK; -Warnings: -Warning 1196 Some non-transactional changed tables couldn't be rolled back -######################################################################## -# VERIFY ITEM 3 -######################################################################## -# -# When there is a temporary table we can switch between the mixed and -# row formats. However, we cannot switch to the statement format. -# -SET BINLOG_FORMAT=MIXED; -SET BINLOG_FORMAT=ROW; -SET BINLOG_FORMAT=MIXED; -SET BINLOG_FORMAT=STATEMENT; -ERROR HY000: Cannot switch out of the row-based binary log format when the session has open temporary tables -# -# When there is a temporary table we can switch between the mixed and -# row formats. However, we cannot swith to the statement format. -# -SET BINLOG_FORMAT=MIXED; -DROP TABLE t_myisam_temp, t_innodb_temp, t_myisam, t_innodb; -show binlog events from ; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO t_myisam SELECT * FROM t_myisam_temp -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO t_innodb SELECT * FROM t_myisam_temp -master-bin.000001 # Query # # use `test`; INSERT INTO t_innodb SELECT * FROM t_innodb_temp -master-bin.000001 # Query # # ROLLBACK -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO t_myisam SELECT * FROM t_innodb_temp -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO t_innodb SELECT * FROM t_myisam_temp -master-bin.000001 # Query # # use `test`; INSERT INTO t_innodb SELECT * FROM t_innodb_temp -master-bin.000001 # Query # # ROLLBACK -master-bin.000001 # Query # # use `test`; DROP TABLE `t_myisam`,`t_innodb` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `t_myisam_temp`,`t_innodb_temp` /* generated by server */ -######################################################################## -# VERIFY ITEMS 4 and 5 -######################################################################## -# -BEGIN; -CREATE TEMPORARY TABLE tmp1(id int) engine= MyIsam; -INSERT INTO tmp1 VALUES(1); -CREATE TEMPORARY TABLE tmp2 LIKE tmp1; -INSERT INTO tmp2 VALUES(1); -CREATE TEMPORARY TABLE tmp3 engine= MyIsam SELECT * FROM tmp1; -INSERT INTO tmp3 VALUES(1); -DROP TEMPORARY TABLE tmp1; -DROP TEMPORARY TABLE tmp2; -DROP TEMPORARY TABLE tmp3; -COMMIT; -show binlog events from ; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tmp1(id int) engine= MyIsam -master-bin.000001 # Query # # use `test`; INSERT INTO tmp1 VALUES(1) -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tmp2 LIKE tmp1 -master-bin.000001 # Query # # use `test`; INSERT INTO tmp2 VALUES(1) -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tmp3 engine= MyIsam SELECT * FROM tmp1 -master-bin.000001 # Query # # use `test`; INSERT INTO tmp3 VALUES(1) -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tmp1 -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tmp2 -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tmp3 -master-bin.000001 # Query # # COMMIT -BEGIN; -CREATE TEMPORARY TABLE tmp1(id int) engine= MyIsam; -INSERT INTO tmp1 VALUES(1); -CREATE TEMPORARY TABLE tmp2 LIKE tmp1; -INSERT INTO tmp2 VALUES(1); -CREATE TEMPORARY TABLE tmp3 engine= MyIsam SELECT * FROM tmp1; -INSERT INTO tmp3 VALUES(1); -DROP TEMPORARY TABLE tmp1; -DROP TEMPORARY TABLE tmp2; -DROP TEMPORARY TABLE tmp3; -ROLLBACK; -Warnings: -Warning 1196 Some non-transactional changed tables couldn't be rolled back -show binlog events from ; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tmp1(id int) engine= MyIsam -master-bin.000001 # Query # # use `test`; INSERT INTO tmp1 VALUES(1) -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tmp2 LIKE tmp1 -master-bin.000001 # Query # # use `test`; INSERT INTO tmp2 VALUES(1) -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tmp3 engine= MyIsam SELECT * FROM tmp1 -master-bin.000001 # Query # # use `test`; INSERT INTO tmp3 VALUES(1) -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tmp1 -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tmp2 -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE tmp3 -master-bin.000001 # Query # # ROLLBACK -######################################################################## -# VERIFY ITEM 6 -######################################################################## -SET BINLOG_FORMAT=STATEMENT; -CREATE TEMPORARY TABLE tmp1(id int) engine= MyIsam; -CREATE TEMPORARY TABLE tmp2 LIKE tmp1; -CREATE TEMPORARY TABLE tmp3 engine= MyIsam SELECT * FROM tmp1; -SET BINLOG_FORMAT=ROW; -DROP TEMPORARY TABLE tmp1; -BEGIN; -INSERT INTO tmp2 VALUES(1); -DROP TEMPORARY TABLE tmp2; -INSERT INTO tmp3 VALUES(1); -DROP TEMPORARY TABLE tmp3; -COMMIT; -show binlog events from ; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tmp1(id int) engine= MyIsam -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tmp2 LIKE tmp1 -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tmp3 engine= MyIsam SELECT * FROM tmp1 -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tmp1` /* generated by server */ -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tmp2` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tmp3` /* generated by server */ -master-bin.000001 # Query # # COMMIT -SET BINLOG_FORMAT=STATEMENT; -CREATE TEMPORARY TABLE tmp1(id int) engine= MyIsam; -CREATE TEMPORARY TABLE tmp2 LIKE tmp1; -CREATE TEMPORARY TABLE tmp3 engine= MyIsam SELECT * FROM tmp1; -SET BINLOG_FORMAT=ROW; -DROP TEMPORARY TABLE tmp1; -BEGIN; -INSERT INTO tmp2 VALUES(1); -DROP TEMPORARY TABLE tmp2; -INSERT INTO tmp3 VALUES(1); -DROP TEMPORARY TABLE tmp3; -ROLLBACK; -Warnings: -Warning 1196 Some non-transactional changed tables couldn't be rolled back -show binlog events from ; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tmp1(id int) engine= MyIsam -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tmp2 LIKE tmp1 -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tmp3 engine= MyIsam SELECT * FROM tmp1 -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tmp1` /* generated by server */ -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tmp2` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tmp3` /* generated by server */ -master-bin.000001 # Query # # ROLLBACK -######################################################################## -# VERIFY ITEM 7 -######################################################################## -SET BINLOG_FORMAT=STATEMENT; -CREATE TEMPORARY TABLE tmp1(id int) engine= MyIsam; -CREATE TABLE t_myisam (f1 BIGINT) ENGINE = MyISAM; -CREATE TABLE t_innodb (f1 BIGINT) ENGINE = Innodb; -BEGIN; -INSERT INTO t_myisam VALUES(CONNECTION_ID()); -INSERT INTO tmp1 VALUES(1); -INSERT INTO t_myisam VALUES(1); -INSERT INTO t_innodb VALUES(1); -INSERT INTO t_myisam VALUES(CONNECTION_ID()); -INSERT INTO t_innodb VALUES(1); -COMMIT; -show binlog events from ; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tmp1(id int) engine= MyIsam -master-bin.000001 # Query # # use `test`; CREATE TABLE t_myisam (f1 BIGINT) ENGINE = MyISAM -master-bin.000001 # Query # # use `test`; CREATE TABLE t_innodb (f1 BIGINT) ENGINE = Innodb -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO t_myisam VALUES(CONNECTION_ID()) -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tmp1 VALUES(1) -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO t_myisam VALUES(1) -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO t_myisam VALUES(CONNECTION_ID()) -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO t_innodb VALUES(1) -master-bin.000001 # Query # # use `test`; INSERT INTO t_innodb VALUES(1) -master-bin.000001 # Xid # # COMMIT /* XID */ -######################################################################## -# VERIFY ITEM 8 -######################################################################## -SET BINLOG_FORMAT=MIXED; -BEGIN; -CREATE TEMPORARY TABLE tmp2 SELECT * FROM t_innodb; -INSERT INTO t_innodb VALUES(1); -INSERT INTO t_innodb VALUES(1); -ROLLBACK; -Warnings: -Warning 1196 Some non-transactional changed tables couldn't be rolled back -show binlog events from ; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tmp2 SELECT * FROM t_innodb -master-bin.000001 # Query # # use `test`; INSERT INTO t_innodb VALUES(1) -master-bin.000001 # Query # # use `test`; INSERT INTO t_innodb VALUES(1) -master-bin.000001 # Query # # ROLLBACK -################################################################################### -# CHECK CONSISTENCY -################################################################################### -################################################################################### -# CLEAN UP -################################################################################### -DROP TABLE t_myisam; -DROP TABLE t_innodb; diff --git a/mysql-test/suite/rpl/t/rpl_mixed_drop_create_temp_table.test b/mysql-test/suite/rpl/t/rpl_mixed_drop_create_temp_table.test new file mode 100644 index 00000000000..8c635202ad5 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_mixed_drop_create_temp_table.test @@ -0,0 +1,10 @@ +################################################################################### +# This test cases evaluates the mixture of non-transactional and transcational +# tables. Specifically when drop temporary tables and create temporary tables +# are used. +################################################################################### +--source include/have_binlog_format_mixed.inc +--source include/master-slave.inc +--source include/have_innodb.inc + +--source extra/rpl_tests/rpl_drop_create_temp_table.test diff --git a/mysql-test/suite/rpl/t/rpl_row_drop_create_temp_table.test b/mysql-test/suite/rpl/t/rpl_row_drop_create_temp_table.test new file mode 100644 index 00000000000..fc46665ddb1 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_row_drop_create_temp_table.test @@ -0,0 +1,10 @@ +################################################################################### +# This test cases evaluates the mixture of non-transactional and transcational +# tables. Specifically when drop temporary tables and create temporary tables +# are used. +################################################################################### +--source include/have_binlog_format_row.inc +--source include/master-slave.inc +--source include/have_innodb.inc + +--source extra/rpl_tests/rpl_drop_create_temp_table.test diff --git a/mysql-test/suite/rpl/t/rpl_stm_drop_create_temp_table.test b/mysql-test/suite/rpl/t/rpl_stm_drop_create_temp_table.test new file mode 100644 index 00000000000..b46da8a0150 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_stm_drop_create_temp_table.test @@ -0,0 +1,10 @@ +################################################################################### +# This test cases evaluates the mixture of non-transactional and transcational +# tables. Specifically when drop temporary tables and create temporary tables +# are used. +################################################################################### +--source include/have_binlog_format_statement.inc +--source include/master-slave.inc +--source include/have_innodb.inc + +--source extra/rpl_tests/rpl_drop_create_temp_table.test diff --git a/mysql-test/suite/rpl/t/rpl_temp_temporary-master.opt b/mysql-test/suite/rpl/t/rpl_temp_temporary-master.opt deleted file mode 100644 index 96f0ce3f36c..00000000000 --- a/mysql-test/suite/rpl/t/rpl_temp_temporary-master.opt +++ /dev/null @@ -1 +0,0 @@ ---default-storage-engine=MyISAM diff --git a/mysql-test/suite/rpl/t/rpl_temp_temporary.test b/mysql-test/suite/rpl/t/rpl_temp_temporary.test deleted file mode 100644 index 4eb2d16b91e..00000000000 --- a/mysql-test/suite/rpl/t/rpl_temp_temporary.test +++ /dev/null @@ -1,228 +0,0 @@ -################################################################################ -# BUG#51894 Replication failure with SBR on DROP TEMPORARY TABLE inside a -# transaction -# BUG#52616 Temp table prevents switch binlog format from STATEMENT to ROW -# -# This test verifies what follows: -# -# 1 - If the following statements are classified as unsafe: -# 1.1 - INSERT INTO t_myisam SELECT * FROM t_myisam_temp -# 1.2 - INSERT INTO t_myisam_temp SELECT * FROM t_myisam -# -# 2 - If the following statements are classified as safe: -# 1.7 - INSERT INTO t_innodb SELECT * FROM t_myisam_temp -# 1.8 - INSERT INTO t_myisam_temp SELECT * FROM t_innodb -# -# 3 - If we can switch from statement to row format. -# -# 4 - If statements that can manipulate a temporary table and do not cause an -# implicit commit are kept in the boundaries of an on-going transaction. For -# instance: -# 4.1 - CREATE TEMPORARY TABLE -# 4.2 - CREATE TEMPORARY TABLE LIKE -# 4.3 - CREATE TEMPORARY TABLE SELECT * FROM -# 4.4 - INSERT/UPDATE/DELETE (Note that only inserts are verified) -# 4.5 - INSERT INTO t_myisam SELECT * FROM t_myisam_temp -# 4.6 - INSERT INTO t_myisam_temp SELECT * FROM t_myisam -# 4.7 - INSERT INTO t_innodb SELECT * FROM t_myisam_temp -# 4.8 - INSERT INTO t_myisam_temp SELECT * FROM t_innodb -# -# 5 - If transactions that have a DROP TEMPORARY are always written to the -# binary log regardless of the mode and the outcome: commit or rollback. -# -# 6 - In particular, if the current statement logging format is set to row -# the CREATE TEMPORARY is not logged and the DROP TEMPORARY is extended with -# the IF EXISTS clause. -# -# 7 - It verifies if the CONNECTION_ID along with a non-transactional -# table is written outside the transaction boundaries and is not classified -# as unsafe. See BUG#53075. -# -# 8 - It verifies if OPTION_KEEP_LOG is set and thus forcing to write the -# trx-cache to the binary log when an rollback is issued and only trx-tables -# were updated. See BUG#53421. -################################################################################ - -source include/master-slave.inc; -source include/have_binlog_format_statement.inc; -source include/have_innodb.inc; - -CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); - ---echo ######################################################################## ---echo # VERIFY ITEMS 1 and 2 ---echo ######################################################################## - ---echo # ---echo # Create temporary tables to verify when statements involving temporary ---echo # tables are classified as safe or unsafe by printing out the warning ---echo # messages. ---echo # -connection master; -CREATE TABLE t_myisam(id int) engine= MyIsam; -INSERT INTO t_myisam VALUES(1); -CREATE TABLE t_innodb(id int) engine= Innodb; -INSERT INTO t_innodb VALUES(1); -CREATE TEMPORARY TABLE t_myisam_temp(id int) engine= MyIsam; -INSERT INTO t_myisam_temp VALUES(1); -CREATE TEMPORARY TABLE t_innodb_temp(id int) engine= Innodb; -INSERT INTO t_innodb_temp VALUES(1); - -let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1); -BEGIN; -INSERT INTO t_myisam SELECT * FROM t_myisam_temp; -INSERT INTO t_innodb SELECT * FROM t_myisam_temp; -INSERT INTO t_innodb SELECT * FROM t_innodb_temp; -ROLLBACK; - -BEGIN; -INSERT INTO t_myisam SELECT * FROM t_innodb_temp; -INSERT INTO t_innodb SELECT * FROM t_myisam_temp; -INSERT INTO t_innodb SELECT * FROM t_innodb_temp; -ROLLBACK; - ---echo ######################################################################## ---echo # VERIFY ITEM 3 ---echo ######################################################################## - ---echo # ---echo # When there is a temporary table we can switch between the mixed and ---echo # row formats. However, we cannot switch to the statement format. ---echo # -SET BINLOG_FORMAT=MIXED; -SET BINLOG_FORMAT=ROW; -SET BINLOG_FORMAT=MIXED; ---error ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR -SET BINLOG_FORMAT=STATEMENT; - ---echo # ---echo # When there is a temporary table we can switch between the mixed and ---echo # row formats. However, we cannot swith to the statement format. ---echo # -SET BINLOG_FORMAT=MIXED; -DROP TABLE t_myisam_temp, t_innodb_temp, t_myisam, t_innodb; -source include/show_binlog_events.inc; - ---echo ######################################################################## ---echo # VERIFY ITEMS 4 and 5 ---echo ######################################################################## - ---echo # -let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1); -BEGIN; -CREATE TEMPORARY TABLE tmp1(id int) engine= MyIsam; -INSERT INTO tmp1 VALUES(1); -CREATE TEMPORARY TABLE tmp2 LIKE tmp1; -INSERT INTO tmp2 VALUES(1); -CREATE TEMPORARY TABLE tmp3 engine= MyIsam SELECT * FROM tmp1; -INSERT INTO tmp3 VALUES(1); -DROP TEMPORARY TABLE tmp1; -DROP TEMPORARY TABLE tmp2; -DROP TEMPORARY TABLE tmp3; -COMMIT; -source include/show_binlog_events.inc; - -let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1); -BEGIN; -CREATE TEMPORARY TABLE tmp1(id int) engine= MyIsam; -INSERT INTO tmp1 VALUES(1); -CREATE TEMPORARY TABLE tmp2 LIKE tmp1; -INSERT INTO tmp2 VALUES(1); -CREATE TEMPORARY TABLE tmp3 engine= MyIsam SELECT * FROM tmp1; -INSERT INTO tmp3 VALUES(1); -DROP TEMPORARY TABLE tmp1; -DROP TEMPORARY TABLE tmp2; -DROP TEMPORARY TABLE tmp3; -ROLLBACK; -source include/show_binlog_events.inc; - ---echo ######################################################################## ---echo # VERIFY ITEM 6 ---echo ######################################################################## - -SET BINLOG_FORMAT=STATEMENT; -let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1); -CREATE TEMPORARY TABLE tmp1(id int) engine= MyIsam; -CREATE TEMPORARY TABLE tmp2 LIKE tmp1; -CREATE TEMPORARY TABLE tmp3 engine= MyIsam SELECT * FROM tmp1; -SET BINLOG_FORMAT=ROW; -DROP TEMPORARY TABLE tmp1; -BEGIN; -INSERT INTO tmp2 VALUES(1); -DROP TEMPORARY TABLE tmp2; -INSERT INTO tmp3 VALUES(1); -DROP TEMPORARY TABLE tmp3; -COMMIT; -source include/show_binlog_events.inc; - -SET BINLOG_FORMAT=STATEMENT; -let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1); -CREATE TEMPORARY TABLE tmp1(id int) engine= MyIsam; -CREATE TEMPORARY TABLE tmp2 LIKE tmp1; -CREATE TEMPORARY TABLE tmp3 engine= MyIsam SELECT * FROM tmp1; -SET BINLOG_FORMAT=ROW; -DROP TEMPORARY TABLE tmp1; -BEGIN; -INSERT INTO tmp2 VALUES(1); -DROP TEMPORARY TABLE tmp2; -INSERT INTO tmp3 VALUES(1); -DROP TEMPORARY TABLE tmp3; -ROLLBACK; -source include/show_binlog_events.inc; - ---echo ######################################################################## ---echo # VERIFY ITEM 7 ---echo ######################################################################## - -SET BINLOG_FORMAT=STATEMENT; -let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1); - -CREATE TEMPORARY TABLE tmp1(id int) engine= MyIsam; -CREATE TABLE t_myisam (f1 BIGINT) ENGINE = MyISAM; -CREATE TABLE t_innodb (f1 BIGINT) ENGINE = Innodb; - -BEGIN; -INSERT INTO t_myisam VALUES(CONNECTION_ID()); -INSERT INTO tmp1 VALUES(1); -INSERT INTO t_myisam VALUES(1); -INSERT INTO t_innodb VALUES(1); -INSERT INTO t_myisam VALUES(CONNECTION_ID()); -INSERT INTO t_innodb VALUES(1); -COMMIT; -source include/show_binlog_events.inc; - ---echo ######################################################################## ---echo # VERIFY ITEM 8 ---echo ######################################################################## -# -# Before the patch for BUG#53421, nothing were written to the binary log on -# behalf of the transaction presented below: -# -SET BINLOG_FORMAT=MIXED; -let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1); -BEGIN; -CREATE TEMPORARY TABLE tmp2 SELECT * FROM t_innodb; -INSERT INTO t_innodb VALUES(1); -INSERT INTO t_innodb VALUES(1); -ROLLBACK; -source include/show_binlog_events.inc; - ---echo ################################################################################### ---echo # CHECK CONSISTENCY ---echo ################################################################################### -sync_slave_with_master; -connection master; - ---exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/test-nmt-master.sql ---exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/test-nmt-slave.sql ---diff_files $MYSQLTEST_VARDIR/tmp/test-nmt-master.sql $MYSQLTEST_VARDIR/tmp/test-nmt-slave.sql - ---echo ################################################################################### ---echo # CLEAN UP ---echo ################################################################################### -connection master; - -DROP TABLE t_myisam; -DROP TABLE t_innodb; - -sync_slave_with_master; -- cgit v1.2.1 From e5142047589835a8eb9587656f5ff40d8389c487 Mon Sep 17 00:00:00 2001 From: Luis Soares Date: Thu, 1 Jul 2010 17:03:40 +0100 Subject: BUG#54925: Assertion `query_arg && mysql_bin_log.is_open()' on DROP TEMP TABLE Cset: alfranio.correia@sun.com-20100420091043-4i6ouzozb34hvzhb introduced a change that made drop temporary table to be always logged if current statement log format was set to row. This is fine. However, logging operations, for a "DROP TABLE" statement in mysql_rm_table_part2, are not protected by first checking if the mysql_bin_log is open before proceeding to the actual logging. They only check the dont_log_query variable. This was actually uncovered by the aforementioned cset and not introduced by it. We fix this by extending the condition used in the "if" that wraps logging operations in mysql_rm_table_part2. --- sql/sql_table.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/sql_table.cc b/sql/sql_table.cc index b3213638c4d..cd400b47db1 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -2202,7 +2202,7 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, if (some_tables_deleted || tmp_table_deleted || !error) { query_cache_invalidate3(thd, tables, 0); - if (!dont_log_query) + if (!dont_log_query && mysql_bin_log.is_open()) { if (!thd->is_current_stmt_binlog_format_row() || (non_temp_tables_count > 0 && !tmp_table_deleted)) -- cgit v1.2.1 From aee88bc8aaa4906814cd2eab80d079b94cbda12a Mon Sep 17 00:00:00 2001 From: Alexander Nozdrin Date: Fri, 2 Jul 2010 10:23:00 +0400 Subject: Disabling failing NDB-tests due to Bug 54850 and Bug 54851. --- mysql-test/suite/ndb/t/disabled.def | 3 ++- mysql-test/suite/rpl_ndb/t/disabled.def | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/mysql-test/suite/ndb/t/disabled.def b/mysql-test/suite/ndb/t/disabled.def index 4c5c792f4ef..d38f60d6a54 100644 --- a/mysql-test/suite/ndb/t/disabled.def +++ b/mysql-test/suite/ndb/t/disabled.def @@ -10,8 +10,9 @@ # ############################################################################## -ndb_partition_error2 : Bug#40989 ndb_partition_error2 needs maintenance +ndb_binlog_discover : Bug#54851 2010-07-02 alik ndb.ndb_binlog_discover crashes the server ndb_condition_pushdown : Bug#49746 2010-02-08 alik ndb_condition_pushdown fails in mysql-next-mr +ndb_partition_error2 : Bug#40989 ndb_partition_error2 needs maintenance # the below testcase have been reworked to avoid the bug, test contains comment, keep bug open diff --git a/mysql-test/suite/rpl_ndb/t/disabled.def b/mysql-test/suite/rpl_ndb/t/disabled.def index 2f15112515e..6bfb20f2205 100644 --- a/mysql-test/suite/rpl_ndb/t/disabled.def +++ b/mysql-test/suite/rpl_ndb/t/disabled.def @@ -10,5 +10,8 @@ # ############################################################################## +rpl_ndb_stm_innodb : Bug#54850 2010-07-02 alik rpl_ndb.rpl_ndb_stm_innodb and rpl_ndb.rpl_ndb_2other fails +rpl_ndb_2other : Bug#54850 2010-07-02 alik rpl_ndb.rpl_ndb_stm_innodb and rpl_ndb.rpl_ndb_2other fails + # the below testcase have been reworked to avoid the bug, test contains comment, keep bug open rpl_ndb_2ndb : Bug#45974: rpl_ndb_2ndb fails sporadically -- cgit v1.2.1 From 3670dcf38d5c5ce8256da47a6cbaed21f32f8e85 Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Fri, 2 Jul 2010 14:56:54 +0400 Subject: BUG#54832 - Comment for MyISAM says it is a default engine Fixed MyISAM storage engine comment, so it doesn't anymore state that MyISAM is default storage engine. --- storage/myisam/ha_myisam.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc index e0e104a4878..26f6a3903a8 100644 --- a/storage/myisam/ha_myisam.cc +++ b/storage/myisam/ha_myisam.cc @@ -2069,7 +2069,7 @@ mysql_declare_plugin(myisam) &myisam_storage_engine, "MyISAM", "MySQL AB", - "Default engine as of MySQL 3.23 with great performance", + "MyISAM storage engine", PLUGIN_LICENSE_GPL, myisam_init, /* Plugin Init */ NULL, /* Plugin Deinit */ -- cgit v1.2.1 From db7ba46461e4261f362829b94cc3125205b7c64a Mon Sep 17 00:00:00 2001 From: Alfranio Correia Date: Sun, 4 Jul 2010 20:35:05 +0100 Subject: Post-push fix for BUG#53259. --- mysql-test/r/sp_trans_log.result | 2 +- mysql-test/t/sp_trans_log.test | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/sp_trans_log.result b/mysql-test/r/sp_trans_log.result index 34d24f70848..e3463dec571 100644 --- a/mysql-test/r/sp_trans_log.result +++ b/mysql-test/r/sp_trans_log.result @@ -14,7 +14,7 @@ end| reset master| insert into t2 values (bug23333(),1)| ERROR 23000: Duplicate entry '1' for key 'PRIMARY' -show binlog events from | +show binlog events from limit 0, 4| Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) diff --git a/mysql-test/t/sp_trans_log.test b/mysql-test/t/sp_trans_log.test index f162ee5cea6..972c3dd36eb 100644 --- a/mysql-test/t/sp_trans_log.test +++ b/mysql-test/t/sp_trans_log.test @@ -34,7 +34,10 @@ end| reset master| --error ER_DUP_ENTRY insert into t2 values (bug23333(),1)| -# the following must show there is (are) events after the query */ +# the following must show there are events after the query +# the binlog_limit is used to hide the differences between the mixed +# and row logging formats after BUG#53259 +let $binlog_limit= 0, 4| source include/show_binlog_events.inc| select count(*),@a from t1 /* must be 1,1 */| -- cgit v1.2.1 From 4a739a14c0ac353531b6d977e21752bbaac055ed Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Mon, 5 Jul 2010 11:34:29 +0400 Subject: BUG#54832 - Comment for MyISAM says it is a default engine Adjusted tests. mysql-test/r/information_schema.result: Adjusted tests. mysql-test/suite/funcs_1/r/is_engines_myisam.result: Adjusted tests. --- mysql-test/r/information_schema.result | 2 +- mysql-test/suite/funcs_1/r/is_engines_myisam.result | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result index 86fa9d76864..eb3abc3f0c9 100644 --- a/mysql-test/r/information_schema.result +++ b/mysql-test/r/information_schema.result @@ -1427,7 +1427,7 @@ USE test; End of 5.0 tests. select * from information_schema.engines WHERE ENGINE="MyISAM"; ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS -MyISAM DEFAULT Default engine as of MySQL 3.23 with great performance NO NO NO +MyISAM DEFAULT MyISAM storage engine NO NO NO grant select on *.* to user3148@localhost; select user,db from information_schema.processlist; user db diff --git a/mysql-test/suite/funcs_1/r/is_engines_myisam.result b/mysql-test/suite/funcs_1/r/is_engines_myisam.result index 2af9b3ce329..7e42c864187 100644 --- a/mysql-test/suite/funcs_1/r/is_engines_myisam.result +++ b/mysql-test/suite/funcs_1/r/is_engines_myisam.result @@ -2,7 +2,7 @@ SELECT * FROM information_schema.engines WHERE ENGINE = 'MyISAM'; ENGINE MyISAM SUPPORT DEFAULT -COMMENT Default engine as of MySQL 3.23 with great performance +COMMENT MyISAM storage engine TRANSACTIONS NO XA NO SAVEPOINTS NO -- cgit v1.2.1 From 9f483f1a3d57c7f9815dfbe49a10c2cf0043c943 Mon Sep 17 00:00:00 2001 From: Alexander Nozdrin Date: Mon, 5 Jul 2010 13:17:01 +0400 Subject: Backporting patch for Bug#52716 (Large files support is disabled, large-pages option is broken) from next-mr to trunk-bugfixing. Original revision: ------------------------------------------------------------ revision-id: vvaintroub@mysql.com-20100416134524-y4v27j90p5xvblmy parent: luis.soares@sun.com-20100416000700-n267ynu77visx31t committer: Vladislav Vaintroub branch nick: mysql-next-mr-bugfixing timestamp: Fri 2010-04-16 15:45:24 +0200 message: Bug #52716 Large files support is disabled, large-pages option is broken. Correct typo: large pages option was tied to wrong variable opt_large_files, instead of opt_large_pages. ------------------------------------------------------------ --- sql/sys_vars.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 7eb9a72273b..6b7dd7a8a2e 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -875,7 +875,7 @@ static Sys_var_uint Sys_large_page_size( static Sys_var_mybool Sys_large_pages( "large_pages", "Enable support for large pages", - READ_ONLY GLOBAL_VAR(opt_large_files), + READ_ONLY GLOBAL_VAR(opt_large_pages), IF_WIN(NO_CMD_LINE, CMD_LINE(OPT_ARG)), DEFAULT(FALSE)); static Sys_var_charptr Sys_language( -- cgit v1.2.1 From b8f24eedf5bf909c36b98c5227066703e0f3526a Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Mon, 5 Jul 2010 18:20:46 +0200 Subject: Backport changeset from mysql-next-mr-bugfixing: 3245 Vladislav Vaintroub 2010-06-16 Bug #52959 uint in typedef.h undefined on Windows Fix: change uint to "unsigned int" --- include/typelib.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/typelib.h b/include/typelib.h index c6a7f7a42e9..3badb14c96e 100644 --- a/include/typelib.h +++ b/include/typelib.h @@ -36,9 +36,9 @@ extern TYPELIB *copy_typelib(MEM_ROOT *root, TYPELIB *from); extern TYPELIB sql_protocol_typelib; -my_ulonglong find_set_from_flags(const TYPELIB *lib, uint default_name, +my_ulonglong find_set_from_flags(const TYPELIB *lib, unsigned int default_name, my_ulonglong cur_set, my_ulonglong default_set, - const char *str, uint length, - char **err_pos, uint *err_len); + const char *str, unsigned int length, + char **err_pos, unsigned int *err_len); #endif /* _typelib_h */ -- cgit v1.2.1 From 0a3d85adfa5fdd6b465542da472dbe318f9a64de Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Mon, 5 Jul 2010 23:00:56 +0200 Subject: Post-fix for Bug#52929 : replace uint with "unsigned int" in mysql.h.pp --- include/mysql.h.pp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/mysql.h.pp b/include/mysql.h.pp index 4fef9e9ec0b..bc5d611ec84 100644 --- a/include/mysql.h.pp +++ b/include/mysql.h.pp @@ -233,10 +233,10 @@ extern void make_type(char *to,unsigned int nr,TYPELIB *typelib); extern const char *get_type(TYPELIB *typelib,unsigned int nr); extern TYPELIB *copy_typelib(MEM_ROOT *root, TYPELIB *from); extern TYPELIB sql_protocol_typelib; -my_ulonglong find_set_from_flags(const TYPELIB *lib, uint default_name, +my_ulonglong find_set_from_flags(const TYPELIB *lib, unsigned int default_name, my_ulonglong cur_set, my_ulonglong default_set, - const char *str, uint length, - char **err_pos, uint *err_len); + const char *str, unsigned int length, + char **err_pos, unsigned int *err_len); typedef struct st_mysql_rows { struct st_mysql_rows *next; MYSQL_ROW data; -- cgit v1.2.1 From e1bbe2443cf9abe74320d138f74c0f4d4959b68c Mon Sep 17 00:00:00 2001 From: Alexander Nozdrin Date: Tue, 6 Jul 2010 17:06:07 +0400 Subject: Fix sys_vars.large_files_support_basic failure. --- mysql-test/suite/sys_vars/r/large_files_support_basic.result | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mysql-test/suite/sys_vars/r/large_files_support_basic.result b/mysql-test/suite/sys_vars/r/large_files_support_basic.result index a33e3894ddc..e6e1729ed3f 100644 --- a/mysql-test/suite/sys_vars/r/large_files_support_basic.result +++ b/mysql-test/suite/sys_vars/r/large_files_support_basic.result @@ -1,20 +1,20 @@ select @@global.large_files_support; @@global.large_files_support -0 +1 select @@session.large_files_support; ERROR HY000: Variable 'large_files_support' is a GLOBAL variable show global variables like 'large_files_support'; Variable_name Value -large_files_support OFF +large_files_support ON show session variables like 'large_files_support'; Variable_name Value -large_files_support OFF +large_files_support ON select * from information_schema.global_variables where variable_name='large_files_support'; VARIABLE_NAME VARIABLE_VALUE -LARGE_FILES_SUPPORT OFF +LARGE_FILES_SUPPORT ON select * from information_schema.session_variables where variable_name='large_files_support'; VARIABLE_NAME VARIABLE_VALUE -LARGE_FILES_SUPPORT OFF +LARGE_FILES_SUPPORT ON set global large_files_support=1; ERROR HY000: Variable 'large_files_support' is a read only variable set session large_files_support=1; -- cgit v1.2.1 From 6eb854de1f2cf96fe16a77cf89e7a97809b6dd4f Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Tue, 6 Jul 2010 14:38:03 -0300 Subject: Bug#54783: optimize table crashes with invalid timestamp default value and NO_ZERO_DATE The problem was that a older version of the error path for a failed admin statement relied upon a few error conditions being met in order to access a table handler, the first one being that the table object pointer was not NULL. Probably due to chance, in all cases a table object was closed but the reference wasn't reset, the other conditions didn't evaluate to true. With the addition of a new check on the error path, the handler started being dereferenced whenever it was not reset to NULL, causing problems for code paths which closed the table but didn't reset the reference. The solution is to reset the reference whenever a admin statement fails and the tables are closed. mysql-test/r/partition_innodb.result: Add test case result for Bug#54783 mysql-test/t/partition_innodb.test: Add test case for Bug#54783 sql/sql_table.cc: In case table recreate failed, set a appropriate result code. Reset reference to a closed table object, otherwise the error path might attempt to access it. --- mysql-test/r/partition_innodb.result | 18 ++++++++++++++++++ mysql-test/t/partition_innodb.test | 16 ++++++++++++++++ sql/sql_table.cc | 3 +++ 3 files changed, 37 insertions(+) diff --git a/mysql-test/r/partition_innodb.result b/mysql-test/r/partition_innodb.result index 8ae16238a18..58d014938bf 100644 --- a/mysql-test/r/partition_innodb.result +++ b/mysql-test/r/partition_innodb.result @@ -373,3 +373,21 @@ CREATE TABLE t1 (a INT) ENGINE=InnoDB PARTITION BY list(a) (PARTITION p1 VALUES IN (1)); CREATE INDEX i1 ON t1 (a); DROP TABLE t1; +# +# Bug#54783: optimize table crashes with invalid timestamp default value and NO_ZERO_DATE +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a INT, b TIMESTAMP DEFAULT '0000-00-00 00:00:00') +ENGINE=INNODB PARTITION BY LINEAR HASH (a) PARTITIONS 1; +SET @old_mode = @@sql_mode; +SET SESSION sql_mode = 'NO_ZERO_DATE'; +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize error Invalid default value for 'b' +test.t1 optimize status Operation failed +Warnings: +Warning 1265 Data truncated for column 'b' at row 1 +Error 1067 Invalid default value for 'b' +SET SESSION sql_mode = @old_mode; +DROP TABLE t1; diff --git a/mysql-test/t/partition_innodb.test b/mysql-test/t/partition_innodb.test index ccca4df9882..30f5894716c 100644 --- a/mysql-test/t/partition_innodb.test +++ b/mysql-test/t/partition_innodb.test @@ -452,3 +452,19 @@ SELECT * FROM t1; COMMIT; DROP TABLE t1; --enable_parsing + +--echo # +--echo # Bug#54783: optimize table crashes with invalid timestamp default value and NO_ZERO_DATE +--echo # + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +CREATE TABLE t1 (a INT, b TIMESTAMP DEFAULT '0000-00-00 00:00:00') + ENGINE=INNODB PARTITION BY LINEAR HASH (a) PARTITIONS 1; +SET @old_mode = @@sql_mode; +SET SESSION sql_mode = 'NO_ZERO_DATE'; +OPTIMIZE TABLE t1; +SET SESSION sql_mode = @old_mode; +DROP TABLE t1; diff --git a/sql/sql_table.cc b/sql/sql_table.cc index b3213638c4d..da065c450af 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -4930,6 +4930,8 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, */ if (thd->stmt_da->is_ok()) thd->stmt_da->reset_diagnostics_area(); + table->table= NULL; + result_code= result_code ? HA_ADMIN_FAILED : HA_ADMIN_OK; goto send_result; } } @@ -5060,6 +5062,7 @@ send_result_message: trans_commit_stmt(thd); trans_commit(thd); close_thread_tables(thd); + table->table= NULL; thd->mdl_context.release_transactional_locks(); if (!result_code) // recreation went ok { -- cgit v1.2.1 From 21387da7d936a691b111204a2a7887909950a215 Mon Sep 17 00:00:00 2001 From: Luis Soares Date: Tue, 6 Jul 2010 23:41:59 +0100 Subject: BUG#54744: valgrind reports leak for mysqlbinlog The server was not cleaning up dbug allocated memory before exiting. This is not a real problem, as this memory would be deallocated anyway. Nonetheless, we improve the mysqlbinlog exit procedure, wrt to memory book-keeping, when no parameter is given. To fix this, we deploy a call to my_thread_end() before the thread exits, which will also free pending dbug related allocated blocks. --- client/mysqlbinlog.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index 9d85e24d03f..879409515c2 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -2032,6 +2032,7 @@ int main(int argc, char** argv) { usage(); free_defaults(defaults_argv); + my_thread_end(); exit(1); } -- cgit v1.2.1 From 72bb9b7acbacc20172512184dc2724fccbc7a741 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Wed, 7 Jul 2010 10:00:46 +0400 Subject: Bug#52159 returning time type from function and empty left join causes debug assertion Problem: Item_copy did not set "fixed", which resulted in DBUG_ASSERT in some cases. Fix: adding initialization of the "fixed" member Adding tests: mysql-test/include/ctype_numconv.inc mysql-test/r/ctype_binary.result mysql-test/r/ctype_cp1251.result mysql-test/r/ctype_latin1.result mysql-test/r/ctype_ucs.result Adding initialization of the "fixed" member: sql/item.h --- mysql-test/include/ctype_numconv.inc | 19 +++++++++++++++++++ mysql-test/r/ctype_binary.result | 20 ++++++++++++++++++++ mysql-test/r/ctype_cp1251.result | 20 ++++++++++++++++++++ mysql-test/r/ctype_latin1.result | 20 ++++++++++++++++++++ mysql-test/r/ctype_ucs.result | 20 ++++++++++++++++++++ sql/item.h | 1 + 6 files changed, 100 insertions(+) diff --git a/mysql-test/include/ctype_numconv.inc b/mysql-test/include/ctype_numconv.inc index be82f67b9f8..d6bfa23017e 100644 --- a/mysql-test/include/ctype_numconv.inc +++ b/mysql-test/include/ctype_numconv.inc @@ -1606,3 +1606,22 @@ drop function f1; --echo # End of WL#2649 Number-to-string conversions --echo # +--echo # +--echo # Bug#52159 returning time type from function and empty left join causes debug assertion +--echo # +CREATE FUNCTION f1() RETURNS TIME RETURN 1; +CREATE TABLE t1 (b INT); +INSERT INTO t1 VALUES (0); +SELECT f1() FROM t1 LEFT JOIN (SELECT 1 AS a FROM t1 LIMIT 0) AS d ON 1 GROUP BY a; +DROP FUNCTION f1; +DROP TABLE t1; + +SET NAMES latin1; +SET sql_mode=''; +CREATE TABLE t1(a char(215) CHARACTER SET utf8 NOT NULL DEFAULT '', KEY(a)); +INSERT INTO t1 VALUES (); +--disable_warnings +SELECT maketime(`a`,`a`,`a`) FROM t1 GROUP BY 1; +--enable_warnings +DROP TABLE t1; +SET sql_mode=default; diff --git a/mysql-test/r/ctype_binary.result b/mysql-test/r/ctype_binary.result index 3ffb087c1d3..4b93e6533d7 100644 --- a/mysql-test/r/ctype_binary.result +++ b/mysql-test/r/ctype_binary.result @@ -2567,5 +2567,25 @@ drop function f1; # End of WL#2649 Number-to-string conversions # # +# Bug#52159 returning time type from function and empty left join causes debug assertion +# +CREATE FUNCTION f1() RETURNS TIME RETURN 1; +CREATE TABLE t1 (b INT); +INSERT INTO t1 VALUES (0); +SELECT f1() FROM t1 LEFT JOIN (SELECT 1 AS a FROM t1 LIMIT 0) AS d ON 1 GROUP BY a; +f1() +00:00:01 +DROP FUNCTION f1; +DROP TABLE t1; +SET NAMES latin1; +SET sql_mode=''; +CREATE TABLE t1(a char(215) CHARACTER SET utf8 NOT NULL DEFAULT '', KEY(a)); +INSERT INTO t1 VALUES (); +SELECT maketime(`a`,`a`,`a`) FROM t1 GROUP BY 1; +maketime(`a`,`a`,`a`) +00:00:00 +DROP TABLE t1; +SET sql_mode=default; +# # End of 5.5 tests # diff --git a/mysql-test/r/ctype_cp1251.result b/mysql-test/r/ctype_cp1251.result index e0339ee2109..869a84a34c9 100644 --- a/mysql-test/r/ctype_cp1251.result +++ b/mysql-test/r/ctype_cp1251.result @@ -2649,5 +2649,25 @@ drop function f1; # End of WL#2649 Number-to-string conversions # # +# Bug#52159 returning time type from function and empty left join causes debug assertion +# +CREATE FUNCTION f1() RETURNS TIME RETURN 1; +CREATE TABLE t1 (b INT); +INSERT INTO t1 VALUES (0); +SELECT f1() FROM t1 LEFT JOIN (SELECT 1 AS a FROM t1 LIMIT 0) AS d ON 1 GROUP BY a; +f1() +00:00:01 +DROP FUNCTION f1; +DROP TABLE t1; +SET NAMES latin1; +SET sql_mode=''; +CREATE TABLE t1(a char(215) CHARACTER SET utf8 NOT NULL DEFAULT '', KEY(a)); +INSERT INTO t1 VALUES (); +SELECT maketime(`a`,`a`,`a`) FROM t1 GROUP BY 1; +maketime(`a`,`a`,`a`) +00:00:00 +DROP TABLE t1; +SET sql_mode=default; +# # End of 5.5 tests # diff --git a/mysql-test/r/ctype_latin1.result b/mysql-test/r/ctype_latin1.result index 4f0e863bfca..8dbd09741ff 100644 --- a/mysql-test/r/ctype_latin1.result +++ b/mysql-test/r/ctype_latin1.result @@ -2977,5 +2977,25 @@ drop function f1; # End of WL#2649 Number-to-string conversions # # +# Bug#52159 returning time type from function and empty left join causes debug assertion +# +CREATE FUNCTION f1() RETURNS TIME RETURN 1; +CREATE TABLE t1 (b INT); +INSERT INTO t1 VALUES (0); +SELECT f1() FROM t1 LEFT JOIN (SELECT 1 AS a FROM t1 LIMIT 0) AS d ON 1 GROUP BY a; +f1() +00:00:01 +DROP FUNCTION f1; +DROP TABLE t1; +SET NAMES latin1; +SET sql_mode=''; +CREATE TABLE t1(a char(215) CHARACTER SET utf8 NOT NULL DEFAULT '', KEY(a)); +INSERT INTO t1 VALUES (); +SELECT maketime(`a`,`a`,`a`) FROM t1 GROUP BY 1; +maketime(`a`,`a`,`a`) +00:00:00 +DROP TABLE t1; +SET sql_mode=default; +# # End of 5.5 tests # diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result index 4f033d54043..892e893db4d 100644 --- a/mysql-test/r/ctype_ucs.result +++ b/mysql-test/r/ctype_ucs.result @@ -3808,6 +3808,26 @@ drop function f1; # # End of WL#2649 Number-to-string conversions # +# +# Bug#52159 returning time type from function and empty left join causes debug assertion +# +CREATE FUNCTION f1() RETURNS TIME RETURN 1; +CREATE TABLE t1 (b INT); +INSERT INTO t1 VALUES (0); +SELECT f1() FROM t1 LEFT JOIN (SELECT 1 AS a FROM t1 LIMIT 0) AS d ON 1 GROUP BY a; +f1() +00:00:01 +DROP FUNCTION f1; +DROP TABLE t1; +SET NAMES latin1; +SET sql_mode=''; +CREATE TABLE t1(a char(215) CHARACTER SET utf8 NOT NULL DEFAULT '', KEY(a)); +INSERT INTO t1 VALUES (); +SELECT maketime(`a`,`a`,`a`) FROM t1 GROUP BY 1; +maketime(`a`,`a`,`a`) +00:00:00 +DROP TABLE t1; +SET sql_mode=default; SET NAMES latin1; # # End of 5.5 tests diff --git a/sql/item.h b/sql/item.h index e18fa43037a..35a0e8373f2 100644 --- a/sql/item.h +++ b/sql/item.h @@ -2791,6 +2791,7 @@ protected: cached_field_type= item->field_type(); cached_result_type= item->result_type(); unsigned_flag= item->unsigned_flag; + fixed= item->fixed; } public: -- cgit v1.2.1 From 00e86d01a72c539b915e07f4b7b8fe218433fd60 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Wed, 7 Jul 2010 10:38:11 +0400 Subject: Bug#54661 sha2() returns BINARY result Problem: sha2() reported its result as BINARY Fix: - Inheriting Item_func_sha2 from Item_str_ascii_func - Setting max_length via fix_length_and_charset() instead of direct assignment. - Adding tests --- mysql-test/r/func_digest.result | 21 +++++++++++++++++++++ mysql-test/t/func_digest.test | 13 +++++++++++++ sql/item_strfunc.cc | 10 +++++----- sql/item_strfunc.h | 13 +++++-------- 4 files changed, 44 insertions(+), 13 deletions(-) diff --git a/mysql-test/r/func_digest.result b/mysql-test/r/func_digest.result index ff3a4dcf79a..095b69363ce 100644 --- a/mysql-test/r/func_digest.result +++ b/mysql-test/r/func_digest.result @@ -1405,3 +1405,24 @@ LENGTH(SHA2( 'size', 384 )) / 2 * 8 = 384 SELECT LENGTH(SHA2( 'computed', 512 )) / 2 * 8 = 512; LENGTH(SHA2( 'computed', 512 )) / 2 * 8 = 512 1 +# +# Bug#54661 sha2() returns BINARY result +# +SET NAMES binary; +SELECT sha2('1',224); +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def sha2('1',224) 253 56 56 Y 128 31 63 +sha2('1',224) +e25388fde8290dc286a6164fa2d97e551b53498dcbf7bc378eb1f178 +SET NAMES utf8; +SELECT sha2('1',224); +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def sha2('1',224) 253 168 56 Y 0 31 33 +sha2('1',224) +e25388fde8290dc286a6164fa2d97e551b53498dcbf7bc378eb1f178 +SET NAMES latin1; +SELECT sha2('1',224); +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def sha2('1',224) 253 56 56 Y 0 31 8 +sha2('1',224) +e25388fde8290dc286a6164fa2d97e551b53498dcbf7bc378eb1f178 diff --git a/mysql-test/t/func_digest.test b/mysql-test/t/func_digest.test index 4020ef0f4fc..81f19c7e091 100644 --- a/mysql-test/t/func_digest.test +++ b/mysql-test/t/func_digest.test @@ -481,3 +481,16 @@ SELECT LENGTH(SHA2( '', 224 )) / 2 * 8 = 224; SELECT LENGTH(SHA2( 'any', 256 )) / 2 * 8 = 256; SELECT LENGTH(SHA2( 'size', 384 )) / 2 * 8 = 384; SELECT LENGTH(SHA2( 'computed', 512 )) / 2 * 8 = 512; + +--echo # +--echo # Bug#54661 sha2() returns BINARY result +--echo # +--enable_metadata +SET NAMES binary; +SELECT sha2('1',224); +SET NAMES utf8; +SELECT sha2('1',224); +SET NAMES latin1; +SELECT sha2('1',224); +--disable_metadata + diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 61febb01e93..2a9eef2298d 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -242,7 +242,7 @@ void Item_func_sha::fix_length_and_dec() fix_length_and_charset(SHA1_HASH_SIZE * 2, default_charset()); } -String *Item_func_sha2::val_str(String *str) +String *Item_func_sha2::val_str_ascii(String *str) { DBUG_ASSERT(fixed == 1); #if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY) @@ -338,19 +338,19 @@ void Item_func_sha2::fix_length_and_dec() switch (sha_variant) { #ifndef OPENSSL_NO_SHA512 case 512: - max_length= SHA512_DIGEST_LENGTH*2; + fix_length_and_charset(SHA512_DIGEST_LENGTH * 2, default_charset()); break; case 384: - max_length= SHA384_DIGEST_LENGTH*2; + fix_length_and_charset(SHA384_DIGEST_LENGTH * 2, default_charset()); break; #endif #ifndef OPENSSL_NO_SHA256 case 256: case 0: // SHA-256 is the default - max_length= SHA256_DIGEST_LENGTH*2; + fix_length_and_charset(SHA256_DIGEST_LENGTH * 2, default_charset()); break; case 224: - max_length= SHA224_DIGEST_LENGTH*2; + fix_length_and_charset(SHA224_DIGEST_LENGTH * 2, default_charset()); break; #endif default: diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h index 2a34babae87..df794ecaaf4 100644 --- a/sql/item_strfunc.h +++ b/sql/item_strfunc.h @@ -82,16 +82,13 @@ public: const char *func_name() const { return "sha"; } }; -class Item_func_sha2 :public Item_str_func +class Item_func_sha2 :public Item_str_ascii_func { public: - Item_func_sha2(Item *a, Item *b) :Item_str_func(a, b) - { - collation.set(&my_charset_bin); - } - String *val_str(String *); - void fix_length_and_dec(); - const char *func_name() const { return "sha2"; } + Item_func_sha2(Item *a, Item *b) :Item_str_ascii_func(a, b) {} + String *val_str_ascii(String *); + void fix_length_and_dec(); + const char *func_name() const { return "sha2"; } }; class Item_func_aes_encrypt :public Item_str_func -- cgit v1.2.1 From 18bde950e33b2fa7e54500b2a7994d88b3cc4bf1 Mon Sep 17 00:00:00 2001 From: Guilhem Bichot Date: Thu, 8 Jul 2010 14:36:10 +0200 Subject: backport of guilhem@mysql.com-20100628140739-i9vy8ugxp1v5aspb from next-mr-bugfixing: BUG#54682 "set sql_select_limit=0 does not work"; let SQL_SELECT_LIMIT=0 work like it does in 5.1. mysql-test/suite/sys_vars/r/sql_select_limit_func.result: before the fix, the SET would emit a warning (0 being rounded up to 1) and SELECTs would return one row. sql/sys_vars.cc: 0 is allowed, it means an implicit LIMIT 0 (i.e. no rows returned) --- mysql-test/suite/sys_vars/r/sql_select_limit_func.result | 10 ++++++++++ mysql-test/suite/sys_vars/t/sql_select_limit_func.test | 8 ++++++++ sql/sys_vars.cc | 2 +- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/mysql-test/suite/sys_vars/r/sql_select_limit_func.result b/mysql-test/suite/sys_vars/r/sql_select_limit_func.result index 893816e6f0f..5d4daf8367b 100644 --- a/mysql-test/suite/sys_vars/r/sql_select_limit_func.result +++ b/mysql-test/suite/sys_vars/r/sql_select_limit_func.result @@ -62,6 +62,16 @@ a b a b 6 val6 6 val6 affected rows: 2 Expecting affected rows: 2 +SET SESSION sql_select_limit = 0; +affected rows: 0 +SELECT * FROM t1; +a b +affected rows: 0 +Expecting affected rows: 0 +SELECT * FROM t1 INNER JOIN t2 ON t1.a = t2.a; +a b a b +affected rows: 0 +Expecting affected rows: 0 '#-----------------------------FN_DYNVARS_165_03---------------#' SET SESSION sql_select_limit = 2; affected rows: 0 diff --git a/mysql-test/suite/sys_vars/t/sql_select_limit_func.test b/mysql-test/suite/sys_vars/t/sql_select_limit_func.test index ed582949aa0..99bc05c465c 100644 --- a/mysql-test/suite/sys_vars/t/sql_select_limit_func.test +++ b/mysql-test/suite/sys_vars/t/sql_select_limit_func.test @@ -86,6 +86,14 @@ SELECT * FROM t1; SELECT * FROM t1 INNER JOIN t2 ON t1.a = t2.a; --echo Expecting affected rows: 2 +SET SESSION sql_select_limit = 0; + +SELECT * FROM t1; +--echo Expecting affected rows: 0 + +SELECT * FROM t1 INNER JOIN t2 ON t1.a = t2.a; +--echo Expecting affected rows: 0 + --echo '#-----------------------------FN_DYNVARS_165_03---------------#' # # Small value with LIMIT Clause diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 6b7dd7a8a2e..eafb20cf0a3 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -2379,7 +2379,7 @@ static Sys_var_harows Sys_select_limit( "sql_select_limit", "The maximum number of rows to return from SELECT statements", SESSION_VAR(select_limit), NO_CMD_LINE, - VALID_RANGE(1, HA_POS_ERROR), DEFAULT(HA_POS_ERROR), BLOCK_SIZE(1)); + VALID_RANGE(0, HA_POS_ERROR), DEFAULT(HA_POS_ERROR), BLOCK_SIZE(1)); static bool update_timestamp(THD *thd, set_var *var) { -- cgit v1.2.1 From 5d2f2cc1a92a49493a4990160ab813da290f1696 Mon Sep 17 00:00:00 2001 From: Olav Sandstaa Date: Thu, 8 Jul 2010 15:19:05 +0200 Subject: Backporting of jorgen.loland@sun.com-20100618093212-lifp1psig3hbj6jj from mysql-next-mr-opt-backporting. Bug#54515: Crash in opt_range.cc::get_best_group_min_max on SELECT from VIEW with GROUP BY When handling the grouping items in get_best_group_min_max, the items need to be of type Item_field. In this bug, an ASSERT triggered because the item used for grouping was an Item_direct_view_ref (i.e., the group column is from a view). The fix is to get the real_item since Item_ref* pointing to Item_field is ok. mysql-test/r/select.result: Add test for BUG#54515 mysql-test/t/select.test: Add test for BUG#54515 sql/opt_range.cc: Get the real_item() when processing grouping items in get_best_group_min_max. --- mysql-test/r/select.result | 19 +++++++++++++++++++ mysql-test/t/select.test | 23 +++++++++++++++++++++++ sql/opt_range.cc | 4 ++-- 3 files changed, 44 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index e594e87694f..b518522e2bf 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -4857,3 +4857,22 @@ SELECT * FROM t1 WHERE 102 < c; a b c DROP TABLE t1; End of 5.1 tests +# +# Bug#54515: Crash in opt_range.cc::get_best_group_min_max on +# SELECT from VIEW with GROUP BY +# +CREATE TABLE t1 ( +col_int_key int DEFAULT NULL, +KEY int_key (col_int_key) +) ; +INSERT INTO t1 VALUES (1),(2); +CREATE VIEW view_t1 AS +SELECT t1.col_int_key AS col_int_key +FROM t1; +SELECT col_int_key FROM view_t1 GROUP BY col_int_key; +col_int_key +1 +2 +DROP VIEW view_t1; +DROP TABLE t1; +# End of test BUG#54515 diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index 1e53461f665..6f2d34459eb 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -4118,3 +4118,26 @@ DROP TABLE t1; --echo End of 5.1 tests + +--echo # +--echo # Bug#54515: Crash in opt_range.cc::get_best_group_min_max on +--echo # SELECT from VIEW with GROUP BY +--echo # + +CREATE TABLE t1 ( + col_int_key int DEFAULT NULL, + KEY int_key (col_int_key) +) ; + +INSERT INTO t1 VALUES (1),(2); + +CREATE VIEW view_t1 AS + SELECT t1.col_int_key AS col_int_key + FROM t1; + +SELECT col_int_key FROM view_t1 GROUP BY col_int_key; + +DROP VIEW view_t1; +DROP TABLE t1; + +--echo # End of test BUG#54515 diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 995582fc6ee..f195da9ae02 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -9570,8 +9570,8 @@ get_best_group_min_max(PARAM *param, SEL_TREE *tree, double read_time) first Item? If so, then why? What is the array for? */ /* Above we already checked that all group items are fields. */ - DBUG_ASSERT((*tmp_group->item)->type() == Item::FIELD_ITEM); - Item_field *group_field= (Item_field *) (*tmp_group->item); + DBUG_ASSERT((*tmp_group->item)->real_item()->type() == Item::FIELD_ITEM); + Item_field *group_field= (Item_field *) (*tmp_group->item)->real_item(); if (group_field->field->eq(cur_part->field)) { cur_group_prefix_len+= cur_part->store_length; -- cgit v1.2.1 From 6e3fb7bb071008e3645c9614e5b605ea00dffea4 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Thu, 8 Jul 2010 11:04:07 -0600 Subject: Fixed headers in include/mysql/psi --- include/mysql/psi/mysql_file.h | 6 +++--- include/mysql/psi/mysql_thread.h | 6 +++--- include/mysql/psi/psi.h | 6 +++--- include/mysql/psi/psi_abi_v1.h | 6 +++--- include/mysql/psi/psi_abi_v2.h | 6 +++--- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/include/mysql/psi/mysql_file.h b/include/mysql/psi/mysql_file.h index 0a998aaa76c..94c8c323621 100644 --- a/include/mysql/psi/mysql_file.h +++ b/include/mysql/psi/mysql_file.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2008-2009 Sun Microsystems, Inc +/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. 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 @@ -10,8 +10,8 @@ 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 */ + along with this program; if not, write to the Free Software Foundation, + 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ #ifndef MYSQL_FILE_H #define MYSQL_FILE_H diff --git a/include/mysql/psi/mysql_thread.h b/include/mysql/psi/mysql_thread.h index 4e839c7cf6a..193cb89647d 100644 --- a/include/mysql/psi/mysql_thread.h +++ b/include/mysql/psi/mysql_thread.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2008-2009 Sun Microsystems, Inc +/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. 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 @@ -10,8 +10,8 @@ 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 */ + along with this program; if not, write to the Free Software Foundation, + 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ #ifndef MYSQL_THREAD_H #define MYSQL_THREAD_H diff --git a/include/mysql/psi/psi.h b/include/mysql/psi/psi.h index 51446fa83a5..1cab6c3a11a 100644 --- a/include/mysql/psi/psi.h +++ b/include/mysql/psi/psi.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2008-2010 Sun Microsystems, Inc +/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. 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 @@ -10,8 +10,8 @@ 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 */ + along with this program; if not, write to the Free Software Foundation, + 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ #ifndef MYSQL_PERFORMANCE_SCHEMA_INTERFACE_H #define MYSQL_PERFORMANCE_SCHEMA_INTERFACE_H diff --git a/include/mysql/psi/psi_abi_v1.h b/include/mysql/psi/psi_abi_v1.h index c9dfd031668..0f62291696f 100644 --- a/include/mysql/psi/psi_abi_v1.h +++ b/include/mysql/psi/psi_abi_v1.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2008-2009 Sun Microsystems, Inc +/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. 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 @@ -10,8 +10,8 @@ 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 */ + along with this program; if not, write to the Free Software Foundation, + 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ /** @file mysql/psi/psi_abi_v1.h diff --git a/include/mysql/psi/psi_abi_v2.h b/include/mysql/psi/psi_abi_v2.h index e720c4c2b7c..08bca609b41 100644 --- a/include/mysql/psi/psi_abi_v2.h +++ b/include/mysql/psi/psi_abi_v2.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2008-2009 Sun Microsystems, Inc +/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. 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 @@ -10,8 +10,8 @@ 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 */ + along with this program; if not, write to the Free Software Foundation, + 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */ /** @file mysql/psi/psi_abi_v1.h -- cgit v1.2.1 From d3b01fef18b20f3ac589f2ecc95d64326570583f Mon Sep 17 00:00:00 2001 From: Luis Soares Date: Thu, 8 Jul 2010 17:30:19 +0100 Subject: Revert patch for BUG#54744. --- client/mysqlbinlog.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index 879409515c2..9d85e24d03f 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -2032,7 +2032,6 @@ int main(int argc, char** argv) { usage(); free_defaults(defaults_argv); - my_thread_end(); exit(1); } -- cgit v1.2.1 From f56dd32bf7c5b8a8cf35984f39f1a253b75945ff Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Thu, 8 Jul 2010 18:20:08 -0300 Subject: Bug#34043: Server loops excessively in _checkchunk() when safemalloc is enabled Essentially, the problem is that safemalloc is excruciatingly slow as it checks all allocated blocks for overrun at each memory management primitive, yielding a almost exponential slowdown for the memory management functions (malloc, realloc, free). The overrun check basically consists of verifying some bytes of a block for certain magic keys, which catches some simple forms of overrun. Another minor problem is violation of aliasing rules and that its own internal list of blocks is prone to corruption. Another issue with safemalloc is rather the maintenance cost as the tool has a significant impact on the server code. Given the magnitude of memory debuggers available nowadays, especially those that are provided with the platform malloc implementation, maintenance of a in-house and largely obsolete memory debugger becomes a burden that is not worth the effort due to its slowness and lack of support for detecting more common forms of heap corruption. Since there are third-party tools that can provide the same functionality at a lower or comparable performance cost, the solution is to simply remove safemalloc. Third-party tools can provide the same functionality at a lower or comparable performance cost. The removal of safemalloc also allows a simplification of the malloc wrappers, removing quite a bit of kludge: redefinition of my_malloc, my_free and the removal of the unused second argument of my_free. Since free() always check whether the supplied pointer is null, redudant checks are also removed. Also, this patch adds unit testing for my_malloc and moves my_realloc implementation into the same file as the other memory allocation primitives. client/mysqldump.c: Pass my_free directly as its signature is compatible with the callback type -- which wasn't the case for free_table_ent. --- BUILD/SETUP.sh | 4 +- BUILD/build_mccge.sh | 4 +- BUILD/compile-ia64-debug-max | 2 +- CMakeLists.txt | 9 +- client/completion_hash.cc | 3 +- client/mysql.cc | 48 +-- client/mysqladmin.cc | 12 +- client/mysqlbinlog.cc | 34 +- client/mysqlcheck.c | 12 +- client/mysqldump.c | 29 +- client/mysqlimport.c | 6 +- client/mysqlshow.c | 7 +- client/mysqlslap.c | 38 +- client/mysqltest.cc | 102 ++--- client/readline.cc | 8 +- client/sql_string.h | 2 +- configure.in | 4 +- dbug/CMakeLists.txt | 2 +- dbug/Makefile.am | 2 +- dbug/dbug.c | 23 +- dbug/sanity.c | 13 - dbug/user.r | 8 - extra/comp_err.c | 24 +- extra/my_print_defaults.c | 2 +- extra/replace.c | 22 +- include/hash.h | 8 +- include/lf.h | 2 +- include/my_global.h | 10 +- include/my_list.h | 2 +- include/my_nosys.h | 2 +- include/my_sys.h | 82 +--- include/mysql/psi/mysql_file.h | 4 +- libmysql/Makefile.am | 2 +- libmysql/Makefile.shared | 4 +- libmysql/libmysql.c | 16 +- libmysqld/lib_sql.cc | 12 +- libmysqld/libmysqld.c | 4 +- mysql-test/include/mysqld--help.inc | 2 +- mysql-test/lib/v1/mtr_report.pl | 14 - mysql-test/lib/v1/mysql-test-run.pl | 4 - mysql-test/mysql-stress-test.pl | 2 +- mysql-test/mysql-test-run.pl | 28 -- mysql-test/t/bug46080-master.opt | 2 +- mysql-test/t/mysql-bug45236-master.opt | 1 - mysys/CMakeLists.txt | 4 +- mysys/Makefile.am | 5 +- mysys/array.c | 9 +- mysys/charset.c | 4 +- mysys/default_modify.c | 4 +- mysys/hash.c | 4 +- mysys/lf_alloc-pin.c | 2 +- mysys/lf_dynarray.c | 8 +- mysys/lf_hash.c | 4 +- mysys/list.c | 4 +- mysys/mf_cache.c | 10 +- mysys/mf_iocache.c | 4 +- mysys/mf_keycache.c | 12 +- mysys/mf_keycaches.c | 4 +- mysys/mf_sort.c | 2 +- mysys/mf_tempdir.c | 2 +- mysys/mf_wfile.c | 3 +- mysys/my_alloc.c | 6 +- mysys/my_bitmap.c | 2 +- mysys/my_compress.c | 12 +- mysys/my_error.c | 6 +- mysys/my_file.c | 2 +- mysys/my_fopen.c | 2 +- mysys/my_gethwaddr.c | 2 +- mysys/my_getopt.c | 10 +- mysys/my_init.c | 10 +- mysys/my_largepage.c | 11 +- mysys/my_lib.c | 8 +- mysys/my_lockmem.c | 5 +- mysys/my_malloc.c | 118 +++-- mysys/my_once.c | 4 - mysys/my_open.c | 2 +- mysys/my_realloc.c | 75 ---- mysys/my_windac.c | 8 +- mysys/queues.c | 7 +- mysys/safemalloc.c | 576 ------------------------- mysys/string.c | 7 +- mysys/test_charset.c | 4 +- mysys/testhash.c | 2 +- mysys/thr_alarm.c | 2 +- mysys/tree.c | 4 +- mysys/trie.c | 2 +- plugin/daemon_example/daemon_example.cc | 2 +- plugin/semisync/semisync_master.h | 2 +- scripts/mysql_config.pl.in | 3 +- scripts/mysql_config.sh | 3 +- sql-common/client.c | 110 +++-- sql/debug_sync.cc | 4 +- sql/derror.cc | 5 +- sql/event_data_objects.cc | 6 +- sql/event_scheduler.cc | 2 +- sql/examples/CMakeLists.txt | 4 +- sql/filesort.cc | 47 +- sql/gstream.h | 2 +- sql/ha_ndbcluster.cc | 44 +- sql/ha_ndbcluster_binlog.cc | 18 +- sql/ha_partition.cc | 10 +- sql/handler.cc | 12 +- sql/handler.h | 4 - sql/item_func.cc | 10 +- sql/keycaches.cc | 6 +- sql/lock.cc | 12 +- sql/log.cc | 26 +- sql/log_event.cc | 34 +- sql/log_event.h | 12 +- sql/log_event_old.cc | 10 +- sql/mdl.cc | 4 +- sql/mysqld.cc | 20 +- sql/net_serv.cc | 4 +- sql/opt_range.cc | 10 +- sql/records.cc | 2 +- sql/repl_failsafe.cc | 4 +- sql/rpl_filter.cc | 4 +- sql/rpl_handler.cc | 4 +- sql/rpl_injector.cc | 2 +- sql/rpl_mi.cc | 2 +- sql/rpl_rli.cc | 2 +- sql/rpl_utility.cc | 2 +- sql/slave.cc | 8 +- sql/sp_pcontext.cc | 4 - sql/sp_rcontext.cc | 4 - sql/sql_base.cc | 18 +- sql/sql_binlog.cc | 2 +- sql/sql_cache.cc | 2 +- sql/sql_class.cc | 27 +- sql/sql_class.h | 2 +- sql/sql_connect.cc | 7 +- sql/sql_db.cc | 19 +- sql/sql_handler.cc | 4 +- sql/sql_insert.cc | 12 +- sql/sql_lex.cc | 4 +- sql/sql_list.h | 2 +- sql/sql_load.cc | 4 +- sql/sql_locale.cc | 2 +- sql/sql_manager.cc | 2 +- sql/sql_map.cc | 2 +- sql/sql_parse.cc | 19 +- sql/sql_partition.cc | 2 +- sql/sql_plugin.cc | 30 +- sql/sql_plugin.h | 14 +- sql/sql_profile.cc | 6 +- sql/sql_profile.h | 4 +- sql/sql_select.cc | 10 +- sql/sql_show.cc | 12 +- sql/sql_string.h | 2 +- sql/sql_table.cc | 10 +- sql/sql_test.cc | 5 - sql/sql_truncate.cc | 2 +- sql/sys_vars.h | 4 +- sql/table.cc | 40 +- sql/uniques.cc | 4 +- sql/unireg.cc | 22 +- storage/archive/archive_reader.c | 6 +- storage/archive/ha_archive.cc | 15 +- storage/blackhole/ha_blackhole.cc | 4 +- storage/csv/ha_tina.cc | 8 +- storage/csv/ha_tina.h | 2 +- storage/csv/transparent_file.cc | 2 +- storage/example/ha_example.cc | 4 +- storage/heap/ha_heap.cc | 4 +- storage/heap/hp_block.c | 2 +- storage/heap/hp_close.c | 2 +- storage/heap/hp_create.c | 6 +- storage/heap/hp_rename.c | 2 +- storage/ibmdb2i/db2i_constraints.cc | 2 +- storage/ibmdb2i/db2i_conversion.cc | 6 +- storage/ibmdb2i/db2i_file.cc | 15 +- storage/ibmdb2i/db2i_file.h | 2 +- storage/ibmdb2i/db2i_global.h | 2 +- storage/ibmdb2i/db2i_ileBridge.cc | 4 +- storage/ibmdb2i/db2i_ileBridge.h | 2 +- storage/ibmdb2i/ha_ibmdb2i.cc | 8 +- storage/innobase/handler/ha_innodb.cc | 33 +- storage/myisam/ft_boolean_search.c | 4 +- storage/myisam/ft_nlq_search.c | 2 +- storage/myisam/ft_stopwords.c | 6 +- storage/myisam/ha_myisam.cc | 4 +- storage/myisam/mi_check.c | 40 +- storage/myisam/mi_close.c | 12 +- storage/myisam/mi_create.c | 4 +- storage/myisam/mi_dynrec.c | 4 +- storage/myisam/mi_open.c | 4 +- storage/myisam/mi_packrec.c | 4 +- storage/myisam/mi_preload.c | 4 +- storage/myisam/mi_test2.c | 5 +- storage/myisam/mi_write.c | 4 +- storage/myisam/myisamchk.c | 7 +- storage/myisam/myisamlog.c | 12 +- storage/myisam/myisampack.c | 37 +- storage/myisam/rt_index.c | 2 +- storage/myisam/sort.c | 22 +- storage/myisammrg/ha_myisammrg.cc | 4 +- storage/myisammrg/myrg_close.c | 4 +- storage/myisammrg/myrg_open.c | 8 +- storage/ndb/config/win-lib.am | 2 +- storage/ndb/config/win-prg.am | 2 +- storage/ndb/include/util/NdbAutoPtr.hpp | 4 +- storage/ndb/src/mgmapi/mgmapi.cpp | 6 +- storage/ndb/src/mgmapi/ndb_logevent.cpp | 2 +- storage/ndb/test/ndbapi/testIndexStat.cpp | 6 +- storage/ndb/tools/restore/consumer_restore.cpp | 4 +- storage/perfschema/pfs.cc | 4 +- tests/mysql_client_test.c | 4 +- tests/thread_test.c | 2 +- unittest/mysys/CMakeLists.txt | 2 +- unittest/mysys/Makefile.am | 2 +- unittest/mysys/my_malloc-t.c | 43 ++ vio/test-ssl.c | 24 +- vio/test-sslclient.c | 6 +- vio/test-sslserver.c | 4 +- vio/vio.c | 6 +- vio/viosslfactories.c | 10 +- vio/viotest-ssl.c | 24 +- 217 files changed, 1012 insertions(+), 1821 deletions(-) delete mode 100644 dbug/sanity.c delete mode 100644 mysql-test/t/mysql-bug45236-master.opt delete mode 100644 mysys/my_realloc.c delete mode 100644 mysys/safemalloc.c create mode 100644 unittest/mysys/my_malloc-t.c diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh index 626f932e045..cb61f9cfd70 100755 --- a/BUILD/SETUP.sh +++ b/BUILD/SETUP.sh @@ -122,13 +122,13 @@ fi # Override -DFORCE_INIT_OF_VARS from debug_cflags. It enables the macro # LINT_INIT(), which is only useful for silencing spurious warnings # of static analysis tools. We want LINT_INIT() to be a no-op in Valgrind. -valgrind_flags="-USAFEMALLOC -UFORCE_INIT_OF_VARS -DHAVE_purify " +valgrind_flags="-UFORCE_INIT_OF_VARS -DHAVE_purify " valgrind_flags="$valgrind_flags -DMYSQL_SERVER_SUFFIX=-valgrind-max" valgrind_configs="--with-valgrind" # # Used in -debug builds debug_cflags="-DUNIV_MUST_NOT_INLINE -DEXTRA_DEBUG -DFORCE_INIT_OF_VARS " -debug_cflags="$debug_cflags -DSAFEMALLOC -DPEDANTIC_SAFEMALLOC -DSAFE_MUTEX" +debug_cflags="$debug_cflags -DSAFE_MUTEX" error_inject="--with-error-inject " # # Base C++ flags for all builds diff --git a/BUILD/build_mccge.sh b/BUILD/build_mccge.sh index c3803610e73..b85252028ae 100755 --- a/BUILD/build_mccge.sh +++ b/BUILD/build_mccge.sh @@ -1010,7 +1010,7 @@ set_ccache_usage() set_valgrind_flags() { if test "x$valgrind_flag" = "xyes" ; then - loc_valgrind_flags="-USAFEMALLOC -UFORCE_INIT_OF_VARS -DHAVE_purify " + loc_valgrind_flags="-UFORCE_INIT_OF_VARS -DHAVE_purify " loc_valgrind_flags="$loc_valgrind_flags -DMYSQL_SERVER_SUFFIX=-valgrind-max" compiler_flags="$compiler_flags $loc_valgrind_flags" with_flags="$with_flags --with-valgrind" @@ -1066,7 +1066,7 @@ set_with_debug_flags() if test "x$with_debug_flag" = "xyes" ; then if test "x$developer_flag" = "xyes" ; then loc_debug_flags="-DUNIV_MUST_NOT_INLINE -DEXTRA_DEBUG -DFORCE_INIT_OF_VARS " - loc_debug_flags="$loc_debug_flags -DSAFEMALLOC -DPEDANTIC_SAFEMALLOC" + loc_debug_flags="$loc_debug_flags" compiler_flags="$compiler_flags $loc_debug_flags" fi fi diff --git a/BUILD/compile-ia64-debug-max b/BUILD/compile-ia64-debug-max index 123bfb06300..e9b534c302e 100755 --- a/BUILD/compile-ia64-debug-max +++ b/BUILD/compile-ia64-debug-max @@ -4,5 +4,5 @@ gmake -k maintainer-clean || true path=`dirname $0` . "$path/autorun.sh" -CC=ecc CFLAGS="-w1 -DEXTRA_DEBUG -DSAFEMALLOC -DSAFE_MUTEX -O2" CXX=ecc CXXFLAGS="-w1 -DEXTRA_DEBUG -DSAFEMALLOC -DSAFE_MUTEX -O2" ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex --enable-thread-safe-client --with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static --with-debug --with-innodb --with-embedded-server --with-archive-storage-engine +CC=ecc CFLAGS="-w1 -DEXTRA_DEBUG -DSAFE_MUTEX -O2" CXX=ecc CXXFLAGS="-w1 -DEXTRA_DEBUG -DSAFE_MUTEX -O2" ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex --enable-thread-safe-client --with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static --with-debug --with-innodb --with-embedded-server --with-archive-storage-engine gmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 0131ac1b0a7..cb71cb6aefc 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,7 +34,7 @@ ENDIF() SET(CUSTOM_C_FLAGS $ENV{CFLAGS}) OPTION(WITH_DEBUG "Use dbug/safemutex" OFF) -OPTION(WITH_DEBUG_FULL "Use dbug and safemalloc/safemutex. Slow" OFF) +OPTION(WITH_DEBUG_FULL "Use dbug and safemutex. Slow." OFF) # Distinguish between community and non-community builds, with the # default being a community build. This does not impact the feature @@ -175,14 +175,13 @@ IF(NOT CMAKE_BUILD_TYPE ENDIF() ENDIF() -# Add safemalloc and safemutex for debug condifurations, except on Windows -# (C runtime library provides safemalloc functionality and safemutex has never -# worked there) +# Add safemutex for debug configurations, except on Windows +# (safemutex has never worked on Windows) IF(WITH_DEBUG OR WITH_DEBUG_FULL AND NOT WIN32) FOREACH(LANG C CXX) IF(WITH_DEBUG_FULL) SET(CMAKE_${LANG}_FLAGS_DEBUG - "${CMAKE_${LANG}_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") + "${CMAKE_${LANG}_FLAGS_DEBUG} -DSAFE_MUTEX") ELSE() SET(CMAKE_${LANG}_FLAGS_DEBUG "${CMAKE_${LANG}_FLAGS_DEBUG} -DSAFE_MUTEX") diff --git a/client/completion_hash.cc b/client/completion_hash.cc index cd0ea17dfaf..dc7f0329db8 100644 --- a/client/completion_hash.cc +++ b/client/completion_hash.cc @@ -22,7 +22,6 @@ #include #include -#undef SAFEMALLOC // Speed things up #include #include "completion_hash.h" @@ -213,7 +212,7 @@ void completion_hash_clean(HashTable *ht) void completion_hash_free(HashTable *ht) { completion_hash_clean(ht); - my_free(ht->arBuckets, MYF(0)); + my_free(ht->arBuckets); } diff --git a/client/mysql.cc b/client/mysql.cc index 58ef51f3fff..d64bd8f686a 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -1205,7 +1205,7 @@ int main(int argc,char *argv[]) strncmp(link_name, "/dev/null", 10) == 0) { /* The .mysql_history file is a symlink to /dev/null, don't use it */ - my_free(histfile, MYF(MY_ALLOW_ZERO_PTR)); + my_free(histfile); histfile= 0; } } @@ -1266,23 +1266,23 @@ sig_handler mysql_end(int sig) glob_buffer.free(); old_buffer.free(); processed_prompt.free(); - my_free(server_version,MYF(MY_ALLOW_ZERO_PTR)); - my_free(opt_password,MYF(MY_ALLOW_ZERO_PTR)); - my_free(opt_mysql_unix_port,MYF(MY_ALLOW_ZERO_PTR)); - my_free(histfile,MYF(MY_ALLOW_ZERO_PTR)); - my_free(histfile_tmp,MYF(MY_ALLOW_ZERO_PTR)); - my_free(current_db,MYF(MY_ALLOW_ZERO_PTR)); - my_free(current_host,MYF(MY_ALLOW_ZERO_PTR)); - my_free(current_user,MYF(MY_ALLOW_ZERO_PTR)); - my_free(full_username,MYF(MY_ALLOW_ZERO_PTR)); - my_free(part_username,MYF(MY_ALLOW_ZERO_PTR)); - my_free(default_prompt,MYF(MY_ALLOW_ZERO_PTR)); + my_free(server_version); + my_free(opt_password); + my_free(opt_mysql_unix_port); + my_free(histfile); + my_free(histfile_tmp); + my_free(current_db); + my_free(current_host); + my_free(current_user); + my_free(full_username); + my_free(part_username); + my_free(default_prompt); #ifdef HAVE_SMEM - my_free(shared_memory_base_name,MYF(MY_ALLOW_ZERO_PTR)); + my_free(shared_memory_base_name); #endif - my_free(current_prompt,MYF(MY_ALLOW_ZERO_PTR)); + my_free(current_prompt); while (embedded_server_arg_count > 1) - my_free(embedded_server_args[--embedded_server_arg_count],MYF(0)); + my_free(embedded_server_args[--embedded_server_arg_count]); mysql_server_end(); free_defaults(defaults_argv); my_end(my_end_arg); @@ -1736,7 +1736,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), if (argument) { char *start= argument; - my_free(opt_password, MYF(MY_ALLOW_ZERO_PTR)); + my_free(opt_password); opt_password= my_strdup(argument, MYF(MY_FAE)); while (*argument) *argument++= 'x'; // Destroy argument if (*start) @@ -1833,7 +1833,7 @@ static int get_options(int argc, char **argv) if (argc == 1) { skip_updates= 0; - my_free(current_db, MYF(MY_ALLOW_ZERO_PTR)); + my_free(current_db); current_db= my_strdup(*argv, MYF(MY_WME)); } if (tty_password) @@ -2731,7 +2731,7 @@ static void get_current_db() { MYSQL_RES *res; - my_free(current_db, MYF(MY_ALLOW_ZERO_PTR)); + my_free(current_db); current_db= NULL; /* In case of error below current_db will be NULL */ if (!mysql_query(&mysql, "SELECT DATABASE()") && @@ -4023,12 +4023,12 @@ com_connect(String *buffer, char *line) tmp= get_arg(buff, 0); if (tmp && *tmp) { - my_free(current_db, MYF(MY_ALLOW_ZERO_PTR)); + my_free(current_db); current_db= my_strdup(tmp, MYF(MY_WME)); tmp= get_arg(buff, 1); if (tmp) { - my_free(current_host,MYF(MY_ALLOW_ZERO_PTR)); + my_free(current_host); current_host=my_strdup(tmp,MYF(MY_WME)); } } @@ -4200,7 +4200,7 @@ com_use(String *buffer __attribute__((unused)), char *line) if (mysql_select_db(&mysql,tmp)) return put_error(&mysql); } - my_free(current_db,MYF(MY_ALLOW_ZERO_PTR)); + my_free(current_db); current_db=my_strdup(tmp,MYF(MY_WME)); #ifdef HAVE_READLINE if (select_db > 1) @@ -4952,8 +4952,8 @@ static void add_int_to_prompt(int toadd) static void init_username() { - my_free(full_username,MYF(MY_ALLOW_ZERO_PTR)); - my_free(part_username,MYF(MY_ALLOW_ZERO_PTR)); + my_free(full_username); + my_free(part_username); MYSQL_RES *result; LINT_INIT(result); @@ -4971,7 +4971,7 @@ static int com_prompt(String *buffer, char *line) { char *ptr=strchr(line, ' '); prompt_counter = 0; - my_free(current_prompt,MYF(MY_ALLOW_ZERO_PTR)); + my_free(current_prompt); current_prompt=my_strdup(ptr ? ptr+1 : default_prompt,MYF(MY_WME)); if (!ptr) tee_fprintf(stdout, "Returning to default PROMPT of %s\n", default_prompt); diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc index 64371224e2b..bf0dec01d2f 100644 --- a/client/mysqladmin.cc +++ b/client/mysqladmin.cc @@ -236,7 +236,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), if (argument) { char *start=argument; - my_free(opt_password,MYF(MY_ALLOW_ZERO_PTR)); + my_free(opt_password); opt_password=my_strdup(argument,MYF(MY_FAE)); while (*argument) *argument++= 'x'; /* Destroy argument */ if (*start) @@ -448,10 +448,10 @@ int main(int argc,char *argv[]) } /* got connection */ mysql_close(&mysql); - my_free(opt_password,MYF(MY_ALLOW_ZERO_PTR)); - my_free(user,MYF(MY_ALLOW_ZERO_PTR)); + my_free(opt_password); + my_free(user); #ifdef HAVE_SMEM - my_free(shared_memory_base_name,MYF(MY_ALLOW_ZERO_PTR)); + my_free(shared_memory_base_name); #endif free_defaults(save_argv); my_end(my_end_arg); @@ -1008,8 +1008,8 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) /* free up memory from prompted password */ if (typed_password != argv[1]) { - my_free(typed_password,MYF(MY_ALLOW_ZERO_PTR)); - my_free(verified,MYF(MY_ALLOW_ZERO_PTR)); + my_free(typed_password); + my_free(verified); } argc--; argv++; break; diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index 9d85e24d03f..d8b57381904 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -68,20 +68,20 @@ TYPELIB base64_output_mode_typelib= { array_elements(base64_output_mode_names) - 1, "", base64_output_mode_names, NULL }; static enum_base64_output_mode opt_base64_output_mode= BASE64_OUTPUT_UNSPEC; -static const char *opt_base64_output_mode_str= NullS; -static const char* database= 0; +static char *opt_base64_output_mode_str= NullS; +static char* database= 0; static my_bool force_opt= 0, short_form= 0, remote_opt= 0; static my_bool debug_info_flag, debug_check_flag; static my_bool force_if_open_opt= 1; static ulonglong offset = 0; -static const char* host = 0; +static char* host = 0; static int port= 0; static uint my_end_arg; static const char* sock= 0; #ifdef HAVE_SMEM static char *shared_memory_base_name= 0; #endif -static const char* user = 0; +static char* user = 0; static char* pass = 0; static char *charset= 0; @@ -96,7 +96,7 @@ static my_time_t start_datetime= 0, stop_datetime= MY_TIME_T_MAX; static ulonglong rec_count= 0; static short binlog_flags = 0; static MYSQL* mysql = NULL; -static const char* dirname_for_local_load= 0; +static char* dirname_for_local_load= 0; /** Pointer to the Format_description_log_event of the currently active binlog. @@ -191,7 +191,7 @@ public: int init() { return init_dynamic_array(&file_names, sizeof(File_name_record), - 100,100 CALLER_INFO); + 100, 100); } void init_by_dir_name(const char *dir) @@ -213,7 +213,7 @@ public: { if (ptr->fname) { - my_free(ptr->fname, MYF(MY_WME)); + my_free(ptr->fname); delete ptr->event; bzero((char *)ptr, sizeof(File_name_record)); } @@ -442,7 +442,7 @@ Exit_status Load_log_processor::process_first_event(const char *bname, { error("Could not construct local filename %s%s.", target_dir_name,bname); - my_free(fname, MYF(0)); + my_free(fname); delete ce; DBUG_RETURN(ERROR_STOP); } @@ -458,7 +458,7 @@ Exit_status Load_log_processor::process_first_event(const char *bname, if (set_dynamic(&file_names, (uchar*)&rec, file_id)) { error("Out of memory."); - my_free(fname, MYF(0)); + my_free(fname); delete ce; DBUG_RETURN(ERROR_STOP); } @@ -822,7 +822,7 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev, */ convert_path_to_forward_slashes((char*) ce->fname); ce->print(result_file, print_event_info, TRUE); - my_free((char*)ce->fname,MYF(MY_WME)); + my_free((void*)ce->fname); delete ce; } else @@ -887,7 +887,7 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev, } if (fname) - my_free(fname, MYF(MY_WME)); + my_free(fname); break; } case TABLE_MAP_EVENT: @@ -1222,11 +1222,11 @@ static void warning(const char *format,...) */ static void cleanup() { - my_free(pass,MYF(MY_ALLOW_ZERO_PTR)); - my_free((char*) database, MYF(MY_ALLOW_ZERO_PTR)); - my_free((char*) host, MYF(MY_ALLOW_ZERO_PTR)); - my_free((char*) user, MYF(MY_ALLOW_ZERO_PTR)); - my_free((char*) dirname_for_local_load, MYF(MY_ALLOW_ZERO_PTR)); + my_free(pass); + my_free(database); + my_free(host); + my_free(user); + my_free(dirname_for_local_load); delete glob_description_event; if (mysql) @@ -1306,7 +1306,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), argument= (char*) ""; // Don't require password if (argument) { - my_free(pass,MYF(MY_ALLOW_ZERO_PTR)); + my_free(pass); char *start=argument; pass= my_strdup(argument,MYF(MY_FAE)); while (*argument) *argument++= 'x'; /* Destroy argument */ diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c index 1fc9f179895..2c9c563e17f 100644 --- a/client/mysqlcheck.c +++ b/client/mysqlcheck.c @@ -291,7 +291,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), if (argument) { char *start = argument; - my_free(opt_password, MYF(MY_ALLOW_ZERO_PTR)); + my_free(opt_password); opt_password = my_strdup(argument, MYF(MY_FAE)); while (*argument) *argument++= 'x'; /* Destroy argument */ if (*start) @@ -470,7 +470,7 @@ static int process_selected_tables(char *db, char **table_names, int tables) } *--end = 0; handle_request_for_tables(table_names_comma_sep + 1, (uint) (tot_length - 1)); - my_free(table_names_comma_sep, MYF(0)); + my_free(table_names_comma_sep); } else for (; tables > 0; tables--, table_names++) @@ -569,7 +569,7 @@ static int process_all_tables_in_db(char *database) *--end = 0; if (tot_length) handle_request_for_tables(tables + 1, tot_length - 1); - my_free(tables, MYF(0)); + my_free(tables); } else { @@ -727,7 +727,7 @@ static int handle_request_for_tables(char *tables, uint length) return 1; } print_result(); - my_free(query, MYF(0)); + my_free(query); return 0; } @@ -899,9 +899,9 @@ int main(int argc, char **argv) dbDisconnect(current_host); if (opt_auto_repair) delete_dynamic(&tables4repair); - my_free(opt_password, MYF(MY_ALLOW_ZERO_PTR)); + my_free(opt_password); #ifdef HAVE_SMEM - my_free(shared_memory_base_name,MYF(MY_ALLOW_ZERO_PTR)); + my_free(shared_memory_base_name); #endif my_end(my_end_arg); return(first_error!=0); diff --git a/client/mysqldump.c b/client/mysqldump.c index 2d92f0891eb..6d294153c54 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -715,12 +715,6 @@ static void write_footer(FILE *sql_file) } /* write_footer */ -static void free_table_ent(char *key) -{ - my_free(key, MYF(0)); -} - - uchar* get_table_key(const char *entry, size_t *length, my_bool not_used __attribute__((unused))) { @@ -745,7 +739,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), if (argument) { char *start=argument; - my_free(opt_password,MYF(MY_ALLOW_ZERO_PTR)); + my_free(opt_password); opt_password=my_strdup(argument,MYF(MY_FAE)); while (*argument) *argument++= 'x'; /* Destroy argument */ if (*start) @@ -905,8 +899,7 @@ static int get_options(int *argc, char ***argv) defaults_argv= *argv; if (my_hash_init(&ignore_table, charset_info, 16, 0, 0, - (my_hash_get_key) get_table_key, - (my_hash_free_key) free_table_ent, 0)) + (my_hash_get_key) get_table_key, my_free, 0)) return(EX_EOM); /* Don't copy internal log tables */ if (my_hash_insert(&ignore_table, @@ -1420,7 +1413,7 @@ static void free_resources() { if (md_result_file && md_result_file != stdout) my_fclose(md_result_file, MYF(0)); - my_free(opt_password, MYF(MY_ALLOW_ZERO_PTR)); + my_free(opt_password); if (my_hash_inited(&ignore_table)) my_hash_free(&ignore_table); if (extended_insert) @@ -1534,7 +1527,7 @@ static void unescape(FILE *file,char *pos,uint length) fputs(tmp, file); fputc('\'', file); check_io(file); - my_free(tmp, MYF(MY_WME)); + my_free(tmp); DBUG_VOID_RETURN; } /* unescape */ @@ -2201,7 +2194,7 @@ static uint dump_routines_for_db(char *db) } } - my_free(query_str, MYF(MY_ALLOW_ZERO_PTR)); + my_free(query_str); } } /* end of routine printing */ mysql_free_result(routine_res); @@ -2374,12 +2367,12 @@ static uint get_table_structure(char *table, char *db, char *table_type, if (mysql_errno(mysql) == ER_VIEW_INVALID) fprintf(sql_file, "\n-- failed on view %s: %s\n\n", result_table, scv_buff ? scv_buff : ""); - my_free(scv_buff, MYF(MY_ALLOW_ZERO_PTR)); + my_free(scv_buff); DBUG_RETURN(0); } else - my_free(scv_buff, MYF(MY_ALLOW_ZERO_PTR)); + my_free(scv_buff); if (mysql_num_rows(result)) { @@ -2855,7 +2848,7 @@ static int dump_trigger(FILE *sql_file, MYSQL_RES *show_create_trigger_rs, DBUG_RETURN(TRUE); } - my_free(query_str, MYF(MY_ALLOW_ZERO_PTR)); + my_free(query_str); } DBUG_RETURN(FALSE); @@ -4073,7 +4066,7 @@ static int dump_all_tables_in_db(char *database) if (include_table((uchar*) hash_key, end - hash_key)) { dump_table(table,database); - my_free(order_by, MYF(MY_ALLOW_ZERO_PTR)); + my_free(order_by); order_by= 0; if (opt_dump_triggers && ! opt_xml && mysql_get_server_version(mysql) >= 50009) @@ -4345,7 +4338,7 @@ static int dump_selected_tables(char *db, char **table_names, int tables) dump_routines_for_db(db); } free_root(&root, MYF(0)); - my_free(order_by, MYF(MY_ALLOW_ZERO_PTR)); + my_free(order_by); order_by= 0; if (opt_xml) { @@ -5258,7 +5251,7 @@ int main(int argc, char **argv) goto err; #ifdef HAVE_SMEM - my_free(shared_memory_base_name,MYF(MY_ALLOW_ZERO_PTR)); + my_free(shared_memory_base_name); #endif /* No reason to explicitely COMMIT the transaction, neither to explicitely diff --git a/client/mysqlimport.c b/client/mysqlimport.c index 3bf17cb1df7..fdb521b9cf8 100644 --- a/client/mysqlimport.c +++ b/client/mysqlimport.c @@ -230,7 +230,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), if (argument) { char *start=argument; - my_free(opt_password,MYF(MY_ALLOW_ZERO_PTR)); + my_free(opt_password); opt_password=my_strdup(argument,MYF(MY_FAE)); while (*argument) *argument++= 'x'; /* Destroy argument */ if (*start) @@ -684,9 +684,9 @@ int main(int argc, char **argv) exitcode= error; db_disconnect(current_host, mysql); } - my_free(opt_password,MYF(MY_ALLOW_ZERO_PTR)); + my_free(opt_password); #ifdef HAVE_SMEM - my_free(shared_memory_base_name,MYF(MY_ALLOW_ZERO_PTR)); + my_free(shared_memory_base_name); #endif free_defaults(argv_to_free); my_end(my_end_arg); diff --git a/client/mysqlshow.c b/client/mysqlshow.c index d8561d13b81..76f9048e09e 100644 --- a/client/mysqlshow.c +++ b/client/mysqlshow.c @@ -149,10 +149,9 @@ int main(int argc, char **argv) break; } mysql_close(&mysql); /* Close & free connection */ - if (opt_password) - my_free(opt_password,MYF(0)); + my_free(opt_password); #ifdef HAVE_SMEM - my_free(shared_memory_base_name,MYF(MY_ALLOW_ZERO_PTR)); + my_free(shared_memory_base_name); #endif my_end(my_end_arg); exit(error ? 1 : 0); @@ -292,7 +291,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), if (argument) { char *start=argument; - my_free(opt_password,MYF(MY_ALLOW_ZERO_PTR)); + my_free(opt_password); opt_password=my_strdup(argument,MYF(MY_FAE)); while (*argument) *argument++= 'x'; /* Destroy argument */ if (*start) diff --git a/client/mysqlslap.c b/client/mysqlslap.c index 714a8cb9039..e411b096d68 100644 --- a/client/mysqlslap.c +++ b/client/mysqlslap.c @@ -399,10 +399,8 @@ int main(int argc, char **argv) mysql_close(&mysql); /* Close & free connection */ /* now free all the strings we created */ - if (opt_password) - my_free(opt_password, MYF(0)); - - my_free(concurrency, MYF(0)); + my_free(opt_password); + my_free(concurrency); statement_cleanup(create_statements); statement_cleanup(query_statements); @@ -411,8 +409,7 @@ int main(int argc, char **argv) option_cleanup(engine_options); #ifdef HAVE_SMEM - if (shared_memory_base_name) - my_free(shared_memory_base_name, MYF(MY_ALLOW_ZERO_PTR)); + my_free(shared_memory_base_name); #endif free_defaults(defaults_argv); my_end(my_end_arg); @@ -504,7 +501,7 @@ void concurrency_loop(MYSQL *mysql, uint current, option_string *eptr) if (opt_csv_str) print_conclusions_csv(&conclusion); - my_free(head_sptr, MYF(0)); + my_free(head_sptr); } @@ -721,7 +718,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), if (argument) { char *start= argument; - my_free(opt_password, MYF(MY_ALLOW_ZERO_PTR)); + my_free(opt_password); opt_password= my_strdup(argument,MYF(MY_FAE)); while (*argument) *argument++= 'x'; /* Destroy argument */ if (*start) @@ -1367,7 +1364,7 @@ get_options(int *argc,char ***argv) tmp_string[sbuf.st_size]= '\0'; my_close(data_file,MYF(0)); parse_delimiter(tmp_string, &create_statements, delimiter[0]); - my_free(tmp_string, MYF(0)); + my_free(tmp_string); } else if (create_string) { @@ -1396,7 +1393,7 @@ get_options(int *argc,char ***argv) if (user_supplied_query) actual_queries= parse_delimiter(tmp_string, &query_statements, delimiter[0]); - my_free(tmp_string, MYF(0)); + my_free(tmp_string); } else if (user_supplied_query) { @@ -1427,7 +1424,7 @@ get_options(int *argc,char ***argv) if (user_supplied_pre_statements) (void)parse_delimiter(tmp_string, &pre_statements, delimiter[0]); - my_free(tmp_string, MYF(0)); + my_free(tmp_string); } else if (user_supplied_pre_statements) { @@ -1458,7 +1455,7 @@ get_options(int *argc,char ***argv) if (user_supplied_post_statements) (void)parse_delimiter(tmp_string, &post_statements, delimiter[0]); - my_free(tmp_string, MYF(0)); + my_free(tmp_string); } else if (user_supplied_post_statements) { @@ -1555,9 +1552,9 @@ drop_primary_key_list(void) if (primary_keys_number_of) { for (counter= 0; counter < primary_keys_number_of; counter++) - my_free(primary_keys[counter], MYF(0)); + my_free(primary_keys[counter]); - my_free(primary_keys, MYF(0)); + my_free(primary_keys); } return 0; @@ -2154,11 +2151,9 @@ option_cleanup(option_string *stmt) for (ptr= stmt; ptr; ptr= nptr) { nptr= ptr->next; - if (ptr->string) - my_free(ptr->string, MYF(0)); - if (ptr->option) - my_free(ptr->option, MYF(0)); - my_free(ptr, MYF(0)); + my_free(ptr->string); + my_free(ptr->option); + my_free(ptr); } } @@ -2172,9 +2167,8 @@ statement_cleanup(statement *stmt) for (ptr= stmt; ptr; ptr= nptr) { nptr= ptr->next; - if (ptr->string) - my_free(ptr->string, MYF(0)); - my_free(ptr, MYF(0)); + my_free(ptr->string); + my_free(ptr); } } diff --git a/client/mysqltest.cc b/client/mysqltest.cc index 75b23ea9af7..1d821c18111 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -84,10 +84,10 @@ static my_bool get_one_option(int optid, const struct my_option *, C_MODE_END enum { - OPT_SKIP_SAFEMALLOC=OPT_MAX_CLIENT_OPTION, - OPT_PS_PROTOCOL, OPT_SP_PROTOCOL, OPT_CURSOR_PROTOCOL, OPT_VIEW_PROTOCOL, - OPT_MAX_CONNECT_RETRIES, OPT_MAX_CONNECTIONS, OPT_MARK_PROGRESS, - OPT_LOG_DIR, OPT_TAIL_LINES, OPT_RESULT_FORMAT_VERSION + OPT_PS_PROTOCOL=OPT_MAX_CLIENT_OPTION, OPT_SP_PROTOCOL, + OPT_CURSOR_PROTOCOL, OPT_VIEW_PROTOCOL, OPT_MAX_CONNECT_RETRIES, + OPT_MAX_CONNECTIONS, OPT_MARK_PROGRESS, OPT_LOG_DIR, + OPT_TAIL_LINES, OPT_RESULT_FORMAT_VERSION }; static int record= 0, opt_sleep= -1; @@ -156,7 +156,7 @@ static struct st_block *cur_block, *block_stack_end; struct st_test_file { FILE* file; - const char *file_name; + char *file_name; uint lineno; /* Current line in file */ }; @@ -1106,9 +1106,9 @@ void close_connections() mysql_close(&next_con->mysql); if (next_con->util_mysql) mysql_close(next_con->util_mysql); - my_free(next_con->name, MYF(MY_ALLOW_ZERO_PTR)); + my_free(next_con->name); } - my_free(connections, MYF(MY_WME)); + my_free(connections); DBUG_VOID_RETURN; } @@ -1137,7 +1137,7 @@ void close_files() DBUG_PRINT("info", ("closing file: %s", cur_file->file_name)); fclose(cur_file->file); } - my_free((uchar*) cur_file->file_name, MYF(MY_ALLOW_ZERO_PTR)); + my_free(cur_file->file_name); cur_file->file_name= 0; } DBUG_VOID_RETURN; @@ -1157,22 +1157,22 @@ void free_used_memory() for (i= 0 ; i < q_lines.elements ; i++) { struct st_command **q= dynamic_element(&q_lines, i, struct st_command**); - my_free((*q)->query_buf,MYF(MY_ALLOW_ZERO_PTR)); + my_free((*q)->query_buf); if ((*q)->content.str) dynstr_free(&(*q)->content); - my_free((*q),MYF(0)); + my_free((*q)); } for (i= 0; i < 10; i++) { if (var_reg[i].alloced_len) - my_free(var_reg[i].str_val, MYF(MY_WME)); + my_free(var_reg[i].str_val); } while (embedded_server_arg_count > 1) - my_free(embedded_server_args[--embedded_server_arg_count],MYF(0)); + my_free(embedded_server_args[--embedded_server_arg_count]); delete_dynamic(&q_lines); dynstr_free(&ds_res); free_all_replace(); - my_free(opt_pass,MYF(MY_ALLOW_ZERO_PTR)); + my_free(opt_pass); free_defaults(default_argv); free_re(); #ifdef __WIN__ @@ -1933,9 +1933,10 @@ static uchar *get_var_key(const uchar* var, size_t *len, static void var_free(void *v) { - my_free(((VAR*) v)->str_val, MYF(MY_WME)); - if (((VAR*)v)->alloced) - my_free(v, MYF(MY_WME)); + VAR *var= (VAR*) v; + my_free(var->str_val); + if (var->alloced) + my_free(var); } C_MODE_END @@ -4824,7 +4825,7 @@ void do_close_connection(struct st_command *command) con->util_mysql= 0; con->pending= FALSE; - my_free(con->name, MYF(0)); + my_free(con->name); /* When the connection is closed set name to "-closed_connection-" @@ -5491,7 +5492,7 @@ int read_line(char *buf, int size) fclose(cur_file->file); cur_file->file= 0; } - my_free((uchar*) cur_file->file_name, MYF(MY_ALLOW_ZERO_PTR)); + my_free(cur_file->file_name); cur_file->file_name= 0; if (cur_file == file_stack) { @@ -5967,9 +5968,6 @@ static struct my_option my_long_options[] = 0, 0, 0}, {"silent", 's', "Suppress all normal output. Synonym for --quiet.", &silent, &silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"skip-safemalloc", OPT_SKIP_SAFEMALLOC, - "Don't use the memory allocation checking.", 0, 0, 0, GET_NO_ARG, NO_ARG, - 0, 0, 0, 0, 0, 0}, {"sleep", 'T', "Always sleep this many seconds on sleep commands.", &opt_sleep, &opt_sleep, 0, GET_INT, REQUIRED_ARG, -1, -1, 0, 0, 0, 0}, @@ -6125,7 +6123,7 @@ get_one_option(int optid, const struct my_option *, char *argument) argument= (char*) ""; // Don't require password if (argument) { - my_free(opt_pass, MYF(MY_ALLOW_ZERO_PTR)); + my_free(opt_pass); opt_pass= my_strdup(argument, MYF(MY_FAE)); while (*argument) *argument++= 'x'; /* Destroy argument */ tty_password= 0; @@ -6158,11 +6156,6 @@ get_one_option(int optid, const struct my_option *, char *argument) case 'F': read_embedded_server_arguments(argument); break; - case OPT_SKIP_SAFEMALLOC: -#ifdef SAFEMALLOC - sf_malloc_quick=1; -#endif - break; case OPT_RESULT_FORMAT_VERSION: set_result_format_version(opt_result_format_version); break; @@ -6321,7 +6314,7 @@ void init_win_path_patterns() /* Don't insert zero length strings in patterns array */ if (strlen(p) == 0) { - my_free(p, MYF(0)); + my_free(p); continue; } @@ -6345,7 +6338,7 @@ void free_win_path_patterns() for (i=0 ; i < patterns.elements ; i++) { const char** pattern= dynamic_element(&patterns, i, const char**); - my_free((char*) *pattern, MYF(0)); + my_free(*pattern); } delete_dynamic(&patterns); } @@ -6538,12 +6531,12 @@ void append_stmt_result(DYNAMIC_STRING *ds, MYSQL_STMT *stmt, for (i= 0; i < num_fields; i++) { /* Free data for output */ - my_free(my_bind[i].buffer, MYF(MY_WME | MY_FAE)); + my_free(my_bind[i].buffer); } /* Free array with bind structs, lengths and NULL flags */ - my_free(my_bind , MYF(MY_WME | MY_FAE)); - my_free(length , MYF(MY_WME | MY_FAE)); - my_free(is_null , MYF(MY_WME | MY_FAE)); + my_free(my_bind); + my_free(length); + my_free(is_null); } @@ -8489,11 +8482,11 @@ void do_get_replace_column(struct st_command *command) if (!*from) die("Wrong number of arguments to replace_column in '%s'", command->query); to= get_string(&buff, &from, command); - my_free(replace_column[column_number-1], MY_ALLOW_ZERO_PTR); + my_free(replace_column[column_number-1]); replace_column[column_number-1]= my_strdup(to, MYF(MY_WME | MY_FAE)); set_if_bigger(max_replace_column, column_number); } - my_free(start, MYF(0)); + my_free(start); command->last_argument= command->end; DBUG_VOID_RETURN; @@ -8507,7 +8500,7 @@ void free_replace_column() { if (replace_column[i]) { - my_free(replace_column[i], 0); + my_free(replace_column[i]); replace_column[i]= 0; } } @@ -8588,7 +8581,7 @@ void do_get_replace(struct st_command *command) die("Can't initialize replace from '%s'", command->query); free_pointer_array(&from_array); free_pointer_array(&to_array); - my_free(start, MYF(0)); + my_free(start); command->last_argument= command->end; DBUG_VOID_RETURN; } @@ -8597,11 +8590,8 @@ void do_get_replace(struct st_command *command) void free_replace() { DBUG_ENTER("free_replace"); - if (glob_replace) - { - my_free(glob_replace,MYF(0)); - glob_replace=0; - } + my_free(glob_replace); + glob_replace= NULL; DBUG_VOID_RETURN; } @@ -8821,7 +8811,7 @@ struct st_replace_regex* init_replace_regex(char* expr) return res; err: - my_free(res,0); + my_free(res); die("Error parsing replace_regex \"%s\"", expr); return 0; } @@ -8913,9 +8903,9 @@ void free_replace_regex() if (glob_replace_regex) { delete_dynamic(&glob_replace_regex->regex_arr); - my_free(glob_replace_regex->even_buf,MYF(MY_ALLOW_ZERO_PTR)); - my_free(glob_replace_regex->odd_buf,MYF(MY_ALLOW_ZERO_PTR)); - my_free(glob_replace_regex,MYF(0)); + my_free(glob_replace_regex->even_buf); + my_free(glob_replace_regex->odd_buf); + my_free(glob_replace_regex); glob_replace_regex=0; } } @@ -9110,7 +9100,7 @@ int reg_replace(char** buf_p, int* buf_len_p, char *pattern, str_p= str_end; } } - my_free(subs, MYF(0)); + my_free(subs); my_regfree(&r); *res_p= 0; *buf_p= buf; @@ -9242,7 +9232,7 @@ REPLACE *init_replace(char * *from, char * *to,uint count, if (!(follow=(FOLLOWS*) my_malloc((states+2)*sizeof(FOLLOWS),MYF(MY_WME)))) { free_sets(&sets); - my_free(found_set,MYF(0)); + my_free(found_set); DBUG_RETURN(0); } @@ -9437,9 +9427,9 @@ REPLACE *init_replace(char * *from, char * *to,uint count, replace[i].next[j]=(REPLACE*) (rep_str+(-sets.set[i].next[j]-1)); } } - my_free(follow,MYF(0)); + my_free(follow); free_sets(&sets); - my_free(found_set,MYF(0)); + my_free(found_set); DBUG_PRINT("exit",("Replace table has %d states",sets.count)); DBUG_RETURN(replace); } @@ -9455,7 +9445,7 @@ int init_sets(REP_SETS *sets,uint states) if (!(sets->bit_buffer=(uint*) my_malloc(sizeof(uint)*sets->size_of_bits* SET_MALLOC_HUNC,MYF(MY_WME)))) { - my_free(sets->set,MYF(0)); + my_free(sets->set); return 1; } return 0; @@ -9516,8 +9506,8 @@ void free_last_set(REP_SETS *sets) void free_sets(REP_SETS *sets) { - my_free(sets->set_buffer,MYF(0)); - my_free(sets->bit_buffer,MYF(0)); + my_free(sets->set_buffer); + my_free(sets->bit_buffer); return; } @@ -9657,7 +9647,7 @@ int insert_pointer_name(reg1 POINTER_ARRAY *pa,char * name) if (!(pa->str= (uchar*) my_malloc((uint) (PS_MALLOC-MALLOC_OVERHEAD), MYF(MY_WME)))) { - my_free((char*) pa->typelib.type_names,MYF(0)); + my_free(pa->typelib.type_names); DBUG_RETURN (-1); } pa->max_count=(PC_MALLOC-MALLOC_OVERHEAD)/(sizeof(uchar*)+ @@ -9718,9 +9708,9 @@ void free_pointer_array(POINTER_ARRAY *pa) if (pa->typelib.count) { pa->typelib.count=0; - my_free((char*) pa->typelib.type_names,MYF(0)); + my_free(pa->typelib.type_names); pa->typelib.type_names=0; - my_free(pa->str,MYF(0)); + my_free(pa->str); } } /* free_pointer_array */ diff --git a/client/readline.cc b/client/readline.cc index 73ce7c3b8c7..5c1a9951d9b 100644 --- a/client/readline.cc +++ b/client/readline.cc @@ -35,7 +35,7 @@ LINE_BUFFER *batch_readline_init(ulong max_size,FILE *file) return 0; if (init_line_buffer(line_buff,my_fileno(file),IO_SIZE,max_size)) { - my_free(line_buff,MYF(0)); + my_free(line_buff); return 0; } return line_buff; @@ -63,8 +63,8 @@ void batch_readline_end(LINE_BUFFER *line_buff) { if (line_buff) { - my_free(line_buff->buffer,MYF(MY_ALLOW_ZERO_PTR)); - my_free(line_buff,MYF(0)); + my_free(line_buff->buffer); + my_free(line_buff); } } @@ -77,7 +77,7 @@ LINE_BUFFER *batch_readline_command(LINE_BUFFER *line_buff, char * str) return 0; if (init_line_buffer_from_string(line_buff,str)) { - my_free(line_buff,MYF(0)); + my_free(line_buff); return 0; } return line_buff; diff --git a/client/sql_string.h b/client/sql_string.h index 1a3ac5d33c5..bafc287c73e 100644 --- a/client/sql_string.h +++ b/client/sql_string.h @@ -175,7 +175,7 @@ public: { alloced=0; Alloced_length=0; - my_free(Ptr,MYF(0)); + my_free(Ptr); Ptr=0; str_length=0; /* Safety */ } diff --git a/configure.in b/configure.in index 3467d2d852d..4dbf858232a 100644 --- a/configure.in +++ b/configure.in @@ -1902,8 +1902,8 @@ elif test "$with_debug" = "full" then # Full debug. Very slow in some cases AC_DEFINE([DBUG_ON], [1], [Use libdbug]) - CFLAGS="$DEBUG_CFLAGS -DSAFE_MUTEX -DSAFEMALLOC $CFLAGS" - CXXFLAGS="$DEBUG_CXXFLAGS -DSAFE_MUTEX -DSAFEMALLOC $CXXFLAGS" + CFLAGS="$DEBUG_CFLAGS -DSAFE_MUTEX $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS -DSAFE_MUTEX $CXXFLAGS" else # Optimized version. No debug AC_DEFINE([DBUG_OFF], [1], [Don't use libdbug]) diff --git a/dbug/CMakeLists.txt b/dbug/CMakeLists.txt index 16e130fa28a..4cf6dd88cb7 100755 --- a/dbug/CMakeLists.txt +++ b/dbug/CMakeLists.txt @@ -17,6 +17,6 @@ INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/dbug ${CMAKE_SOURCE_DIR}/include ) -SET(DBUG_SOURCES dbug.c sanity.c) +SET(DBUG_SOURCES dbug.c) ADD_CONVENIENCE_LIBRARY(dbug ${DBUG_SOURCES}) TARGET_LINK_LIBRARIES(dbug mysys) diff --git a/dbug/Makefile.am b/dbug/Makefile.am index 4091858a1af..3581b3597ee 100644 --- a/dbug/Makefile.am +++ b/dbug/Makefile.am @@ -19,7 +19,7 @@ INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include LDADD = libdbug.a ../mysys/libmysys.a ../strings/libmystrings.a pkglib_LIBRARIES = libdbug.a noinst_HEADERS = dbug_long.h -libdbug_a_SOURCES = dbug.c sanity.c +libdbug_a_SOURCES = dbug.c EXTRA_DIST = CMakeLists.txt example1.c example2.c example3.c \ user.r monty.doc dbug_add_tags.pl \ my_main.c main.c factorial.c dbug_analyze.c \ diff --git a/dbug/dbug.c b/dbug/dbug.c index 0355d553cff..a4b381f2746 100644 --- a/dbug/dbug.c +++ b/dbug/dbug.c @@ -128,9 +128,8 @@ #define PROFILE_ON (1 << 7) /* Print out profiling code */ #define PID_ON (1 << 8) /* Identify each line with process id */ #define TIMESTAMP_ON (1 << 9) /* timestamp every line of output */ -#define SANITY_CHECK_ON (1 << 10) /* Check safemalloc on DBUG_ENTER */ -#define FLUSH_ON_WRITE (1 << 11) /* Flush on every write */ -#define OPEN_APPEND (1 << 12) /* Open for append */ +#define FLUSH_ON_WRITE (1 << 10) /* Flush on every write */ +#define OPEN_APPEND (1 << 11) /* Open for append */ #define TRACE_ON ((uint)1 << 31) /* Trace enabled. MUST be the highest bit!*/ #define TRACING (cs->stack->flags & TRACE_ON) @@ -184,12 +183,6 @@ static void perror(); /* Fake system/library error print routine */ #endif -#ifdef SAFEMALLOC -IMPORT int _sanity(const char *file,uint line); /* safemalloc sanity checker */ -#else -#define _sanity(X,Y) (1) -#endif - /* * The user may specify a list of functions to trace or * debug. These lists are kept in a linear linked list, @@ -705,12 +698,6 @@ int DbugParse(CODE_STATE *cs, const char *control) else stack->flags |= TIMESTAMP_ON; break; - case 'S': - if (sign < 0) - stack->flags &= ~SANITY_CHECK_ON; - else - stack->flags |= SANITY_CHECK_ON; - break; } if (!*end) break; @@ -1069,7 +1056,6 @@ int _db_explain_ (CODE_STATE *cs, char *buf, size_t len) op_bool_to_buf('r', cs->stack->sub_level != 0); op_intf_to_buf('t', cs->stack->maxdepth, MAXDEPTH, TRACING); op_bool_to_buf('T', cs->stack->flags & TIMESTAMP_ON); - op_bool_to_buf('S', cs->stack->flags & SANITY_CHECK_ON); *buf= '\0'; return 0; @@ -1187,8 +1173,6 @@ void _db_enter_(const char *_func_, const char *_file_, if (!TRACING) break; /* fall through */ case DO_TRACE: - if ((cs->stack->flags & SANITY_CHECK_ON) && _sanity(_file_,_line_)) - cs->stack->flags &= ~SANITY_CHECK_ON; if (TRACING) { if (!cs->locked) @@ -1247,9 +1231,6 @@ void _db_return_(uint _line_, struct _db_stack_frame_ *_stack_frame_) #endif if (DoTrace(cs) & DO_TRACE) { - if ((cs->stack->flags & SANITY_CHECK_ON) && - _sanity(_stack_frame_->file,_line_)) - cs->stack->flags &= ~SANITY_CHECK_ON; if (TRACING) { if (!cs->locked) diff --git a/dbug/sanity.c b/dbug/sanity.c deleted file mode 100644 index df43fc14ba9..00000000000 --- a/dbug/sanity.c +++ /dev/null @@ -1,13 +0,0 @@ -/* Declarate _sanity() if not declared in main program */ - -#include - -extern int _sanity(const char *file,uint line); - -#if defined(SAFEMALLOC) && !defined(MASTER) /* Avoid errors in MySQL */ -int _sanity(const char * file __attribute__((unused)), - uint line __attribute__((unused))) -{ - return 0; -} -#endif diff --git a/dbug/user.r b/dbug/user.r index 847ad80b30f..5628f5a4fa1 100644 --- a/dbug/user.r +++ b/dbug/user.r @@ -1019,14 +1019,6 @@ Most useful with .B DBUG_PUSH macros used to temporarily alter the debugger state. -.LI S -When compiled with -.I safemalloc -this flag forces "sanity" memory checks (for overwrites/underwrites) -on each -.B DBUG_ENTER -and -.B DBUG_RETURN. .LI t[,N] Enable function control flow tracing. The maximum nesting depth is specified by N, and defaults to diff --git a/extra/comp_err.c b/extra/comp_err.c index 53d8c18262b..c85aef7bcc5 100644 --- a/extra/comp_err.c +++ b/extra/comp_err.c @@ -387,15 +387,15 @@ static void clean_up(struct languages *lang_head, struct errors *error_head) struct errors *tmp_error, *next_error; uint count, i; - my_free((uchar*) default_language, MYF(0)); + my_free((void*) default_language); for (tmp_lang= lang_head; tmp_lang; tmp_lang= next_language) { next_language= tmp_lang->next_lang; - my_free(tmp_lang->lang_short_name, MYF(0)); - my_free(tmp_lang->lang_long_name, MYF(0)); - my_free(tmp_lang->charset, MYF(0)); - my_free((uchar*) tmp_lang, MYF(0)); + my_free(tmp_lang->lang_short_name); + my_free(tmp_lang->lang_long_name); + my_free(tmp_lang->charset); + my_free(tmp_lang); } for (tmp_error= error_head; tmp_error; tmp_error= next_error) @@ -406,17 +406,17 @@ static void clean_up(struct languages *lang_head, struct errors *error_head) { struct message *tmp; tmp= dynamic_element(&tmp_error->msg, i, struct message*); - my_free((uchar*) tmp->lang_short_name, MYF(0)); - my_free((uchar*) tmp->text, MYF(0)); + my_free(tmp->lang_short_name); + my_free(tmp->text); } delete_dynamic(&tmp_error->msg); if (tmp_error->sql_code1[0]) - my_free((uchar*) tmp_error->sql_code1, MYF(0)); + my_free((void*) tmp_error->sql_code1); if (tmp_error->sql_code2[0]) - my_free((uchar*) tmp_error->sql_code2, MYF(0)); - my_free((uchar*) tmp_error->er_name, MYF(0)); - my_free((uchar*) tmp_error, MYF(0)); + my_free((void*) tmp_error->sql_code2); + my_free((void*) tmp_error->er_name); + my_free(tmp_error); } } @@ -559,7 +559,7 @@ static uint parse_error_offset(char *str) end= 0; ioffset= (uint) my_strtoll10(soffset, &end, &error); - my_free((uchar*) soffset, MYF(0)); + my_free(soffset); DBUG_RETURN(ioffset); } diff --git a/extra/my_print_defaults.c b/extra/my_print_defaults.c index 9595e1b2df8..81416df2922 100644 --- a/extra/my_print_defaults.c +++ b/extra/my_print_defaults.c @@ -200,7 +200,7 @@ int main(int argc, char **argv) for (argument= arguments+1 ; *argument ; argument++) if (*argument != args_separator) /* skip arguments separator */ puts(*argument); - my_free((char*) load_default_groups,MYF(0)); + my_free(load_default_groups); free_defaults(arguments); exit(0); diff --git a/extra/replace.c b/extra/replace.c index 3f07183807c..1a887ac3e21 100644 --- a/extra/replace.c +++ b/extra/replace.c @@ -262,7 +262,7 @@ static int insert_pointer_name(reg1 POINTER_ARRAY *pa,char * name) if (!(pa->str= (uchar*) my_malloc((uint) (PS_MALLOC-MALLOC_OVERHEAD), MYF(MY_WME)))) { - my_free((uchar*) pa->typelib.type_names,MYF(0)); + my_free(pa->typelib.type_names); DBUG_RETURN (-1); } pa->max_count=(PC_MALLOC-MALLOC_OVERHEAD)/(sizeof(uchar*)+ @@ -324,9 +324,9 @@ static void free_pointer_array(reg1 POINTER_ARRAY *pa) if (pa->typelib.count) { pa->typelib.count=0; - my_free((uchar*) pa->typelib.type_names,MYF(0)); + my_free(pa->typelib.type_names); pa->typelib.type_names=0; - my_free((uchar*) pa->str,MYF(0)); + my_free(pa->str); } return; } /* free_pointer_array */ @@ -441,7 +441,7 @@ static REPLACE *init_replace(char * *from, char * *to,uint count, if (!(follow=(FOLLOWS*) my_malloc((states+2)*sizeof(FOLLOWS),MYF(MY_WME)))) { free_sets(&sets); - my_free((uchar*) found_set,MYF(0)); + my_free(found_set); DBUG_RETURN(0); } @@ -663,9 +663,9 @@ static REPLACE *init_replace(char * *from, char * *to,uint count, replace[i].next[j]=(REPLACE*) (rep_str+(-sets.set[i].next[j]-1)); } } - my_free((uchar*) follow,MYF(0)); + my_free(follow); free_sets(&sets); - my_free((uchar*) found_set,MYF(0)); + my_free(found_set); DBUG_PRINT("exit",("Replace table has %d states",sets.count)); DBUG_RETURN(replace); } @@ -681,7 +681,7 @@ static int init_sets(REP_SETS *sets,uint states) if (!(sets->bit_buffer=(uint*) my_malloc(sizeof(uint)*sets->size_of_bits* SET_MALLOC_HUNC,MYF(MY_WME)))) { - my_free((uchar*) sets->set,MYF(0)); + my_free(sets->set); return 1; } return 0; @@ -742,8 +742,8 @@ static void free_last_set(REP_SETS *sets) static void free_sets(REP_SETS *sets) { - my_free((uchar*)sets->set_buffer,MYF(0)); - my_free((uchar*)sets->bit_buffer,MYF(0)); + my_free(sets->set_buffer); + my_free(sets->bit_buffer); return; } @@ -950,8 +950,8 @@ static void reset_buffer() static void free_buffer() { - my_free(buffer,MYF(MY_WME)); - my_free(out_buff,MYF(MY_WME)); + my_free(buffer); + my_free(out_buff); } diff --git a/include/hash.h b/include/hash.h index 7b4ec1b4685..d390cb7d4e6 100644 --- a/include/hash.h +++ b/include/hash.h @@ -64,14 +64,14 @@ typedef struct st_hash { typedef uint HASH_SEARCH_STATE; #define my_hash_init(A,B,C,D,E,F,G,H) \ - _my_hash_init(A,0,B,C,D,E,F,G,H CALLER_INFO) + _my_hash_init(A,0,B,C,D,E,F,G,H) #define my_hash_init2(A,B,C,D,E,F,G,H,I) \ - _my_hash_init(A,B,C,D,E,F,G,H,I CALLER_INFO) + _my_hash_init(A,B,C,D,E,F,G,H,I) my_bool _my_hash_init(HASH *hash, uint growth_size, CHARSET_INFO *charset, ulong default_array_elements, size_t key_offset, size_t key_length, my_hash_get_key get_key, void (*free_element)(void*), - uint flags CALLER_INFO_PROTO); + uint flags); void my_hash_free(HASH *tree); void my_hash_reset(HASH *hash); uchar *my_hash_element(HASH *hash, ulong idx); @@ -100,7 +100,7 @@ my_bool my_hash_check(HASH *hash); /* Only in debug library */ #define my_hash_clear(H) bzero((char*) (H), sizeof(*(H))) #define my_hash_inited(H) ((H)->blength != 0) #define my_hash_init_opt(A,B,C,D,E,F,G,H) \ - (!my_hash_inited(A) && _my_hash_init(A,0,B,C,D,E,F,G, H CALLER_INFO)) + (!my_hash_inited(A) && _my_hash_init(A,0,B,C,D,E,F,G,H)) #ifdef __cplusplus } diff --git a/include/lf.h b/include/lf.h index 7e8f05f4ada..d1f592d1047 100644 --- a/include/lf.h +++ b/include/lf.h @@ -204,7 +204,7 @@ uint lf_alloc_pool_count(LF_ALLOCATOR *allocator); #define lf_alloc_get_pins(A) lf_pinbox_get_pins(&(A)->pinbox) #define _lf_alloc_put_pins(PINS) _lf_pinbox_put_pins(PINS) #define lf_alloc_put_pins(PINS) lf_pinbox_put_pins(PINS) -#define lf_alloc_direct_free(ALLOC, ADDR) my_free((uchar*)(ADDR), MYF(0)) +#define lf_alloc_direct_free(ALLOC, ADDR) my_free((ADDR)) lock_wrap(lf_alloc_new, void *, (LF_PINS *pins), diff --git a/include/my_global.h b/include/my_global.h index 7b9c34cd724..5e99c579bfd 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -889,11 +889,8 @@ typedef SOCKET_SIZE_TYPE size_socket; How much overhead does malloc have. The code often allocates something like 1024-MALLOC_OVERHEAD bytes */ -#ifdef SAFEMALLOC -#define MALLOC_OVERHEAD (8+24+4) -#else #define MALLOC_OVERHEAD 8 -#endif + /* get memory in huncs */ #define ONCE_ALLOC_INIT (uint) (4096-MALLOC_OVERHEAD) /* Typical record cash */ @@ -1712,11 +1709,6 @@ inline void operator delete[](void*, void*) { /* Do nothing */ } #define min(a, b) ((a) < (b) ? (a) : (b)) #endif -#define x_free(A) \ - do { my_free((uchar*)(A), MYF(MY_WME|MY_FAE|MY_ALLOW_ZERO_PTR)); } while (0) -#define safeFree(X) \ - do { if (X) { my_free((uchar*)(X), MYF(0)); (X) = NULL; } } while (0) - /* Only Linux is known to need an explicit sync of the directory to make sure a file creation/deletion/renaming in(from,to) this directory durable. diff --git a/include/my_list.h b/include/my_list.h index 775b56587b8..ff086e1725b 100644 --- a/include/my_list.h +++ b/include/my_list.h @@ -37,7 +37,7 @@ extern int list_walk(LIST *,list_walk_action action,unsigned char * argument); #define list_rest(a) ((a)->next) #define list_push(a,b) (a)=list_cons((b),(a)) -#define list_pop(A) {LIST *old=(A); (A)=list_delete(old,old) ; my_free((unsigned char *) old,MYF(MY_FAE)); } +#define list_pop(A) {LIST *old=(A); (A)=list_delete(old,old); my_free(old); } #ifdef __cplusplus } diff --git a/include/my_nosys.h b/include/my_nosys.h index df5639b81e2..ecb60333830 100644 --- a/include/my_nosys.h +++ b/include/my_nosys.h @@ -39,7 +39,7 @@ extern size_t my_quick_read(File Filedes,uchar *Buffer,size_t Count, myf myFlags); extern size_t my_quick_write(File Filedes,const uchar *Buffer,size_t Count); -#if !defined(SAFEMALLOC) && defined(USE_HALLOC) +#if defined(USE_HALLOC) #define my_malloc(a,b) halloc(a,1) #define my_no_flags_free(a) hfree(a) #endif diff --git a/include/my_sys.h b/include/my_sys.h index 29c78289a1b..64b20753567 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -158,46 +158,15 @@ extern int NEAR my_errno; /* Last error in mysys */ #define GETDATE_FIXEDLENGTH 16 /* defines when allocating data */ -#ifdef SAFEMALLOC -#define my_malloc(SZ,FLAG) _mymalloc((SZ), __FILE__, __LINE__, FLAG ) -#define my_malloc_ci(SZ,FLAG) _mymalloc((SZ), sFile, uLine, FLAG ) -#define my_realloc(PTR,SZ,FLAG) _myrealloc((PTR), (SZ), __FILE__, __LINE__, FLAG ) -#define my_checkmalloc() _sanity( __FILE__, __LINE__ ) -#define my_free(PTR,FLAG) _myfree((PTR), __FILE__, __LINE__,FLAG) -#define my_memdup(A,B,C) _my_memdup((A),(B), __FILE__,__LINE__,C) -#define my_strdup(A,C) _my_strdup((A), __FILE__,__LINE__,C) -#define my_strndup(A,B,C) _my_strndup((A),(B),__FILE__,__LINE__,C) -#define TRASH(A,B) do { bfill(A, B, 0x8F); MEM_UNDEFINED(A, B); } while (0) -#define QUICK_SAFEMALLOC sf_malloc_quick=1 -#define NORMAL_SAFEMALLOC sf_malloc_quick=0 -extern uint sf_malloc_prehunc,sf_malloc_endhunc,sf_malloc_quick; -extern ulonglong sf_malloc_mem_limit; - -#define CALLER_INFO_PROTO , const char *sFile, uint uLine -#define CALLER_INFO , __FILE__, __LINE__ -#define ORIG_CALLER_INFO , sFile, uLine -#else -#define my_checkmalloc() -#undef TERMINATE -#define TERMINATE(A,B) {} -#define QUICK_SAFEMALLOC -#define NORMAL_SAFEMALLOC extern void *my_malloc(size_t Size,myf MyFlags); -#define my_malloc_ci(SZ,FLAG) my_malloc( SZ, FLAG ) +extern void *my_multi_malloc(myf MyFlags, ...); extern void *my_realloc(void *oldpoint, size_t Size, myf MyFlags); -extern void my_no_flags_free(void *ptr); +extern void my_free(void *ptr); extern void *my_memdup(const void *from,size_t length,myf MyFlags); extern char *my_strdup(const char *from,myf MyFlags); extern char *my_strndup(const char *from, size_t length, myf MyFlags); -/* we do use FG (as a no-op) in below so that a typo on FG is caught */ -#define my_free(PTR,FG) ((void)FG,my_no_flags_free(PTR)) -#define CALLER_INFO_PROTO /* nothing */ -#define CALLER_INFO /* nothing */ -#define ORIG_CALLER_INFO /* nothing */ #define TRASH(A,B) do{MEM_CHECK_ADDRESSABLE(A,B);MEM_UNDEFINED(A,B);} while (0) -#endif - #if defined(ENABLED_DEBUG_SYNC) extern void (*debug_sync_C_callback_ptr)(const char *, size_t); #define DEBUG_SYNC_C(_sync_point_name_) do { \ @@ -211,11 +180,11 @@ extern void (*debug_sync_C_callback_ptr)(const char *, size_t); #ifdef HAVE_LARGE_PAGES extern uint my_get_large_page_size(void); extern uchar * my_large_malloc(size_t size, myf my_flags); -extern void my_large_free(uchar * ptr, myf my_flags); +extern void my_large_free(uchar *ptr); #else #define my_get_large_page_size() (0) #define my_large_malloc(A,B) my_malloc_lock((A),(B)) -#define my_large_free(A,B) my_free_lock((A),(B)) +#define my_large_free(A) my_free_lock((A)) #endif /* HAVE_LARGE_PAGES */ #ifdef HAVE_ALLOCA @@ -233,7 +202,7 @@ extern void my_large_free(uchar * ptr, myf my_flags); #define my_afree(PTR) {} #else #define my_alloca(SZ) my_malloc(SZ,MYF(0)) -#define my_afree(PTR) my_free(PTR,MYF(MY_WME)) +#define my_afree(PTR) my_free(PTR) #endif /* HAVE_ALLOCA */ #ifndef errno /* did we already get it? */ @@ -642,20 +611,6 @@ extern size_t my_fwrite(FILE *stream,const uchar *Buffer,size_t Count, myf MyFlags); extern my_off_t my_fseek(FILE *stream,my_off_t pos,int whence,myf MyFlags); extern my_off_t my_ftell(FILE *stream,myf MyFlags); -extern void *_mymalloc(size_t uSize,const char *sFile, - uint uLine, myf MyFlag); -extern void *_myrealloc(void *pPtr,size_t uSize,const char *sFile, - uint uLine, myf MyFlag); -extern void * my_multi_malloc _VARARGS((myf MyFlags, ...)); -extern void _myfree(void *pPtr,const char *sFile,uint uLine, myf MyFlag); -extern int _sanity(const char *sFile, uint uLine); -extern void *_my_memdup(const void *from, size_t length, - const char *sFile, uint uLine,myf MyFlag); -extern char * _my_strdup(const char *from, const char *sFile, uint uLine, - myf MyFlag); -extern char *_my_strndup(const char *from, size_t length, - const char *sFile, uint uLine, - myf MyFlag); /* implemented in my_memmem.c */ extern void *my_memmem(const void *haystack, size_t haystacklen, @@ -684,9 +639,6 @@ extern HANDLE my_get_osfhandle(File fd); extern void my_osmaperr(unsigned long last_error); #endif -#ifndef TERMINATE -extern void TERMINATE(FILE *file, uint flag); -#endif extern void init_glob_errs(void); extern const char** get_global_errmsgs(); extern void wait_for_free_space(const char *filename, int errors); @@ -835,18 +787,16 @@ extern my_bool real_open_cached_file(IO_CACHE *cache); extern void close_cached_file(IO_CACHE *cache); File create_temp_file(char *to, const char *dir, const char *pfx, int mode, myf MyFlags); -#define my_init_dynamic_array(A,B,C,D) init_dynamic_array2(A,B,NULL,C,D CALLER_INFO) -#define my_init_dynamic_array_ci(A,B,C,D) init_dynamic_array2(A,B,NULL,C,D ORIG_CALLER_INFO) -#define my_init_dynamic_array2(A,B,C,D,E) init_dynamic_array2(A,B,C,D,E CALLER_INFO) -#define my_init_dynamic_array2_ci(A,B,C,D,E) init_dynamic_array2(A,B,C,D,E ORIG_CALLER_INFO) -extern my_bool init_dynamic_array2(DYNAMIC_ARRAY *array,uint element_size, - void *init_buffer, uint init_alloc, - uint alloc_increment - CALLER_INFO_PROTO); +#define my_init_dynamic_array(A,B,C,D) init_dynamic_array2(A,B,NULL,C,D) +#define my_init_dynamic_array_ci(A,B,C,D) init_dynamic_array2(A,B,NULL,C,D) +#define my_init_dynamic_array2(A,B,C,D,E) init_dynamic_array2(A,B,C,D,E) +#define my_init_dynamic_array2_ci(A,B,C,D,E) init_dynamic_array2(A,B,C,D,E) +extern my_bool init_dynamic_array2(DYNAMIC_ARRAY *array, uint element_size, + void *init_buffer, uint init_alloc, + uint alloc_increment); /* init_dynamic_array() function is deprecated */ -extern my_bool init_dynamic_array(DYNAMIC_ARRAY *array,uint element_size, - uint init_alloc,uint alloc_increment - CALLER_INFO_PROTO); +extern my_bool init_dynamic_array(DYNAMIC_ARRAY *array, uint element_size, + uint init_alloc, uint alloc_increment); extern my_bool insert_dynamic(DYNAMIC_ARRAY *array,uchar * element); extern uchar *alloc_dynamic(DYNAMIC_ARRAY *array); extern uchar *pop_dynamic(DYNAMIC_ARRAY*); @@ -876,10 +826,10 @@ extern my_bool dynstr_trunc(DYNAMIC_STRING *str, size_t n); extern void dynstr_free(DYNAMIC_STRING *str); #ifdef HAVE_MLOCK extern void *my_malloc_lock(size_t length,myf flags); -extern void my_free_lock(void *ptr,myf flags); +extern void my_free_lock(void *ptr); #else #define my_malloc_lock(A,B) my_malloc((A),(B)) -#define my_free_lock(A,B) my_free((A),(B)) +#define my_free_lock(A) my_free((A)) #endif #define alloc_root_inited(A) ((A)->min_malloc != 0) #define ALLOC_ROOT_MIN_BLOCK_SIZE (MALLOC_OVERHEAD + sizeof(USED_MEM) + 8) diff --git a/include/mysql/psi/mysql_file.h b/include/mysql/psi/mysql_file.h index 94c8c323621..820979f16ee 100644 --- a/include/mysql/psi/mysql_file.h +++ b/include/mysql/psi/mysql_file.h @@ -800,7 +800,7 @@ inline_mysql_file_fopen( #endif if (unlikely(that->m_file == NULL)) { - my_free(that, MYF(0)); + my_free(that); return NULL; } } @@ -834,7 +834,7 @@ inline_mysql_file_fclose( if (likely(locker != NULL)) PSI_server->end_file_wait(locker, (size_t) 0); #endif - my_free(file, MYF(0)); + my_free(file); } return result; } diff --git a/libmysql/Makefile.am b/libmysql/Makefile.am index b1d23a175d4..8aa1648c834 100644 --- a/libmysql/Makefile.am +++ b/libmysql/Makefile.am @@ -79,7 +79,7 @@ link_sources: # a minimal MySQL client library # # For a really minimal distribution (without debugging code) we could -# keep only the stubs for safemalloc.c and debug.c +# keep only the stubs for debug.c # # A list of needed headers collected from the deps information 000213 nh = my_global.h config-win32.h dbug.h errmsg.h \ diff --git a/libmysql/Makefile.shared b/libmysql/Makefile.shared index 71a4fd867bd..2b413831076 100644 --- a/libmysql/Makefile.shared +++ b/libmysql/Makefile.shared @@ -49,7 +49,7 @@ mystringsobjects = strmov.lo strxmov.lo strxnmov.lo strnmov.lo \ ctype-uca.lo xml.lo my_strtoll10.lo str_alloc.lo dtoa.lo mystringsextra= strto.c -dbugobjects = dbug.lo # IT IS IN SAFEMALLOC.C sanity.lo +dbugobjects = dbug.lo mysysheaders = mysys_priv.h my_static.h vioheaders = vio_priv.h mysysobjects1 = my_init.lo my_static.lo my_malloc.lo my_realloc.lo \ @@ -57,7 +57,7 @@ mysysobjects1 = my_init.lo my_static.lo my_malloc.lo my_realloc.lo \ my_file.lo my_read.lo my_write.lo errors.lo \ my_error.lo my_getwd.lo my_div.lo \ mf_pack.lo my_mess.lo mf_dirname.lo mf_fn_ext.lo\ - mf_wcomp.lo typelib.lo safemalloc.lo my_alloc.lo \ + mf_wcomp.lo typelib.lo my_alloc.lo \ mf_format.lo mf_path.lo mf_unixpath.lo my_fopen.lo \ my_symlink.lo my_fstream.lo mf_arr_appstr.lo \ mf_loadpath.lo my_pthread.lo my_thr_init.lo \ diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 901fa1f0c4c..b69c27731dd 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -341,7 +341,7 @@ mysql_connect(MYSQL *mysql,const char *host, if (!(res=mysql_real_connect(mysql,host,user,passwd,NullS,0,NullS,0))) { if (mysql->free_me) - my_free((uchar*) mysql,MYF(0)); + my_free(mysql); } mysql->reconnect= 1; DBUG_RETURN(res); @@ -457,9 +457,9 @@ my_bool STDCALL mysql_change_user(MYSQL *mysql, const char *user, if (rc == 0) { /* Free old connect information */ - my_free(mysql->user,MYF(MY_ALLOW_ZERO_PTR)); - my_free(mysql->passwd,MYF(MY_ALLOW_ZERO_PTR)); - my_free(mysql->db,MYF(MY_ALLOW_ZERO_PTR)); + my_free(mysql->user); + my_free(mysql->passwd); + my_free(mysql->db); /* alloc new connect information */ mysql->user= my_strdup(user,MYF(MY_WME)); @@ -604,7 +604,7 @@ my_bool handle_local_infile(MYSQL *mysql, const char *net_filename) err: /* free up memory allocated with _init, usually */ (*options->local_infile_end)(li_ptr); - my_free(buf, MYF(0)); + my_free(buf); DBUG_RETURN(result); } @@ -715,7 +715,7 @@ static void default_local_infile_end(void *ptr) { if (data->fd >= 0) my_close(data->fd, MYF(MY_WME)); - my_free(ptr, MYF(MY_WME)); + my_free(ptr); } } @@ -2206,7 +2206,7 @@ int cli_stmt_execute(MYSQL_STMT *stmt) } result= execute(stmt, param_data, length); stmt->send_types_to_server=0; - my_free(param_data, MYF(MY_WME)); + my_free(param_data); DBUG_RETURN(result); } DBUG_RETURN((int) execute(stmt,0,0)); @@ -4707,7 +4707,7 @@ my_bool STDCALL mysql_stmt_close(MYSQL_STMT *stmt) } } - my_free((uchar*) stmt, MYF(MY_WME)); + my_free(stmt); DBUG_RETURN(test(rc)); } diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index b36a97759d2..b8d855fcd45 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -76,7 +76,7 @@ void embedded_get_error(MYSQL *mysql, MYSQL_DATA *data) strmake(net->last_error, ei->info, sizeof(net->last_error)-1); memcpy(net->sqlstate, ei->sqlstate, sizeof(net->sqlstate)); mysql->server_status= ei->server_status; - my_free(data, MYF(0)); + my_free(data); } static my_bool @@ -207,7 +207,7 @@ static MYSQL_FIELD *emb_list_fields(MYSQL *mysql) res= ((THD*) mysql->thd)->cur_data; ((THD*) mysql->thd)->cur_data= 0; mysql->field_alloc= res->alloc; - my_free(res,MYF(0)); + my_free(res); mysql->status= MYSQL_STATUS_READY; return mysql->fields; } @@ -236,7 +236,7 @@ static my_bool emb_read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt) stmt->fields= mysql->fields; stmt->mem_root= res->alloc; mysql->fields= NULL; - my_free(res,MYF(0)); + my_free(res); } return 0; @@ -293,7 +293,7 @@ static my_bool emb_read_query_result(MYSQL *mysql) thd->cur_data= res; } else - my_free(res, MYF(0)); + my_free(res); return 0; } @@ -335,7 +335,7 @@ int emb_read_binary_rows(MYSQL_STMT *stmt) return 1; } stmt->result= *data; - my_free((char *) data, MYF(0)); + my_free(data); set_stmt_errmsg(stmt, &stmt->mysql->net); return 0; } @@ -590,7 +590,7 @@ int init_embedded_server(int argc, char **argv, char **groups) void end_embedded_server() { - my_free((char*) copy_arguments_ptr, MYF(MY_ALLOW_ZERO_PTR)); + my_free(copy_arguments_ptr); copy_arguments_ptr=0; clean_up(0); } diff --git a/libmysqld/libmysqld.c b/libmysqld/libmysqld.c index 8f7503c9d6c..758b803dbd4 100644 --- a/libmysqld/libmysqld.c +++ b/libmysqld/libmysqld.c @@ -119,8 +119,8 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user, (mysql->options.my_cnf_file ? mysql->options.my_cnf_file : "my"), mysql->options.my_cnf_group); - my_free(mysql->options.my_cnf_file,MYF(MY_ALLOW_ZERO_PTR)); - my_free(mysql->options.my_cnf_group,MYF(MY_ALLOW_ZERO_PTR)); + my_free(mysql->options.my_cnf_file); + my_free(mysql->options.my_cnf_group); mysql->options.my_cnf_file=mysql->options.my_cnf_group=0; } diff --git a/mysql-test/include/mysqld--help.inc b/mysql-test/include/mysqld--help.inc index f21f8b20aa4..3c50e50ac0e 100644 --- a/mysql-test/include/mysqld--help.inc +++ b/mysql-test/include/mysqld--help.inc @@ -13,7 +13,7 @@ perl; @skipvars=qw/basedir open-files-limit general-log-file log plugin-dir log-slow-queries pid-file slow-query-log-file datadir slave-load-tmpdir tmpdir/; - @plugins=qw/innodb ndb archive blackhole federated partition ndbcluster safemalloc debug temp-pool ssl des-key-file + @plugins=qw/innodb ndb archive blackhole federated partition ndbcluster debug temp-pool ssl des-key-file thread-concurrency super-large-pages mutex-deadlock-detector null-audit/; @env=qw/MYSQLTEST_VARDIR MYSQL_TEST_DIR MYSQL_LIBDIR MYSQL_CHARSETSDIR MYSQL_SHAREDIR /; $re1=join('|', @skipvars, @plugins); diff --git a/mysql-test/lib/v1/mtr_report.pl b/mysql-test/lib/v1/mtr_report.pl index 36aba983c34..84784ed19d4 100644 --- a/mysql-test/lib/v1/mtr_report.pl +++ b/mysql-test/lib/v1/mtr_report.pl @@ -253,19 +253,8 @@ sub mtr_report_stats ($) { mtr_warning("can't read $errlog"); next; } - my $leak_reports_expected= undef; while ( ) { - # There is a test case that purposely provokes a - # SAFEMALLOC leak report, even though there is no actual - # leak. We need to detect this, and ignore the warning in - # that case. - if (/Begin safemalloc memory dump:/) { - $leak_reports_expected= 1; - } elsif (/End safemalloc memory dump./) { - $leak_reports_expected= undef; - } - # Skip some non fatal warnings from the log files if ( /\"SELECT UNIX_TIMESTAMP\(\)\" failed on master/ or @@ -426,9 +415,6 @@ sub mtr_report_stats ($) { } if ( /$pattern/ ) { - if ($leak_reports_expected) { - next; - } $found_problems= 1; print WARN basename($errlog) . ": $testname: $_"; } diff --git a/mysql-test/lib/v1/mysql-test-run.pl b/mysql-test/lib/v1/mysql-test-run.pl index 64d7376605e..8a5edfbd762 100755 --- a/mysql-test/lib/v1/mysql-test-run.pl +++ b/mysql-test/lib/v1/mysql-test-run.pl @@ -3882,8 +3882,6 @@ sub mysqld_arguments ($$$$) { if ( $opt_valgrind_mysqld ) { - mtr_add_arg($args, "%s--loose-skip-safemalloc", $prefix); - if ( $mysql_version_id < 50100 ) { mtr_add_arg($args, "%s--skip-bdb", $prefix); @@ -4722,7 +4720,6 @@ sub run_check_testcase ($$) { mtr_add_arg($args, "--no-defaults"); mtr_add_arg($args, "--silent"); - mtr_add_arg($args, "--skip-safemalloc"); mtr_add_arg($args, "--tmpdir=%s", $opt_tmpdir); mtr_add_arg($args, "--character-sets-dir=%s", $path_charsetsdir); @@ -4805,7 +4802,6 @@ sub run_mysqltest ($) { mtr_add_arg($args, "--no-defaults"); mtr_add_arg($args, "--silent"); - mtr_add_arg($args, "--skip-safemalloc"); mtr_add_arg($args, "--tmpdir=%s", $opt_tmpdir); mtr_add_arg($args, "--character-sets-dir=%s", $path_charsetsdir); mtr_add_arg($args, "--logdir=%s/log", $opt_vardir); diff --git a/mysql-test/mysql-stress-test.pl b/mysql-test/mysql-stress-test.pl index e51eba04525..504bee1ebbc 100755 --- a/mysql-test/mysql-stress-test.pl +++ b/mysql-test/mysql-stress-test.pl @@ -123,7 +123,7 @@ $pid_file="mysql_stress_test.pid"; $opt_mysqltest= ($^O =~ /mswin32/i) ? "mysqltest.exe" : "mysqltest"; $opt_check_tests_file=""; # OBM adding a setting for 'max-connect-retries=20' the default of 500 is to high -@mysqltest_args=("--silent", "-v", "--skip-safemalloc", "--max-connect-retries=20"); +@mysqltest_args=("--silent", "-v", "--max-connect-retries=20"); # Client ip address $client_ip=inet_ntoa((gethostbyname(hostname()))[4]); diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index c5cc3c5c295..1a574fe6e6b 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -3180,7 +3180,6 @@ sub start_run_one ($$) { mtr_add_arg($args, "--defaults-group-suffix=%s", $mysqld->after('mysqld')); mtr_add_arg($args, "--silent"); - mtr_add_arg($args, "--skip-safemalloc"); mtr_add_arg($args, "--test-file=%s", "include/$run.test"); my $errfile= "$opt_vardir/tmp/$name.err"; @@ -3759,25 +3758,6 @@ sub extract_server_log ($$) { } $Ferr = undef; # Close error log file - # mysql_client_test.test sends a COM_DEBUG packet to the server - # to provoke a SAFEMALLOC leak report, ignore any warnings - # between "Begin/end safemalloc memory dump" - if ( grep(/Begin safemalloc memory dump:/, @lines) > 0) - { - my $discard_lines= 1; - foreach my $line ( @lines ) - { - if ($line =~ /Begin safemalloc memory dump:/){ - $discard_lines = 1; - } elsif ($line =~ /End safemalloc memory dump./){ - $discard_lines = 0; - } - - if ($discard_lines){ - $line = "ignored"; - } - } - } return @lines; } @@ -3873,8 +3853,6 @@ sub start_check_warnings ($$) { mtr_add_arg($args, "--defaults-file=%s", $path_config_file); mtr_add_arg($args, "--defaults-group-suffix=%s", $mysqld->after('mysqld')); - - mtr_add_arg($args, "--loose-skip-safemalloc"); mtr_add_arg($args, "--test-file=%s", "include/check-warnings.test"); if ( $opt_embedded_server ) @@ -4305,8 +4283,6 @@ sub mysqld_arguments ($$$) { if ( $opt_valgrind_mysqld ) { - mtr_add_arg($args, "--loose-skip-safemalloc"); - if ( $mysql_version_id < 50100 ) { mtr_add_arg($args, "--skip-bdb"); @@ -4899,9 +4875,6 @@ sub start_check_testcase ($$$) { mtr_add_arg($args, "--defaults-file=%s", $path_config_file); mtr_add_arg($args, "--defaults-group-suffix=%s", $mysqld->after('mysqld')); - - mtr_add_arg($args, "--skip-safemalloc"); - mtr_add_arg($args, "--result-file=%s", "$opt_vardir/tmp/$name.result"); mtr_add_arg($args, "--test-file=%s", "include/check-testcase.test"); mtr_add_arg($args, "--verbose"); @@ -4942,7 +4915,6 @@ sub start_mysqltest ($) { mtr_add_arg($args, "--defaults-file=%s", $path_config_file); mtr_add_arg($args, "--silent"); - mtr_add_arg($args, "--skip-safemalloc"); mtr_add_arg($args, "--tmpdir=%s", $opt_tmpdir); mtr_add_arg($args, "--character-sets-dir=%s", $path_charsetsdir); mtr_add_arg($args, "--logdir=%s/log", $opt_vardir); diff --git a/mysql-test/t/bug46080-master.opt b/mysql-test/t/bug46080-master.opt index 71024d39356..1be97e178ed 100644 --- a/mysql-test/t/bug46080-master.opt +++ b/mysql-test/t/bug46080-master.opt @@ -1 +1 @@ ---loose-performance-schema=0 --skip-grant-tables --skip-name-resolve --loose-safemalloc-mem-limit=4000000 +--loose-performance-schema=0 --skip-grant-tables --skip-name-resolve diff --git a/mysql-test/t/mysql-bug45236-master.opt b/mysql-test/t/mysql-bug45236-master.opt deleted file mode 100644 index fc1887bca47..00000000000 --- a/mysql-test/t/mysql-bug45236-master.opt +++ /dev/null @@ -1 +0,0 @@ ---loose-skip-safemalloc diff --git a/mysys/CMakeLists.txt b/mysys/CMakeLists.txt index 0ea65ce8e4b..83615c82e2a 100755 --- a/mysys/CMakeLists.txt +++ b/mysys/CMakeLists.txt @@ -29,10 +29,10 @@ SET(MYSYS_SOURCES array.c charset-def.c charset.c checksum.c default.c default_ my_gethwaddr.c my_getopt.c my_getsystime.c my_getwd.c my_handler.c my_init.c my_lib.c my_lock.c my_lockmem.c my_malloc.c my_mess.c my_mkdir.c my_mmap.c my_net.c my_once.c my_open.c my_pread.c my_pthread.c - my_quick.c my_read.c my_realloc.c my_redel.c my_rename.c my_seek.c my_sleep.c + my_quick.c my_read.c my_redel.c my_rename.c my_seek.c my_sleep.c my_static.c my_symlink.c my_symlink2.c my_sync.c my_thr_init.c my_write.c ptr_cmp.c queues.c stacktrace.c - rijndael.c safemalloc.c sha1.c string.c thr_alarm.c thr_lock.c thr_mutex.c + rijndael.c sha1.c string.c thr_alarm.c thr_lock.c thr_mutex.c thr_rwlock.c tree.c typelib.c my_vle.c base64.c my_memmem.c my_getpagesize.c lf_alloc-pin.c lf_dynarray.c lf_hash.c my_atomic.c my_getncpus.c diff --git a/mysys/Makefile.am b/mysys/Makefile.am index d5bffd874b2..f4fab89d5a5 100644 --- a/mysys/Makefile.am +++ b/mysys/Makefile.am @@ -29,9 +29,8 @@ libmysys_a_SOURCES = my_init.c my_getwd.c mf_getdate.c my_mmap.c \ mf_keycaches.c my_crc32.c \ mf_iocache.c mf_iocache2.c mf_cache.c mf_tempfile.c \ mf_tempdir.c my_lock.c mf_brkhant.c my_alarm.c \ - my_malloc.c my_realloc.c my_once.c mulalloc.c \ - my_alloc.c safemalloc.c my_new.cc \ - my_vle.c my_atomic.c lf_hash.c \ + my_malloc.c my_once.c mulalloc.c \ + my_alloc.c my_new.cc my_vle.c my_atomic.c lf_hash.c \ lf_dynarray.c lf_alloc-pin.c \ my_fopen.c my_fstream.c my_getsystime.c \ my_error.c errors.c my_div.c my_mess.c \ diff --git a/mysys/array.c b/mysys/array.c index a1c49c2589d..70c7a59aa3a 100644 --- a/mysys/array.c +++ b/mysys/array.c @@ -42,7 +42,7 @@ my_bool init_dynamic_array2(DYNAMIC_ARRAY *array, uint element_size, void *init_buffer, uint init_alloc, - uint alloc_increment CALLER_INFO_PROTO) + uint alloc_increment) { DBUG_ENTER("init_dynamic_array"); if (!alloc_increment) @@ -67,14 +67,13 @@ my_bool init_dynamic_array2(DYNAMIC_ARRAY *array, uint element_size, Since the dynamic array is usable even if allocation fails here malloc should not throw an error */ - if (!(array->buffer= (uchar*) my_malloc_ci(element_size*init_alloc, MYF(0)))) + if (!(array->buffer= (uchar*) my_malloc(element_size*init_alloc, MYF(0)))) array->max_element=0; DBUG_RETURN(FALSE); } my_bool init_dynamic_array(DYNAMIC_ARRAY *array, uint element_size, - uint init_alloc, - uint alloc_increment CALLER_INFO_PROTO) + uint init_alloc, uint alloc_increment) { /* placeholder to preserve ABI */ return my_init_dynamic_array_ci(array, element_size, init_alloc, @@ -306,7 +305,7 @@ void delete_dynamic(DYNAMIC_ARRAY *array) else if (array->buffer) { - my_free(array->buffer,MYF(MY_WME)); + my_free(array->buffer); array->buffer=0; array->elements=array->max_element=0; } diff --git a/mysys/charset.c b/mysys/charset.c index 9f9d18e31a4..167d6b8ff6e 100644 --- a/mysys/charset.c +++ b/mysys/charset.c @@ -383,11 +383,11 @@ static my_bool my_read_charset_file(const char *filename, myf myflags) #endif } - my_free(buf, myflags); + my_free(buf); return FALSE; error: - my_free(buf, myflags); + my_free(buf); return TRUE; } diff --git a/mysys/default_modify.c b/mysys/default_modify.c index b214a1df445..edf4907cd4b 100644 --- a/mysys/default_modify.c +++ b/mysys/default_modify.c @@ -223,11 +223,11 @@ int modify_defaults_file(const char *file_location, const char *option, if (my_fclose(cnf_file, MYF(MY_WME))) DBUG_RETURN(1); - my_free(file_buffer, MYF(0)); + my_free(file_buffer); DBUG_RETURN(0); err: - my_free(file_buffer, MYF(0)); + my_free(file_buffer); malloc_err: my_fclose(cnf_file, MYF(0)); DBUG_RETURN(1); /* out of resources */ diff --git a/mysys/hash.c b/mysys/hash.c index 39f3ad8d31e..f54ac1a4abb 100644 --- a/mysys/hash.c +++ b/mysys/hash.c @@ -67,8 +67,6 @@ static my_hash_value_type calc_hash(const HASH *hash, @param[in] get_key get the key for the hash @param[in] free_element pointer to the function that does cleanup - @param[in] CALLER_INFO_PROTO flag that define the behaviour - of the hash @return inidicates success or failure of initialization @retval 0 success @retval 1 failure @@ -77,7 +75,7 @@ my_bool _my_hash_init(HASH *hash, uint growth_size, CHARSET_INFO *charset, ulong size, size_t key_offset, size_t key_length, my_hash_get_key get_key, - void (*free_element)(void*), uint flags CALLER_INFO_PROTO) + void (*free_element)(void*), uint flags) { DBUG_ENTER("my_hash_init"); DBUG_PRINT("enter",("hash: 0x%lx size: %u", (long) hash, (uint) size)); diff --git a/mysys/lf_alloc-pin.c b/mysys/lf_alloc-pin.c index 7fd10703871..c264d3ac4c5 100644 --- a/mysys/lf_alloc-pin.c +++ b/mysys/lf_alloc-pin.c @@ -472,7 +472,7 @@ void lf_alloc_destroy(LF_ALLOCATOR *allocator) uchar *tmp= anext_node(node); if (allocator->destructor) allocator->destructor(node); - my_free((void *)node, MYF(0)); + my_free(node); node= tmp; } lf_pinbox_destroy(&allocator->pinbox); diff --git a/mysys/lf_dynarray.c b/mysys/lf_dynarray.c index b1cdce698a9..0941c8762bb 100644 --- a/mysys/lf_dynarray.c +++ b/mysys/lf_dynarray.c @@ -57,10 +57,10 @@ static void recursive_free(void **alloc, int level) int i; for (i= 0; i < LF_DYNARRAY_LEVEL_LENGTH; i++) recursive_free(alloc[i], level-1); - my_free((void *)alloc, MYF(0)); + my_free(alloc); } else - my_free(alloc[-1], MYF(0)); + my_free(alloc[-1]); } void lf_dynarray_destroy(LF_DYNARRAY *array) @@ -115,7 +115,7 @@ void *_lf_dynarray_lvalue(LF_DYNARRAY *array, uint idx) if (my_atomic_casptr(ptr_ptr, &ptr, alloc)) ptr= alloc; else - my_free(alloc, MYF(0)); + my_free(alloc); } ptr_ptr= ((void **)ptr) + idx / dynarray_idxes_in_prev_level[i]; idx%= dynarray_idxes_in_prev_level[i]; @@ -139,7 +139,7 @@ void *_lf_dynarray_lvalue(LF_DYNARRAY *array, uint idx) if (my_atomic_casptr(ptr_ptr, &ptr, data)) ptr= data; else - my_free(alloc, MYF(0)); + my_free(alloc); } return ((uchar*)ptr) + array->size_of_element * idx; } diff --git a/mysys/lf_hash.c b/mysys/lf_hash.c index f478196c7c8..9c51ff1766e 100644 --- a/mysys/lf_hash.c +++ b/mysys/lf_hash.c @@ -344,7 +344,7 @@ void lf_hash_destroy(LF_HASH *hash) if (el->hashnr & 1) lf_alloc_direct_free(&hash->alloc, el); /* normal node */ else - my_free((void *)el, MYF(0)); /* dummy node */ + my_free(el); /* dummy node */ el= (LF_SLIST *)next; } lf_alloc_destroy(&hash->alloc); @@ -489,7 +489,7 @@ static int initialize_bucket(LF_HASH *hash, LF_SLIST * volatile *node, dummy->keylen= 0; if ((cur= linsert(el, hash->charset, dummy, pins, LF_HASH_UNIQUE))) { - my_free((void *)dummy, MYF(0)); + my_free(dummy); dummy= cur; } my_atomic_casptr((void **)node, (void **)&tmp, dummy); diff --git a/mysys/list.c b/mysys/list.c index aaadd686365..e68fbf519d1 100644 --- a/mysys/list.c +++ b/mysys/list.c @@ -61,8 +61,8 @@ void list_free(LIST *root, uint free_data) { next=root->next; if (free_data) - my_free((uchar*) root->data,MYF(0)); - my_free((uchar*) root,MYF(0)); + my_free(root->data); + my_free(root); root=next; } } diff --git a/mysys/mf_cache.c b/mysys/mf_cache.c index f0df0f3fa77..691532c0d80 100644 --- a/mysys/mf_cache.c +++ b/mysys/mf_cache.c @@ -71,8 +71,8 @@ my_bool open_cached_file(IO_CACHE *cache, const char* dir, const char *prefix, { DBUG_RETURN(0); } - my_free(cache->dir, MYF(MY_ALLOW_ZERO_PTR)); - my_free(cache->prefix,MYF(MY_ALLOW_ZERO_PTR)); + my_free(cache->dir); + my_free(cache->prefix); DBUG_RETURN(1); } @@ -110,12 +110,12 @@ void close_cached_file(IO_CACHE *cache) if (cache->file_name) { (void) my_delete(cache->file_name,MYF(MY_WME | ME_NOINPUT)); - my_free(cache->file_name,MYF(0)); + my_free(cache->file_name); } #endif } - my_free(cache->dir,MYF(MY_ALLOW_ZERO_PTR)); - my_free(cache->prefix,MYF(MY_ALLOW_ZERO_PTR)); + my_free(cache->dir); + my_free(cache->prefix); } DBUG_VOID_RETURN; } diff --git a/mysys/mf_iocache.c b/mysys/mf_iocache.c index 620ac667a8b..daacc08044b 100644 --- a/mysys/mf_iocache.c +++ b/mysys/mf_iocache.c @@ -1831,7 +1831,7 @@ int end_io_cache(IO_CACHE *info) info->alloced_buffer=0; if (info->file != -1) /* File doesn't exist */ error= my_b_flush_io_cache(info,1); - my_free((uchar*) info->buffer,MYF(MY_WME)); + my_free(info->buffer); info->buffer=info->read_pos=(uchar*) 0; } if (info->type == SEQ_READ_APPEND) @@ -1917,7 +1917,7 @@ int main(int argc, char** argv) total_bytes += 4+block_size; } close_file(&sra_cache); - my_free(block,MYF(MY_WME)); + my_free(block); if (!my_stat(fname,&status,MYF(MY_WME))) die("%s failed to stat, but I had just closed it,\ wonder how that happened"); diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c index 9cbe3a21bce..5d0808933e3 100644 --- a/mysys/mf_keycache.c +++ b/mysys/mf_keycache.c @@ -446,7 +446,7 @@ int init_key_cache(KEY_CACHE *keycache, uint key_cache_block_size, if ((keycache->block_root= (BLOCK_LINK*) my_malloc(length, MYF(0)))) break; - my_large_free(keycache->block_mem, MYF(0)); + my_large_free(keycache->block_mem); keycache->block_mem= 0; } if (blocks < 8) @@ -521,12 +521,12 @@ err: keycache->blocks= 0; if (keycache->block_mem) { - my_large_free((uchar*) keycache->block_mem, MYF(0)); + my_large_free((uchar*) keycache->block_mem); keycache->block_mem= NULL; } if (keycache->block_root) { - my_free((uchar*) keycache->block_root, MYF(0)); + my_free(keycache->block_root); keycache->block_root= NULL; } my_errno= error; @@ -747,9 +747,9 @@ void end_key_cache(KEY_CACHE *keycache, my_bool cleanup) { if (keycache->block_mem) { - my_large_free((uchar*) keycache->block_mem, MYF(0)); + my_large_free((uchar*) keycache->block_mem); keycache->block_mem= NULL; - my_free((uchar*) keycache->block_root, MYF(0)); + my_free(keycache->block_root); keycache->block_root= NULL; } keycache->disk_blocks= -1; @@ -4080,7 +4080,7 @@ restart: #endif err: if (cache != cache_buff) - my_free((uchar*) cache, MYF(0)); + my_free(cache); if (last_errno) errno=last_errno; /* Return first error */ DBUG_RETURN(last_errno != 0); diff --git a/mysys/mf_keycaches.c b/mysys/mf_keycaches.c index 999e8cc7975..ee4ad025b0b 100644 --- a/mysys/mf_keycaches.c +++ b/mysys/mf_keycaches.c @@ -71,7 +71,7 @@ typedef struct st_safe_hash_with_default static void safe_hash_entry_free(SAFE_HASH_ENTRY *entry) { DBUG_ENTER("free_assign_entry"); - my_free((uchar*) entry, MYF(0)); + my_free(entry); DBUG_VOID_RETURN; } @@ -234,7 +234,7 @@ static my_bool safe_hash_set(SAFE_HASH *hash, const uchar *key, uint length, if (my_hash_insert(&hash->hash, (uchar*) entry)) { /* This can only happen if hash got out of memory */ - my_free((char*) entry, MYF(0)); + my_free(entry); error= 1; goto end; } diff --git a/mysys/mf_sort.c b/mysys/mf_sort.c index 686ebbc1d14..a3e7465ead0 100644 --- a/mysys/mf_sort.c +++ b/mysys/mf_sort.c @@ -27,7 +27,7 @@ void my_string_ptr_sort(uchar *base, uint items, size_t size) (ptr= (uchar**) my_malloc(items*sizeof(char*),MYF(0)))) { radixsort_for_str_ptr((uchar**) base,items,size,ptr); - my_free((uchar*) ptr,MYF(0)); + my_free(ptr); } else #endif diff --git a/mysys/mf_tempdir.c b/mysys/mf_tempdir.c index 5633182ab3a..1c6c01cef9f 100644 --- a/mysys/mf_tempdir.c +++ b/mysys/mf_tempdir.c @@ -88,7 +88,7 @@ void free_tmpdir(MY_TMPDIR *tmpdir) if (!tmpdir->full_list.elements) return; for (i=0; i<=tmpdir->max; i++) - my_free(tmpdir->list[i], MYF(0)); + my_free(tmpdir->list[i]); delete_dynamic(&tmpdir->full_list); mysql_mutex_destroy(&tmpdir->mutex); } diff --git a/mysys/mf_wfile.c b/mysys/mf_wfile.c index 4a4fb466600..95c4c006b2c 100644 --- a/mysys/mf_wfile.c +++ b/mysys/mf_wfile.c @@ -118,7 +118,6 @@ found: void wf_end(WF_PACK *buffer) { DBUG_ENTER("wf_end"); - if (buffer) - my_free(buffer, MYF(0)); + my_free(buffer); DBUG_VOID_RETURN; } /* wf_end */ diff --git a/mysys/my_alloc.c b/mysys/my_alloc.c index 19e51880209..903826dd975 100644 --- a/mysys/my_alloc.c +++ b/mysys/my_alloc.c @@ -120,7 +120,7 @@ void reset_root_defaults(MEM_ROOT *mem_root, size_t block_size, { /* remove block from the list and free it */ *prev= mem->next; - my_free(mem, MYF(0)); + my_free(mem); } else prev= &mem->next; @@ -362,13 +362,13 @@ void free_root(MEM_ROOT *root, myf MyFlags) { old=next; next= next->next ; if (old != root->pre_alloc) - my_free(old,MYF(0)); + my_free(old); } for (next=root->free ; next ;) { old=next; next= next->next; if (old != root->pre_alloc) - my_free(old,MYF(0)); + my_free(old); } root->used=root->free=0; if (root->pre_alloc) diff --git a/mysys/my_bitmap.c b/mysys/my_bitmap.c index 91370bd3727..25d2f3fda30 100644 --- a/mysys/my_bitmap.c +++ b/mysys/my_bitmap.c @@ -150,7 +150,7 @@ void bitmap_free(MY_BITMAP *map) if (map->mutex) mysql_mutex_destroy(map->mutex); #endif - my_free((char*) map->bitmap, MYF(0)); + my_free(map->bitmap); map->bitmap=0; } DBUG_VOID_RETURN; diff --git a/mysys/my_compress.c b/mysys/my_compress.c index a3d9d56915e..360390d376a 100644 --- a/mysys/my_compress.c +++ b/mysys/my_compress.c @@ -51,7 +51,7 @@ my_bool my_compress(uchar *packet, size_t *len, size_t *complen) if (!compbuf) DBUG_RETURN(*complen ? 0 : 1); memcpy(packet,compbuf,*len); - my_free(compbuf,MYF(MY_WME)); + my_free(compbuf); } DBUG_RETURN(0); } @@ -73,14 +73,14 @@ uchar *my_compress_alloc(const uchar *packet, size_t *len, size_t *complen) if (res != Z_OK) { - my_free(compbuf, MYF(MY_WME)); + my_free(compbuf); return 0; } if (*complen >= *len) { *complen= 0; - my_free(compbuf, MYF(MY_WME)); + my_free(compbuf); DBUG_PRINT("note",("Packet got longer on compression; Not compressed")); return 0; } @@ -125,11 +125,11 @@ my_bool my_uncompress(uchar *packet, size_t len, size_t *complen) if (error != Z_OK) { /* Probably wrong packet */ DBUG_PRINT("error",("Can't uncompress packet, error: %d",error)); - my_free(compbuf, MYF(MY_WME)); + my_free(compbuf); DBUG_RETURN(1); } memcpy(packet, compbuf, *complen); - my_free(compbuf, MYF(MY_WME)); + my_free(compbuf); } else *complen= len; @@ -250,7 +250,7 @@ int unpackfrm(uchar **unpack_data, size_t *unpack_len, if (my_uncompress(data, complen, &orglen)) { - my_free(data, MYF(0)); + my_free(data); DBUG_RETURN(3); } diff --git a/mysys/my_error.c b/mysys/my_error.c index e2523a39d0b..fa62cc604b6 100644 --- a/mysys/my_error.c +++ b/mysys/my_error.c @@ -211,7 +211,7 @@ int my_error_register(const char** (*get_errmsgs) (), int first, int last) /* Error numbers must be unique. No overlapping is allowed. */ if (*search_meh_pp && ((*search_meh_pp)->meh_first <= last)) { - my_free((uchar*)meh_p, MYF(0)); + my_free(meh_p); return 1; } @@ -267,7 +267,7 @@ const char **my_error_unregister(int first, int last) /* Save the return value and free the header. */ errmsgs= meh_p->get_errmsgs(); - my_free((uchar*) meh_p, MYF(0)); + my_free(meh_p); return errmsgs; } @@ -282,7 +282,7 @@ void my_error_unregister_all(void) /* We need this ptr, but we're about to free its container, so save it. */ saved_next= cursor->meh_next; - my_free((uchar*) cursor, MYF(0)); + my_free(cursor); } my_errmsgs_globerrs.meh_next= NULL; /* Freed in first iteration above. */ diff --git a/mysys/my_file.c b/mysys/my_file.c index a31673b31bc..e4b7cd7779f 100644 --- a/mysys/my_file.c +++ b/mysys/my_file.c @@ -127,7 +127,7 @@ void my_free_open_file_info() /* Copy data back for my_print_open_files */ memcpy((char*) my_file_info_default, my_file_info, sizeof(*my_file_info_default)* MY_NFILE); - my_free((char*) my_file_info, MYF(0)); + my_free(my_file_info); my_file_info= my_file_info_default; my_file_limit= MY_NFILE; } diff --git a/mysys/my_fopen.c b/mysys/my_fopen.c index 3f2bc08df65..861e4380690 100644 --- a/mysys/my_fopen.c +++ b/mysys/my_fopen.c @@ -117,7 +117,7 @@ int my_fclose(FILE *fd, myf MyFlags) if ((uint) file < my_file_limit && my_file_info[file].type != UNOPEN) { my_file_info[file].type = UNOPEN; - my_free(my_file_info[file].name, MYF(MY_ALLOW_ZERO_PTR)); + my_free(my_file_info[file].name); } mysql_mutex_unlock(&THR_LOCK_open); DBUG_RETURN(err); diff --git a/mysys/my_gethwaddr.c b/mysys/my_gethwaddr.c index c6a7af58f57..87e6519cafe 100644 --- a/mysys/my_gethwaddr.c +++ b/mysys/my_gethwaddr.c @@ -196,7 +196,7 @@ my_bool my_gethwaddr(uchar *to) /* Clean up memory allocation. */ if (pAdapterAddresses != &adapterAddresses) - my_free(pAdapterAddresses, 0); + my_free(pAdapterAddresses); return return_val; } diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c index 1e94dd2d761..f51dd7befd5 100644 --- a/mysys/my_getopt.c +++ b/mysys/my_getopt.c @@ -596,8 +596,7 @@ static int setval(const struct my_option *opts, void *value, char *argument, case GET_STR_ALLOC: if (argument == enabled_my_option) break; /* string options don't use this default of "1" */ - if ((*((char**) value))) - my_free((*(char**) value), MYF(MY_WME | MY_FAE)); + my_free(*((char**) value)); if (!(*((char**) value)= my_strdup(argument, MYF(MY_WME)))) { res= EXIT_OUT_OF_MEMORY; @@ -1054,8 +1053,9 @@ static void init_one_value(const struct my_option *option, void *variable, */ if ((char*) (intptr) value) { - my_free((*(char**) variable), MYF(MY_ALLOW_ZERO_PTR)); - *((char**) variable)= my_strdup((char*) (intptr) value, MYF(MY_WME)); + char **pstr= (char **) variable; + my_free(*pstr); + *pstr= my_strdup((char*) (intptr) value, MYF(MY_WME)); } break; default: /* dummy default to avoid compiler warnings */ @@ -1080,7 +1080,7 @@ static void fini_one_value(const struct my_option *option, void *variable, DBUG_ENTER("fini_one_value"); switch ((option->var_type & GET_TYPE_MASK)) { case GET_STR_ALLOC: - my_free((*(char**) variable), MYF(MY_ALLOW_ZERO_PTR)); + my_free(*((char**) variable)); *((char**) variable)= NULL; break; default: /* dummy default to avoid compiler warnings */ diff --git a/mysys/my_init.c b/mysys/my_init.c index 5bda2cb03ac..41a2efe0b90 100644 --- a/mysys/my_init.c +++ b/mysys/my_init.c @@ -141,6 +141,7 @@ my_bool my_init(void) { if (my_init_done) return 0; + my_init_done= 1; if (my_basic_init()) @@ -241,9 +242,7 @@ Voluntary context switches %ld, Involuntary context switches %ld\n", #if defined(__NETWARE__) && !defined(__WIN__) fprintf(info_file,"\nRun time: %.1f\n",(double) clock()/CLOCKS_PER_SEC); #endif -#if defined(SAFEMALLOC) - TERMINATE(stderr, (infoflag & MY_GIVE_INFO) != 0); -#elif defined(__WIN__) && defined(_MSC_VER) +#if defined(__WIN__) && defined(_MSC_VER) _CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_FILE ); _CrtSetReportFile( _CRT_WARN, _CRTDBG_FILE_STDERR ); _CrtSetReportMode( _CRT_ERROR, _CRTDBG_MODE_FILE ); @@ -254,10 +253,6 @@ Voluntary context switches %ld, Involuntary context switches %ld\n", _CrtDumpMemoryLeaks(); #endif } - else if (infoflag & MY_CHECK_ERROR) - { - TERMINATE(stderr, 0); /* Print memory leaks on screen */ - } if (!(infoflag & MY_DONT_FREE_DBUG)) { @@ -280,6 +275,7 @@ Voluntary context switches %ld, Involuntary context switches %ld\n", if (have_tcpip) WSACleanup(); #endif /* __WIN__ */ + my_init_done=0; my_basic_init_done= 0; } /* my_end */ diff --git a/mysys/my_largepage.c b/mysys/my_largepage.c index e65d3a0a5f5..9f5ab01a2b7 100644 --- a/mysys/my_largepage.c +++ b/mysys/my_largepage.c @@ -27,7 +27,7 @@ static uint my_get_large_page_size_int(void); static uchar* my_large_malloc_int(size_t size, myf my_flags); -static my_bool my_large_free_int(uchar* ptr, myf my_flags); +static my_bool my_large_free_int(uchar* ptr); /* Gets the size of large pages from the OS */ @@ -70,7 +70,7 @@ uchar* my_large_malloc(size_t size, myf my_flags) to my_free_lock() in case of failure */ -void my_large_free(uchar* ptr, myf my_flags __attribute__((unused))) +void my_large_free(uchar* ptr) { DBUG_ENTER("my_large_free"); @@ -79,9 +79,8 @@ void my_large_free(uchar* ptr, myf my_flags __attribute__((unused))) my_large_malloc_int(), i.e. my_malloc_lock() was used so we should free it with my_free_lock() */ - if (!my_use_large_pages || !my_large_page_size || - !my_large_free_int(ptr, my_flags)) - my_free_lock(ptr, my_flags); + if (!my_use_large_pages || !my_large_page_size || !my_large_free_int(ptr)) + my_free_lock(ptr); DBUG_VOID_RETURN; } @@ -157,7 +156,7 @@ uchar* my_large_malloc_int(size_t size, myf my_flags) /* Linux-specific large pages deallocator */ -my_bool my_large_free_int(uchar *ptr, myf my_flags __attribute__((unused))) +my_bool my_large_free_int(uchar *ptr) { DBUG_ENTER("my_large_free_int"); DBUG_RETURN(shmdt(ptr) == 0); diff --git a/mysys/my_lib.c b/mysys/my_lib.c index 0113d1498df..e70a70d47ed 100644 --- a/mysys/my_lib.c +++ b/mysys/my_lib.c @@ -77,7 +77,7 @@ void my_dirend(MY_DIR *buffer) ALIGN_SIZE(sizeof(MY_DIR)))); free_root((MEM_ROOT*)((char*)buffer + ALIGN_SIZE(sizeof(MY_DIR)) + ALIGN_SIZE(sizeof(DYNAMIC_ARRAY))), MYF(0)); - my_free((uchar*) buffer,MYF(0)); + my_free(buffer); } DBUG_VOID_RETURN; } /* my_dirend */ @@ -131,7 +131,7 @@ MY_DIR *my_dir(const char *path, myf MyFlags) if (my_init_dynamic_array(dir_entries_storage, sizeof(FILEINFO), ENTRIES_START_SIZE, ENTRIES_INCREMENT)) { - my_free((uchar*) buffer,MYF(0)); + my_free(buffer); goto error; } init_alloc_root(names_storage, NAMES_START_SIZE, NAMES_START_SIZE); @@ -400,7 +400,7 @@ MY_DIR *my_dir(const char *path, myf MyFlags) if (my_init_dynamic_array(dir_entries_storage, sizeof(FILEINFO), ENTRIES_START_SIZE, ENTRIES_INCREMENT)) { - my_free((uchar*) buffer,MYF(0)); + my_free(buffer); goto error; } init_alloc_root(names_storage, NAMES_START_SIZE, NAMES_START_SIZE); @@ -547,7 +547,7 @@ MY_STAT *my_stat(const char *path, MY_STAT *stat_area, myf my_flags) DBUG_PRINT("error",("Got errno: %d from stat", errno)); my_errno= errno; if (m_used) /* Free if new area */ - my_free((uchar*) stat_area,MYF(0)); + my_free(stat_area); error: if (my_flags & (MY_FAE+MY_WME)) diff --git a/mysys/my_lockmem.c b/mysys/my_lockmem.c index 1b582783d33..a37db6b2089 100644 --- a/mysys/my_lockmem.c +++ b/mysys/my_lockmem.c @@ -74,7 +74,7 @@ uchar *my_malloc_lock(uint size,myf MyFlags) } -void my_free_lock(uchar *ptr,myf Myflags __attribute__((unused))) +void my_free_lock(uchar *ptr) { LIST *list; struct st_mem_list *element=0; @@ -91,8 +91,7 @@ void my_free_lock(uchar *ptr,myf Myflags __attribute__((unused))) } } mysql_mutex_unlock(&THR_LOCK_malloc); - if (element) - my_free((uchar*) element,MYF(0)); + my_free(element); free(ptr); /* Free even if not locked */ } diff --git a/mysys/my_malloc.c b/mysys/my_malloc.c index 13d2375eb99..fc2dc98c3c5 100644 --- a/mysys/my_malloc.c +++ b/mysys/my_malloc.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. 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 @@ -11,28 +11,31 @@ 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 */ - -#ifdef SAFEMALLOC /* We don't need SAFEMALLOC here */ -#undef SAFEMALLOC -#endif + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "mysys_priv.h" #include "mysys_err.h" #include - /* My memory allocator */ +/** + Allocate a sized block of memory. + @param size The size of the memory block in bytes. + @param flags Failure action modifiers (bitmasks). + + @return A pointer to the allocated memory block, or NULL on failure. +*/ void *my_malloc(size_t size, myf my_flags) { void* point; DBUG_ENTER("my_malloc"); DBUG_PRINT("my",("size: %lu my_flags: %d", (ulong) size, my_flags)); + /* Safety */ if (!size) - size=1; /* Safety */ + size=1; - point= (char *) malloc(size); + point= malloc(size); DBUG_EXECUTE_IF("simulate_out_of_memory", { free(point); @@ -52,33 +55,87 @@ void *my_malloc(size_t size, myf my_flags) exit(1); } else if (my_flags & MY_ZEROFILL) - bzero(point,size); - DBUG_PRINT("exit",("ptr: 0x%lx", (long) point)); - DBUG_RETURN((void*) point); -} /* my_malloc */ + bzero(point, size); + DBUG_PRINT("exit",("ptr: %p", point)); + DBUG_RETURN(point); +} + + +/** + @brief wrapper around realloc() + + @param oldpoint pointer to currently allocated area + @param size new size requested, must be >0 + @param my_flags flags + + @note if size==0 realloc() may return NULL; my_realloc() treats this as an + error which is not the intention of realloc() +*/ +void *my_realloc(void *oldpoint, size_t size, myf my_flags) +{ + void *point; + DBUG_ENTER("my_realloc"); + DBUG_PRINT("my",("ptr: %p size: %lu my_flags: %d", oldpoint, + (ulong) size, my_flags)); + + DBUG_ASSERT(size > 0); + if (!oldpoint && (my_flags & MY_ALLOW_ZERO_PTR)) + DBUG_RETURN(my_malloc(size, my_flags)); +#ifdef USE_HALLOC + if (!(point = malloc(size))) + { + if (my_flags & MY_FREE_ON_ERROR) + my_free(oldpoint); + if (my_flags & MY_HOLD_ON_ERROR) + DBUG_RETURN(oldpoint); + my_errno=errno; + if (my_flags & MY_FAE+MY_WME) + my_error(EE_OUTOFMEMORY, MYF(ME_BELL+ME_WAITTANG),size); + } + else + { + memcpy(point,oldpoint,size); + free(oldpoint); + } +#else + if ((point= realloc(oldpoint, size)) == NULL) + { + if (my_flags & MY_FREE_ON_ERROR) + my_free(oldpoint); + if (my_flags & MY_HOLD_ON_ERROR) + DBUG_RETURN(oldpoint); + my_errno=errno; + if (my_flags & (MY_FAE+MY_WME)) + my_error(EE_OUTOFMEMORY, MYF(ME_BELL+ME_WAITTANG), size); + } +#endif + DBUG_PRINT("exit",("ptr: %p", point)); + DBUG_RETURN(point); +} - /* Free memory allocated with my_malloc */ - /*ARGSUSED*/ +/** + Free memory allocated with my_malloc. -void my_no_flags_free(void* ptr) + @remark Relies on free being able to handle a NULL argument. + + @param ptr Pointer to the memory allocated by my_malloc. +*/ +void my_free(void *ptr) { DBUG_ENTER("my_free"); - DBUG_PRINT("my",("ptr: 0x%lx", (long) ptr)); - if (ptr) - free(ptr); + DBUG_PRINT("my",("ptr: %p", ptr)); + free(ptr); DBUG_VOID_RETURN; -} /* my_free */ - +} - /* malloc and copy */ -void* my_memdup(const void *from, size_t length, myf my_flags) +void *my_memdup(const void *from, size_t length, myf my_flags) { void *ptr; if ((ptr= my_malloc(length,my_flags)) != 0) memcpy(ptr, from, length); - return(ptr); + return ptr; } @@ -87,18 +144,19 @@ char *my_strdup(const char *from, myf my_flags) char *ptr; size_t length= strlen(from)+1; if ((ptr= (char*) my_malloc(length, my_flags))) - memcpy((uchar*) ptr, (uchar*) from,(size_t) length); - return(ptr); + memcpy(ptr, from, length); + return ptr; } char *my_strndup(const char *from, size_t length, myf my_flags) { char *ptr; - if ((ptr= (char*) my_malloc(length+1,my_flags)) != 0) + if ((ptr= (char*) my_malloc(length+1, my_flags))) { - memcpy((uchar*) ptr, (uchar*) from, length); - ptr[length]=0; + memcpy(ptr, from, length); + ptr[length]= 0; } - return((char*) ptr); + return ptr; } + diff --git a/mysys/my_once.c b/mysys/my_once.c index 727b8477365..32d07802028 100644 --- a/mysys/my_once.c +++ b/mysys/my_once.c @@ -15,10 +15,6 @@ /* Not MT-SAFE */ -#ifdef SAFEMALLOC /* We don't need SAFEMALLOC here */ -#undef SAFEMALLOC -#endif - #include "mysys_priv.h" #include "my_static.h" #include "mysys_err.h" diff --git a/mysys/my_open.c b/mysys/my_open.c index a50baf2c417..8f34ce1c6dc 100644 --- a/mysys/my_open.c +++ b/mysys/my_open.c @@ -88,7 +88,7 @@ int my_close(File fd, myf MyFlags) } if ((uint) fd < my_file_limit && my_file_info[fd].type != UNOPEN) { - my_free(my_file_info[fd].name, MYF(0)); + my_free(my_file_info[fd].name); #if defined(THREAD) && !defined(HAVE_PREAD) && !defined(_WIN32) mysql_mutex_destroy(&my_file_info[fd].mutex); #endif diff --git a/mysys/my_realloc.c b/mysys/my_realloc.c deleted file mode 100644 index a55282e03a0..00000000000 --- a/mysys/my_realloc.c +++ /dev/null @@ -1,75 +0,0 @@ -/* Copyright (C) 2000 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 */ - -#ifdef SAFEMALLOC /* We don't need SAFEMALLOC here */ -#undef SAFEMALLOC -#endif - -#include "mysys_priv.h" -#include "mysys_err.h" - - /* My memory re allocator */ - -/** - @brief wrapper around realloc() - - @param oldpoint pointer to currently allocated area - @param size new size requested, must be >0 - @param my_flags flags - - @note if size==0 realloc() may return NULL; my_realloc() treats this as an - error which is not the intention of realloc() -*/ -void* my_realloc(void* oldpoint, size_t size, myf my_flags) -{ - void *point; - DBUG_ENTER("my_realloc"); - DBUG_PRINT("my",("ptr: 0x%lx size: %lu my_flags: %d", (long) oldpoint, - (ulong) size, my_flags)); - - DBUG_ASSERT(size > 0); - if (!oldpoint && (my_flags & MY_ALLOW_ZERO_PTR)) - DBUG_RETURN(my_malloc(size,my_flags)); -#ifdef USE_HALLOC - if (!(point = malloc(size))) - { - if (my_flags & MY_FREE_ON_ERROR) - my_free(oldpoint,my_flags); - if (my_flags & MY_HOLD_ON_ERROR) - DBUG_RETURN(oldpoint); - my_errno=errno; - if (my_flags & MY_FAE+MY_WME) - my_error(EE_OUTOFMEMORY, MYF(ME_BELL+ME_WAITTANG),size); - } - else - { - memcpy(point,oldpoint,size); - free(oldpoint); - } -#else - if ((point= (uchar*) realloc(oldpoint,size)) == NULL) - { - if (my_flags & MY_FREE_ON_ERROR) - my_free(oldpoint, my_flags); - if (my_flags & MY_HOLD_ON_ERROR) - DBUG_RETURN(oldpoint); - my_errno=errno; - if (my_flags & (MY_FAE+MY_WME)) - my_error(EE_OUTOFMEMORY, MYF(ME_BELL+ME_WAITTANG), size); - } -#endif - DBUG_PRINT("exit",("ptr: 0x%lx", (long) point)); - DBUG_RETURN(point); -} /* my_realloc */ diff --git a/mysys/my_windac.c b/mysys/my_windac.c index f846853f7be..0c924188623 100644 --- a/mysys/my_windac.c +++ b/mysys/my_windac.c @@ -194,8 +194,8 @@ error: FreeSid(everyone_sid); if (htoken) CloseHandle(htoken); - my_free((uchar*) sa, MYF(MY_ALLOW_ZERO_PTR)); - my_free((uchar*) dacl, MYF(MY_ALLOW_ZERO_PTR)); + my_free(sa); + my_free(dacl); *psa= 0; return 1; } @@ -215,8 +215,8 @@ void my_security_attr_free(SECURITY_ATTRIBUTES *sa) My_security_attr *attr= (My_security_attr*) (((char*)sa) + ALIGN_SIZE(sizeof(*sa))); FreeSid(attr->everyone_sid); - my_free((uchar*) attr->dacl, MYF(0)); - my_free((uchar*) sa, MYF(0)); + my_free(attr->dacl); + my_free(sa); } } diff --git a/mysys/queues.c b/mysys/queues.c index 9c85e493141..25a310c0752 100644 --- a/mysys/queues.c +++ b/mysys/queues.c @@ -194,11 +194,8 @@ int resize_queue(QUEUE *queue, uint max_elements) void delete_queue(QUEUE *queue) { DBUG_ENTER("delete_queue"); - if (queue->root) - { - my_free((uchar*) queue->root,MYF(0)); - queue->root=0; - } + my_free(queue->root); + queue->root= NULL; DBUG_VOID_RETURN; } diff --git a/mysys/safemalloc.c b/mysys/safemalloc.c deleted file mode 100644 index 6d0f7e5dd53..00000000000 --- a/mysys/safemalloc.c +++ /dev/null @@ -1,576 +0,0 @@ -/* Copyright (C) 2000-2003 MySQL AB, 2008-2009 Sun Microsystems, Inc - - 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 */ - -/* - * Memory sub-system, written by Bjorn Benson - Fixed to use my_sys scheme by Michael Widenius - - [This posting refers to an article entitled "oops, corrupted memory - again!" in net.lang.c. I am posting it here because it is source.] - - My tool for approaching this problem is to build another level of data - abstraction on top of malloc() and free() that implements some checking. - This does a number of things for you: - - Checks for overruns and underruns on allocated data - - Keeps track of where in the program the memory was malloc'ed - - Reports on pieces of memory that were not free'ed - - Records some statistics such as maximum memory used - - Marks newly malloc'ed and newly free'ed memory with special values - You can use this scheme to: - - Find bugs such as overrun, underrun, etc because you know where - a piece of data was malloc'ed and where it was free'ed - - Find bugs where memory was not free'ed - - Find bugs where newly malloc'ed memory is used without initializing - - Find bugs where newly free'ed memory is still used - - Determine how much memory your program really uses - - and other things - - To implement my scheme you must have a C compiler that has __LINE__ and - __FILE__ macros. If your compiler doesn't have these then (a) buy another: - compilers that do are available on UNIX 4.2bsd based systems and the PC, - and probably on other machines; or (b) change my scheme somehow. I have - recomendations on both these points if you would like them (e-mail please). - - There are 4 functions in my package: - char *NEW( uSize ) Allocate memory of uSize bytes - (equivalent to malloc()) - char *REA( pPtr, uSize) Allocate memory of uSize bytes, move data and - free pPtr. - (equivalent to realloc()) - FREE( pPtr ) Free memory allocated by NEW - (equivalent to free()) - TERMINATE(file,flag) End system, report errors and stats on file - I personally use two more functions, but have not included them here: - char *STRSAVE( sPtr ) Save a copy of the string in dynamic memory - char *RENEW( pPtr, uSize ) - (equivalent to realloc()) - -*/ - -#ifndef SAFEMALLOC -#define SAFEMALLOC /* Get protos from my_sys */ -#endif - -#include "mysys_priv.h" -#include -#include "my_static.h" -#include "mysys_err.h" - -ulonglong sf_malloc_mem_limit= ~(ulonglong)0; - -#ifndef PEDANTIC_SAFEMALLOC -/* - Set to 1 after TERMINATE() if we had to fiddle with sf_malloc_count and - the linked list of blocks so that _sanity() will not fuss when it - is not supposed to -*/ -static int sf_malloc_tampered= 0; -#endif - - - /* Static functions prototypes */ - -static int check_ptr(const char *where, uchar *ptr, const char *sFile, - uint uLine); -static int _checkchunk(struct st_irem *pRec, const char *sFile, uint uLine); - -/* - Note: We only fill up the allocated block. This do not include - malloc() roundoff or the extra space required by the irem - structures. -*/ - -/* - NEW'ed memory is filled with this value so that references to it will - end up being very strange. -*/ -#define ALLOC_VAL (uchar) 0xA5 -/* - FEEE'ed memory is filled with this value so that references to it will - end up being very strange. -*/ -#define FREE_VAL (uchar) 0x8F -#define MAGICKEY 0x14235296 /* A magic value for underrun key */ - -/* - Warning: do not change the MAGICEND? values to something with the - high bit set. Various C compilers (like the 4.2bsd one) do not do - the sign extension right later on in this code and you will get - erroneous errors. -*/ - -#define MAGICEND0 0x68 /* Magic values for overrun keys */ -#define MAGICEND1 0x34 /* " */ -#define MAGICEND2 0x7A /* " */ -#define MAGICEND3 0x15 /* " */ - - -/* Allocate some memory. */ - -void *_mymalloc(size_t size, const char *filename, uint lineno, myf MyFlags) -{ - struct st_irem *irem; - uchar *data; - DBUG_ENTER("_mymalloc"); - DBUG_PRINT("enter",("Size: %lu", (ulong) size)); - - if (!sf_malloc_quick) - (void) _sanity (filename, lineno); - - if (size + sf_malloc_cur_memory > sf_malloc_mem_limit) - irem= 0; - else - { - /* Allocate the physical memory */ - irem= (struct st_irem *) malloc (ALIGN_SIZE(sizeof(struct st_irem)) + - sf_malloc_prehunc + - size + /* size requested */ - 4 + /* overrun mark */ - sf_malloc_endhunc); - DBUG_EXECUTE_IF("simulate_out_of_memory", - { - free(irem); - irem= NULL; - }); - } - /* Check if there isn't anymore memory avaiable */ - if (!irem) - { - if (MyFlags & MY_FAE) - error_handler_hook=fatal_error_handler_hook; - if (MyFlags & (MY_FAE+MY_WME)) - { - char buff[256]; - my_errno=errno; - sprintf(buff,"Out of memory at line %d, '%s'", lineno, filename); - my_message(EE_OUTOFMEMORY, buff, MYF(ME_BELL+ME_WAITTANG+ME_NOREFRESH)); - sprintf(buff,"needed %lu byte (%luk), memory in use: %lu bytes (%luk)", - (ulong) size, (ulong) (size + 1023L) / 1024L, - (ulong) sf_malloc_max_memory, - (ulong) (sf_malloc_max_memory + 1023L) / 1024L); - my_message(EE_OUTOFMEMORY, buff, MYF(ME_BELL+ME_WAITTANG+ME_NOREFRESH)); - } - DBUG_PRINT("error",("Out of memory, in use: %ld at line %d, '%s'", - (long)sf_malloc_max_memory,lineno, filename)); - DBUG_EXECUTE_IF("simulate_out_of_memory", - DBUG_SET("-d,simulate_out_of_memory");); - if (MyFlags & MY_FAE) - exit(1); - DBUG_RETURN ((void*) 0); - } - - /* Fill up the structure */ - data= (((uchar*) irem) + ALIGN_SIZE(sizeof(struct st_irem)) + - sf_malloc_prehunc); - *((uint32*) (data-sizeof(uint32)))= MAGICKEY; - data[size + 0]= MAGICEND0; - data[size + 1]= MAGICEND1; - data[size + 2]= MAGICEND2; - data[size + 3]= MAGICEND3; - irem->filename= (char *) filename; - irem->linenum= lineno; - irem->datasize= size; - irem->prev= NULL; - - /* Add this remember structure to the linked list */ - mysql_mutex_lock(&THR_LOCK_malloc); - if ((irem->next= sf_malloc_root)) - sf_malloc_root->prev= irem; - sf_malloc_root= irem; - - /* Keep the statistics */ - sf_malloc_cur_memory+= size; - if (sf_malloc_cur_memory > sf_malloc_max_memory) - sf_malloc_max_memory= sf_malloc_cur_memory; - sf_malloc_count++; - mysql_mutex_unlock(&THR_LOCK_malloc); - - MEM_CHECK_ADDRESSABLE(data, size); - /* Set the memory to the aribtrary wierd value */ - if ((MyFlags & MY_ZEROFILL) || !sf_malloc_quick) - bfill(data, size, (char) (MyFlags & MY_ZEROFILL ? 0 : ALLOC_VAL)); - if (!(MyFlags & MY_ZEROFILL)) - MEM_UNDEFINED(data, size); - /* Return a pointer to the real data */ - DBUG_PRINT("exit",("ptr: %p", data)); - if (sf_min_adress > data) - sf_min_adress= data; - if (sf_max_adress < data) - sf_max_adress= data; - DBUG_RETURN((void*) data); -} - - -/* - Allocate some new memory and move old memoryblock there. - Free then old memoryblock -*/ - -void *_myrealloc(register void *ptr, register size_t size, - const char *filename, uint lineno, myf MyFlags) -{ - struct st_irem *irem; - char *data; - DBUG_ENTER("_myrealloc"); - - if (!ptr && (MyFlags & MY_ALLOW_ZERO_PTR)) - DBUG_RETURN(_mymalloc(size, filename, lineno, MyFlags)); - - if (!sf_malloc_quick) - (void) _sanity (filename, lineno); - - if (check_ptr("Reallocating", (uchar*) ptr, filename, lineno)) - DBUG_RETURN((uchar*) NULL); - - irem= (struct st_irem *) (((char*) ptr) - ALIGN_SIZE(sizeof(struct st_irem))- - sf_malloc_prehunc); - if (*((uint32*) (((char*) ptr)- sizeof(uint32))) != MAGICKEY) - { - fprintf(stderr, "Error: Reallocating unallocated data at line %d, '%s'\n", - lineno, filename); - DBUG_PRINT("safe",("Reallocating unallocated data at line %d, '%s'", - lineno, filename)); - (void) fflush(stderr); - DBUG_RETURN((uchar*) NULL); - } - - if ((data= _mymalloc(size,filename,lineno,MyFlags))) /* Allocate new area */ - { - size=min(size, irem->datasize); /* Move as much as possibly */ - memcpy((uchar*) data, ptr, (size_t) size); /* Copy old data */ - _myfree(ptr, filename, lineno, 0); /* Free not needed area */ - } - else - { - if (MyFlags & MY_HOLD_ON_ERROR) - DBUG_RETURN(ptr); - if (MyFlags & MY_FREE_ON_ERROR) - _myfree(ptr, filename, lineno, 0); - } - DBUG_RETURN(data); -} /* _myrealloc */ - - -/* Deallocate some memory. */ - -void _myfree(void *ptr, const char *filename, uint lineno, myf myflags) -{ - struct st_irem *irem; - DBUG_ENTER("_myfree"); - DBUG_PRINT("enter",("ptr: %p", ptr)); - - if (!sf_malloc_quick) - (void) _sanity (filename, lineno); - - if ((!ptr && (myflags & MY_ALLOW_ZERO_PTR)) || - check_ptr("Freeing",(uchar*) ptr,filename,lineno)) - DBUG_VOID_RETURN; - - /* Calculate the address of the remember structure */ - irem= (struct st_irem *) ((char*) ptr- ALIGN_SIZE(sizeof(struct st_irem))- - sf_malloc_prehunc); - - /* - Check to make sure that we have a real remember structure. - Note: this test could fail for four reasons: - (1) The memory was already free'ed - (2) The memory was never new'ed - (3) There was an underrun - (4) A stray pointer hit this location - */ - - if (*((uint32*) ((char*) ptr- sizeof(uint32))) != MAGICKEY) - { - fprintf(stderr, "Error: Freeing unallocated data at line %d, '%s'\n", - lineno, filename); - DBUG_PRINT("safe",("Unallocated data at line %d, '%s'",lineno,filename)); - (void) fflush(stderr); - DBUG_VOID_RETURN; - } - - /* Remove this structure from the linked list */ - mysql_mutex_lock(&THR_LOCK_malloc); - if (irem->prev) - irem->prev->next= irem->next; - else - sf_malloc_root= irem->next; - - if (irem->next) - irem->next->prev= irem->prev; - /* Handle the statistics */ - sf_malloc_cur_memory-= irem->datasize; - sf_malloc_count--; - mysql_mutex_unlock(&THR_LOCK_malloc); - -#ifndef HAVE_purify - /* Mark this data as free'ed */ - if (!sf_malloc_quick) - bfill(ptr, irem->datasize, (pchar) FREE_VAL); -#endif - MEM_NOACCESS(ptr, irem->datasize); - *((uint32*) ((char*) ptr- sizeof(uint32)))= ~MAGICKEY; - MEM_NOACCESS((char*) ptr - sizeof(uint32), sizeof(uint32)); - /* Actually free the memory */ - free((char*) irem); - DBUG_VOID_RETURN; -} - - /* Check if we have a wrong pointer */ - -static int check_ptr(const char *where, uchar *ptr, const char *filename, - uint lineno) -{ - if (!ptr) - { - fprintf(stderr, "Error: %s NULL pointer at line %d, '%s'\n", - where,lineno, filename); - DBUG_PRINT("safe",("Null pointer at line %d '%s'", lineno, filename)); - (void) fflush(stderr); - return 1; - } -#ifndef _MSC_VER - if ((long) ptr & (ALIGN_SIZE(1)-1)) - { - fprintf(stderr, "Error: %s wrong aligned pointer at line %d, '%s'\n", - where,lineno, filename); - DBUG_PRINT("safe",("Wrong aligned pointer at line %d, '%s'", - lineno,filename)); - (void) fflush(stderr); - return 1; - } -#endif - if (ptr < sf_min_adress || ptr > sf_max_adress) - { - fprintf(stderr, "Error: %s pointer out of range at line %d, '%s'\n", - where,lineno, filename); - DBUG_PRINT("safe",("Pointer out of range at line %d '%s'", - lineno,filename)); - (void) fflush(stderr); - return 1; - } - return 0; -} - - -/* - Report on all the memory pieces that have not been free'ed - - SYNOPSIS - TERMINATE() - file Write output to this file - flag If <> 0, also write statistics - */ - -void TERMINATE(FILE *file, uint flag) -{ - struct st_irem *irem; - DBUG_ENTER("TERMINATE"); - mysql_mutex_lock(&THR_LOCK_malloc); - - /* - Report the difference between number of calls to - NEW and the number of calls to FREE. >0 means more - NEWs than FREEs. <0, etc. - */ - - if (sf_malloc_count) - { - if (file) - { - fprintf(file, "Warning: Not freed memory segments: %u\n", sf_malloc_count); - (void) fflush(file); - } - DBUG_PRINT("safe",("sf_malloc_count: %u", sf_malloc_count)); - } - - /* - Report on all the memory that was allocated with NEW - but not free'ed with FREE. - */ - - if ((irem= sf_malloc_root)) - { - if (file) - { - fprintf(file, "Warning: Memory that was not free'ed (%lu bytes):\n", - (ulong) sf_malloc_cur_memory); - (void) fflush(file); - } - DBUG_PRINT("safe",("Memory that was not free'ed (%lu bytes):", - (ulong) sf_malloc_cur_memory)); - while (irem) - { - char *data= (((char*) irem) + ALIGN_SIZE(sizeof(struct st_irem)) + - sf_malloc_prehunc); - if (file) - { - fprintf(file, - "\t%6lu bytes at %p, allocated at line %4u in '%s'", - (ulong) irem->datasize, data, irem->linenum, irem->filename); - fprintf(file, "\n"); - (void) fflush(file); - } - DBUG_PRINT("safe", - ("%6lu bytes at %p, allocated at line %4d in '%s'", - (ulong) irem->datasize, - data, irem->linenum, irem->filename)); - irem= irem->next; - } - } - /* Report the memory usage statistics */ - if (file && flag) - { - fprintf(file, "Maximum memory usage: %lu bytes (%luk)\n", - (ulong) sf_malloc_max_memory, - (ulong) (sf_malloc_max_memory + 1023L) / 1024L); - (void) fflush(file); - } - DBUG_PRINT("safe",("Maximum memory usage: %lu bytes (%luk)", - (ulong) sf_malloc_max_memory, - (ulong) (sf_malloc_max_memory + 1023L) /1024L)); - mysql_mutex_unlock(&THR_LOCK_malloc); - DBUG_VOID_RETURN; -} - - -/* - Report where a piece of memory was allocated - - This is usefull to call from withing a debugger -*/ - - -void sf_malloc_report_allocated(void *memory) -{ - struct st_irem *irem; - for (irem= sf_malloc_root ; irem ; irem=irem->next) - { - char *data= (((char*) irem) + ALIGN_SIZE(sizeof(struct st_irem)) + - sf_malloc_prehunc); - if (data <= (char*) memory && (char*) memory <= data + irem->datasize) - { - printf("%lu bytes at %p, allocated at line %u in '%s'\n", - (ulong) irem->datasize, data, irem->linenum, irem->filename); - break; - } - } -} - - /* Returns 0 if chunk is ok */ - -static int _checkchunk(register struct st_irem *irem, const char *filename, - uint lineno) -{ - int flag=0; - char *magicp, *data; - - data= (((char*) irem) + ALIGN_SIZE(sizeof(struct st_irem)) + - sf_malloc_prehunc); - /* Check for a possible underrun */ - if (*((uint32*) (data- sizeof(uint32))) != MAGICKEY) - { - fprintf(stderr, "Error: Memory allocated at %s:%d was underrun,", - irem->filename, irem->linenum); - fprintf(stderr, " discovered at %s:%d\n", filename, lineno); - (void) fflush(stderr); - DBUG_PRINT("safe",("Underrun at %p, allocated at %s:%d", - data, irem->filename, irem->linenum)); - flag=1; - } - - /* Check for a possible overrun */ - magicp= data + irem->datasize; - if (*magicp++ != MAGICEND0 || - *magicp++ != MAGICEND1 || - *magicp++ != MAGICEND2 || - *magicp++ != MAGICEND3) - { - fprintf(stderr, "Error: Memory allocated at %s:%d was overrun,", - irem->filename, irem->linenum); - fprintf(stderr, " discovered at '%s:%d'\n", filename, lineno); - (void) fflush(stderr); - DBUG_PRINT("safe",("Overrun at %p, allocated at %s:%d", - data, irem->filename, irem->linenum)); - flag=1; - } - return(flag); -} - - - /* Returns how many wrong chunks */ - -int _sanity(const char *filename, uint lineno) -{ - reg1 struct st_irem *irem; - reg2 int flag=0; - uint count=0; - - mysql_mutex_lock(&THR_LOCK_malloc); -#ifndef PEDANTIC_SAFEMALLOC - if (sf_malloc_tampered && (int) sf_malloc_count < 0) - sf_malloc_count=0; -#endif - count=sf_malloc_count; - for (irem= sf_malloc_root; irem != NULL && count-- ; irem= irem->next) - flag+= _checkchunk (irem, filename, lineno); - mysql_mutex_unlock(&THR_LOCK_malloc); - if (count || irem) - { - const char *format="Error: Safemalloc link list destroyed, discovered at '%s:%d'"; - fprintf(stderr, format, filename, lineno); fputc('\n',stderr); - fprintf(stderr, "root=%p,count=%d,irem=%p\n", sf_malloc_root,count,irem); - (void) fflush(stderr); - DBUG_PRINT("safe",(format, filename, lineno)); - flag=1; - } - return flag; -} /* _sanity */ - - - /* malloc and copy */ - -void *_my_memdup(const void *from, size_t length, const char *filename, - uint lineno, myf MyFlags) -{ - void *ptr; - if ((ptr= _mymalloc(length,filename,lineno,MyFlags)) != 0) - memcpy(ptr, from, length); - return(ptr); -} /*_my_memdup */ - - -char *_my_strdup(const char *from, const char *filename, uint lineno, - myf MyFlags) -{ - char *ptr; - size_t length= strlen(from)+1; - if ((ptr= (char*) _mymalloc(length,filename,lineno,MyFlags)) != 0) - memcpy((uchar*) ptr, (uchar*) from, (size_t) length); - return(ptr); -} /* _my_strdup */ - - -char *_my_strndup(const char *from, size_t length, - const char *filename, uint lineno, - myf MyFlags) -{ - char *ptr; - if ((ptr= (char*) _mymalloc(length+1,filename,lineno,MyFlags)) != 0) - { - memcpy((uchar*) ptr, (uchar*) from, (size_t) length); - ptr[length]=0; - } - return(ptr); -} diff --git a/mysys/string.c b/mysys/string.c index 10a72b8a295..b1eded0664c 100644 --- a/mysys/string.c +++ b/mysys/string.c @@ -177,9 +177,6 @@ my_bool dynstr_append_os_quoted(DYNAMIC_STRING *str, const char *append, ...) void dynstr_free(DYNAMIC_STRING *str) { - if (str->str) - { - my_free(str->str,MYF(MY_WME)); - str->str=0; - } + my_free(str->str); + str->str= NULL; } diff --git a/mysys/test_charset.c b/mysys/test_charset.c index d867b49304e..5b399071d11 100644 --- a/mysys/test_charset.c +++ b/mysys/test_charset.c @@ -80,11 +80,11 @@ int main(int argc, char **argv) { #ifdef NOT_USED_ANYMORE cs_list = list_charsets(MYF(MY_CS_COMPILED | MY_CS_CONFIG)); printf("LIST OF CHARSETS (compiled + *.conf):\n%s\n", cs_list); - my_free(cs_list,MYF(0)); + my_free(cs_list); cs_list = list_charsets(MYF(MY_CS_INDEX | MY_CS_LOADED)); printf("LIST OF CHARSETS (index + loaded):\n%s\n", cs_list); - my_free(cs_list,MYF(0)); + my_free(cs_list); #endif return 0; diff --git a/mysys/testhash.c b/mysys/testhash.c index 2add2ebd2d7..376303f29be 100644 --- a/mysys/testhash.c +++ b/mysys/testhash.c @@ -286,5 +286,5 @@ static int rnd(int max_value) void free_record(void *record) { - my_free(record,MYF(0)); + my_free(record); } diff --git a/mysys/thr_alarm.c b/mysys/thr_alarm.c index 8ee89cfb55d..555ac1cf990 100644 --- a/mysys/thr_alarm.c +++ b/mysys/thr_alarm.c @@ -262,7 +262,7 @@ void thr_end_alarm(thr_alarm_t *alarmed) { queue_remove(&alarm_queue,i),MYF(0); if (alarm_data->malloced) - my_free((uchar*) alarm_data,MYF(0)); + my_free(alarm_data); found++; #ifdef DBUG_OFF break; diff --git a/mysys/tree.c b/mysys/tree.c index ef33f75b7c6..8ea7102ed4c 100644 --- a/mysys/tree.c +++ b/mysys/tree.c @@ -183,7 +183,7 @@ static void delete_tree_element(TREE *tree, TREE_ELEMENT *element) (*tree->free)(ELEMENT_KEY(tree,element), free_free, tree->custom_arg); delete_tree_element(tree,element->right); if (tree->with_delete) - my_free((char*) element,MYF(0)); + my_free(element); } } @@ -326,7 +326,7 @@ int tree_delete(TREE *tree, void *key, uint key_size, void *custom_arg) if (tree->free) (*tree->free)(ELEMENT_KEY(tree,element), free_free, tree->custom_arg); tree->allocated-= sizeof(TREE_ELEMENT) + tree->size_of_element + key_size; - my_free((uchar*) element,MYF(0)); + my_free(element); tree->elements_in_tree--; return 0; } diff --git a/mysys/trie.c b/mysys/trie.c index 5738b9b866b..b2e93fcceac 100644 --- a/mysys/trie.c +++ b/mysys/trie.c @@ -211,7 +211,7 @@ my_bool ac_trie_prepare (TRIE *trie) fail= fail->fail; } } - my_free((uchar*)tmp_nodes, MYF(0)); + my_free(tmp_nodes); DBUG_RETURN(FALSE); } diff --git a/plugin/daemon_example/daemon_example.cc b/plugin/daemon_example/daemon_example.cc index 43138f0655f..9bdacdfeae9 100644 --- a/plugin/daemon_example/daemon_example.cc +++ b/plugin/daemon_example/daemon_example.cc @@ -175,7 +175,7 @@ static int daemon_example_plugin_deinit(void *p) my_write(con->heartbeat_file, (uchar*) buffer, strlen(buffer), MYF(0)); my_close(con->heartbeat_file, MYF(0)); - my_free((char *)con, MYF(0)); + my_free(con); DBUG_RETURN(0); } diff --git a/plugin/semisync/semisync_master.h b/plugin/semisync/semisync_master.h index 1a562e8bb77..dfadf85f271 100644 --- a/plugin/semisync/semisync_master.h +++ b/plugin/semisync/semisync_master.h @@ -255,7 +255,7 @@ private: */ void free_block(Block *block) { - my_free(block, MYF(0)); + my_free(block); --block_num; } diff --git a/scripts/mysql_config.pl.in b/scripts/mysql_config.pl.in index 415c0d3040e..58482691213 100644 --- a/scripts/mysql_config.pl.in +++ b/scripts/mysql_config.pl.in @@ -42,8 +42,7 @@ use Cwd; use strict; my @exclude_cflags = - qw/DDBUG_OFF DSAFEMALLOC USAFEMALLOC DSAFE_MUTEX - DPEDANTIC_SAFEMALLOC DUNIV_MUST_NOT_INLINE DFORCE_INIT_OF_VARS + qw/DDBUG_OFF DSAFE_MUTEX DUNIV_MUST_NOT_INLINE DFORCE_INIT_OF_VARS DEXTRA_DEBUG DHAVE_purify O O[0-9] xO[0-9] W[-A-Za-z]* Xa xstrconst xc99=none unroll2 ip mp restrict/; diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index d2699726a25..0840a99e6e2 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -127,8 +127,7 @@ include="-I$pkgincludedir" # and -xstrconst to make --cflags usable for Sun Forte C++ # FIXME until we have a --cxxflags, we need to remove -AC99 # to make --cflags usable for HP C++ (aCC) -for remove in DDBUG_OFF DSAFEMALLOC USAFEMALLOC DSAFE_MUTEX \ - DPEDANTIC_SAFEMALLOC DUNIV_MUST_NOT_INLINE DFORCE_INIT_OF_VARS \ +for remove in DDBUG_OFF DSAFE_MUTEX DUNIV_MUST_NOT_INLINE DFORCE_INIT_OF_VARS \ DEXTRA_DEBUG DHAVE_purify O 'O[0-9]' 'xO[0-9]' 'W[-A-Za-z]*' \ 'mtune=[-A-Za-z0-9]*' 'mcpu=[-A-Za-z0-9]*' 'march=[-A-Za-z0-9]*' \ Xa xstrconst "xc99=none" AC99 \ diff --git a/sql-common/client.c b/sql-common/client.c index bb7bd4d2633..c277b153109 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -688,8 +688,7 @@ err2: CloseHandle(handle_file_map); } err: - if (tmp) - my_free(tmp, MYF(0)); + my_free(tmp); if (error_allow) error_code = GetLastError(); if (event_connect_request) @@ -802,7 +801,7 @@ void free_rows(MYSQL_DATA *cur) if (cur) { free_root(&cur->alloc,MYF(0)); - my_free((uchar*) cur,MYF(0)); + my_free(cur); } } @@ -1127,9 +1126,8 @@ mysql_free_result(MYSQL_RES *result) free_rows(result->data); if (result->fields) free_root(&result->field_alloc,MYF(0)); - if (result->row) - my_free((uchar*) result->row,MYF(0)); - my_free((uchar*) result,MYF(0)); + my_free(result->row); + my_free(result); } DBUG_VOID_RETURN; } @@ -1167,13 +1165,13 @@ static int add_init_command(struct st_mysql_options *options, const char *cmd) { options->init_commands= (DYNAMIC_ARRAY*)my_malloc(sizeof(DYNAMIC_ARRAY), MYF(MY_WME)); - init_dynamic_array(options->init_commands,sizeof(char*),0,5 CALLER_INFO); + init_dynamic_array(options->init_commands,sizeof(char*),0,5); } if (!(tmp= my_strdup(cmd,MYF(MY_WME))) || insert_dynamic(options->init_commands, (uchar*)&tmp)) { - my_free(tmp, MYF(MY_ALLOW_ZERO_PTR)); + my_free(tmp); return 1; } @@ -1221,7 +1219,7 @@ void mysql_read_default_options(struct st_mysql_options *options, case 2: /* socket */ if (opt_arg) { - my_free(options->unix_socket,MYF(MY_ALLOW_ZERO_PTR)); + my_free(options->unix_socket); options->unix_socket=my_strdup(opt_arg,MYF(MY_WME)); } break; @@ -1232,7 +1230,7 @@ void mysql_read_default_options(struct st_mysql_options *options, case 4: /* password */ if (opt_arg) { - my_free(options->password,MYF(MY_ALLOW_ZERO_PTR)); + my_free(options->password); options->password=my_strdup(opt_arg,MYF(MY_WME)); } break; @@ -1246,7 +1244,7 @@ void mysql_read_default_options(struct st_mysql_options *options, case 7: /* user */ if (opt_arg) { - my_free(options->user,MYF(MY_ALLOW_ZERO_PTR)); + my_free(options->user); options->user=my_strdup(opt_arg,MYF(MY_WME)); } break; @@ -1256,14 +1254,14 @@ void mysql_read_default_options(struct st_mysql_options *options, case 9: /* host */ if (opt_arg) { - my_free(options->host,MYF(MY_ALLOW_ZERO_PTR)); + my_free(options->host); options->host=my_strdup(opt_arg,MYF(MY_WME)); } break; case 10: /* database */ if (opt_arg) { - my_free(options->db,MYF(MY_ALLOW_ZERO_PTR)); + my_free(options->db); options->db=my_strdup(opt_arg,MYF(MY_WME)); } break; @@ -1277,23 +1275,23 @@ void mysql_read_default_options(struct st_mysql_options *options, break; #if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY) case 13: /* ssl_key */ - my_free(options->ssl_key, MYF(MY_ALLOW_ZERO_PTR)); + my_free(options->ssl_key); options->ssl_key = my_strdup(opt_arg, MYF(MY_WME)); break; case 14: /* ssl_cert */ - my_free(options->ssl_cert, MYF(MY_ALLOW_ZERO_PTR)); + my_free(options->ssl_cert); options->ssl_cert = my_strdup(opt_arg, MYF(MY_WME)); break; case 15: /* ssl_ca */ - my_free(options->ssl_ca, MYF(MY_ALLOW_ZERO_PTR)); + my_free(options->ssl_ca); options->ssl_ca = my_strdup(opt_arg, MYF(MY_WME)); break; case 16: /* ssl_capath */ - my_free(options->ssl_capath, MYF(MY_ALLOW_ZERO_PTR)); + my_free(options->ssl_capath); options->ssl_capath = my_strdup(opt_arg, MYF(MY_WME)); break; case 23: /* ssl_cipher */ - my_free(options->ssl_cipher, MYF(MY_ALLOW_ZERO_PTR)); + my_free(options->ssl_cipher); options->ssl_cipher= my_strdup(opt_arg, MYF(MY_WME)); break; #else @@ -1305,11 +1303,11 @@ void mysql_read_default_options(struct st_mysql_options *options, break; #endif /* HAVE_OPENSSL && !EMBEDDED_LIBRARY */ case 17: /* charset-lib */ - my_free(options->charset_dir,MYF(MY_ALLOW_ZERO_PTR)); + my_free(options->charset_dir); options->charset_dir = my_strdup(opt_arg, MYF(MY_WME)); break; case 18: - my_free(options->charset_name,MYF(MY_ALLOW_ZERO_PTR)); + my_free(options->charset_name); options->charset_name = my_strdup(opt_arg, MYF(MY_WME)); break; case 19: /* Interactive-timeout */ @@ -1339,7 +1337,7 @@ void mysql_read_default_options(struct st_mysql_options *options, case 26: /* shared_memory_base_name */ #ifdef HAVE_SMEM if (options->shared_memory_base_name != def_shared_memory_base_name) - my_free(options->shared_memory_base_name,MYF(MY_ALLOW_ZERO_PTR)); + my_free(options->shared_memory_base_name); options->shared_memory_base_name=my_strdup(opt_arg,MYF(MY_WME)); #endif break; @@ -1760,14 +1758,14 @@ mysql_ssl_free(MYSQL *mysql __attribute__((unused))) struct st_VioSSLFd *ssl_fd= (struct st_VioSSLFd*) mysql->connector_fd; DBUG_ENTER("mysql_ssl_free"); - my_free(mysql->options.ssl_key, MYF(MY_ALLOW_ZERO_PTR)); - my_free(mysql->options.ssl_cert, MYF(MY_ALLOW_ZERO_PTR)); - my_free(mysql->options.ssl_ca, MYF(MY_ALLOW_ZERO_PTR)); - my_free(mysql->options.ssl_capath, MYF(MY_ALLOW_ZERO_PTR)); - my_free(mysql->options.ssl_cipher, MYF(MY_ALLOW_ZERO_PTR)); + my_free(mysql->options.ssl_key); + my_free(mysql->options.ssl_cert); + my_free(mysql->options.ssl_ca); + my_free(mysql->options.ssl_capath); + my_free(mysql->options.ssl_cipher); if (ssl_fd) SSL_CTX_free(ssl_fd->ssl_context); - my_free(mysql->connector_fd,MYF(MY_ALLOW_ZERO_PTR)); + my_free(mysql->connector_fd); mysql->options.ssl_key = 0; mysql->options.ssl_cert = 0; mysql->options.ssl_ca = 0; @@ -2271,8 +2269,8 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user, (mysql->options.my_cnf_file ? mysql->options.my_cnf_file : "my"), mysql->options.my_cnf_group); - my_free(mysql->options.my_cnf_file,MYF(MY_ALLOW_ZERO_PTR)); - my_free(mysql->options.my_cnf_group,MYF(MY_ALLOW_ZERO_PTR)); + my_free(mysql->options.my_cnf_file); + my_free(mysql->options.my_cnf_group); mysql->options.my_cnf_file=mysql->options.my_cnf_group=0; } @@ -3014,7 +3012,7 @@ mysql_select_db(MYSQL *mysql, const char *db) if ((error=simple_command(mysql,COM_INIT_DB, (const uchar*) db, (ulong) strlen(db),0))) DBUG_RETURN(error); - my_free(mysql->db,MYF(MY_ALLOW_ZERO_PTR)); + my_free(mysql->db); mysql->db=my_strdup(db,MYF(MY_WME)); DBUG_RETURN(0); } @@ -3029,32 +3027,32 @@ static void mysql_close_free_options(MYSQL *mysql) { DBUG_ENTER("mysql_close_free_options"); - my_free(mysql->options.user,MYF(MY_ALLOW_ZERO_PTR)); - my_free(mysql->options.host,MYF(MY_ALLOW_ZERO_PTR)); - my_free(mysql->options.password,MYF(MY_ALLOW_ZERO_PTR)); - my_free(mysql->options.unix_socket,MYF(MY_ALLOW_ZERO_PTR)); - my_free(mysql->options.db,MYF(MY_ALLOW_ZERO_PTR)); - my_free(mysql->options.my_cnf_file,MYF(MY_ALLOW_ZERO_PTR)); - my_free(mysql->options.my_cnf_group,MYF(MY_ALLOW_ZERO_PTR)); - my_free(mysql->options.charset_dir,MYF(MY_ALLOW_ZERO_PTR)); - my_free(mysql->options.charset_name,MYF(MY_ALLOW_ZERO_PTR)); - my_free(mysql->options.client_ip,MYF(MY_ALLOW_ZERO_PTR)); + my_free(mysql->options.user); + my_free(mysql->options.host); + my_free(mysql->options.password); + my_free(mysql->options.unix_socket); + my_free(mysql->options.db); + my_free(mysql->options.my_cnf_file); + my_free(mysql->options.my_cnf_group); + my_free(mysql->options.charset_dir); + my_free(mysql->options.charset_name); + my_free(mysql->options.client_ip); if (mysql->options.init_commands) { DYNAMIC_ARRAY *init_commands= mysql->options.init_commands; char **ptr= (char**)init_commands->buffer; char **end= ptr + init_commands->elements; for (; ptroptions.shared_memory_base_name != def_shared_memory_base_name) - my_free(mysql->options.shared_memory_base_name,MYF(MY_ALLOW_ZERO_PTR)); + my_free(mysql->options.shared_memory_base_name); #endif /* HAVE_SMEM */ bzero((char*) &mysql->options,sizeof(mysql->options)); DBUG_VOID_RETURN; @@ -3063,12 +3061,12 @@ static void mysql_close_free_options(MYSQL *mysql) static void mysql_close_free(MYSQL *mysql) { - my_free((uchar*) mysql->host_info,MYF(MY_ALLOW_ZERO_PTR)); - my_free(mysql->user,MYF(MY_ALLOW_ZERO_PTR)); - my_free(mysql->passwd,MYF(MY_ALLOW_ZERO_PTR)); - my_free(mysql->db,MYF(MY_ALLOW_ZERO_PTR)); + my_free(mysql->host_info); + my_free(mysql->user); + my_free(mysql->passwd); + my_free(mysql->db); #if defined(EMBEDDED_LIBRARY) || MYSQL_VERSION_ID >= 50100 - my_free(mysql->info_buffer,MYF(MY_ALLOW_ZERO_PTR)); + my_free(mysql->info_buffer); mysql->info_buffer= 0; #endif /* Clear pointers for better safety */ @@ -3176,7 +3174,7 @@ void STDCALL mysql_close(MYSQL *mysql) (*mysql->methods->free_embedded_thd)(mysql); #endif if (mysql->free_me) - my_free((uchar*) mysql,MYF(0)); + my_free(mysql); } DBUG_VOID_RETURN; } @@ -3313,7 +3311,7 @@ MYSQL_RES * STDCALL mysql_store_result(MYSQL *mysql) if (!(result->data= (*mysql->methods->read_rows)(mysql,mysql->fields,mysql->field_count))) { - my_free((uchar*) result,MYF(0)); + my_free(result); DBUG_RETURN(0); } mysql->affected_rows= result->row_count= result->data->rows; @@ -3361,7 +3359,7 @@ static MYSQL_RES * cli_use_result(MYSQL *mysql) if (!(result->row=(MYSQL_ROW) my_malloc(sizeof(result->row[0])*(mysql->field_count+1), MYF(MY_WME)))) { /* Ptrs: to one row */ - my_free((uchar*) result,MYF(0)); + my_free(result); DBUG_RETURN(0); } result->fields= mysql->fields; @@ -3482,19 +3480,19 @@ mysql_options(MYSQL *mysql,enum mysql_option option, const void *arg) add_init_command(&mysql->options,arg); break; case MYSQL_READ_DEFAULT_FILE: - my_free(mysql->options.my_cnf_file,MYF(MY_ALLOW_ZERO_PTR)); + my_free(mysql->options.my_cnf_file); mysql->options.my_cnf_file=my_strdup(arg,MYF(MY_WME)); break; case MYSQL_READ_DEFAULT_GROUP: - my_free(mysql->options.my_cnf_group,MYF(MY_ALLOW_ZERO_PTR)); + my_free(mysql->options.my_cnf_group); mysql->options.my_cnf_group=my_strdup(arg,MYF(MY_WME)); break; case MYSQL_SET_CHARSET_DIR: - my_free(mysql->options.charset_dir,MYF(MY_ALLOW_ZERO_PTR)); + my_free(mysql->options.charset_dir); mysql->options.charset_dir=my_strdup(arg,MYF(MY_WME)); break; case MYSQL_SET_CHARSET_NAME: - my_free(mysql->options.charset_name,MYF(MY_ALLOW_ZERO_PTR)); + my_free(mysql->options.charset_name); mysql->options.charset_name=my_strdup(arg,MYF(MY_WME)); break; case MYSQL_OPT_PROTOCOL: @@ -3503,7 +3501,7 @@ mysql_options(MYSQL *mysql,enum mysql_option option, const void *arg) case MYSQL_SHARED_MEMORY_BASE_NAME: #ifdef HAVE_SMEM if (mysql->options.shared_memory_base_name != def_shared_memory_base_name) - my_free(mysql->options.shared_memory_base_name,MYF(MY_ALLOW_ZERO_PTR)); + my_free(mysql->options.shared_memory_base_name); mysql->options.shared_memory_base_name=my_strdup(arg,MYF(MY_WME)); #endif break; diff --git a/sql/debug_sync.cc b/sql/debug_sync.cc index dde6267331f..74e5b2c70f3 100644 --- a/sql/debug_sync.cc +++ b/sql/debug_sync.cc @@ -626,7 +626,7 @@ void debug_sync_end_thread(THD *thd) action->wait_for.free(); action->sync_point.free(); } - my_free(ds_control->ds_action, MYF(0)); + my_free(ds_control->ds_action); } /* Statistics. */ @@ -637,7 +637,7 @@ void debug_sync_end_thread(THD *thd) debug_sync_global.dsp_max_active= ds_control->dsp_max_active; mysql_mutex_unlock(&debug_sync_global.ds_mutex); - my_free(ds_control, MYF(0)); + my_free(ds_control); thd->debug_sync_control= NULL; } diff --git a/sql/derror.cc b/sql/derror.cc index 7f1435e89c1..bf8c589a65f 100644 --- a/sql/derror.cc +++ b/sql/derror.cc @@ -79,7 +79,7 @@ bool init_errmessage(void) /* Register messages for use with my_error(). */ if (my_error_register(get_server_errmsgs, ER_ERROR_FIRST, ER_ERROR_LAST)) { - x_free((uchar*) errmsgs); + my_free(errmsgs); DBUG_RETURN(TRUE); } @@ -155,7 +155,8 @@ Check that the above file is the right version for this program!", DBUG_RETURN(1); } - x_free((uchar*) *point); /* Free old language */ + /* Free old language */ + my_free(*point); if (!(*point= (const char**) my_malloc((size_t) (length+count*sizeof(char*)),MYF(0)))) { diff --git a/sql/event_data_objects.cc b/sql/event_data_objects.cc index c778d72a016..dd1845b29bc 100644 --- a/sql/event_data_objects.cc +++ b/sql/event_data_objects.cc @@ -176,7 +176,7 @@ Event_queue_element_for_exec::init(LEX_STRING db, LEX_STRING n) return TRUE; if (!(name.str= my_strndup(n.str, name.length= n.length, MYF(MY_WME)))) { - my_free((uchar*) dbname.str, MYF(0)); + my_free(dbname.str); return TRUE; } return FALSE; @@ -192,8 +192,8 @@ Event_queue_element_for_exec::init(LEX_STRING db, LEX_STRING n) Event_queue_element_for_exec::~Event_queue_element_for_exec() { - my_free((uchar*) dbname.str, MYF(0)); - my_free((uchar*) name.str, MYF(0)); + my_free(dbname.str); + my_free(name.str); } diff --git a/sql/event_scheduler.cc b/sql/event_scheduler.cc index c646642dbba..aa4d376d86e 100755 --- a/sql/event_scheduler.cc +++ b/sql/event_scheduler.cc @@ -238,7 +238,7 @@ event_scheduler_thread(void *arg) res= post_init_event_thread(thd); DBUG_ENTER("event_scheduler_thread"); - my_free((char*)arg, MYF(0)); + my_free(arg); if (!res) scheduler->run(thd); diff --git a/sql/examples/CMakeLists.txt b/sql/examples/CMakeLists.txt index 1a22e9a3efd..3c5cc23ec3b 100755 --- a/sql/examples/CMakeLists.txt +++ b/sql/examples/CMakeLists.txt @@ -13,8 +13,8 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") -SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") +SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFE_MUTEX") +SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFE_MUTEX") INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/sql ${CMAKE_SOURCE_DIR}/extra/yassl/include diff --git a/sql/filesort.cc b/sql/filesort.cc index 3f3dc4e1e3e..af9387c3129 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -264,7 +264,7 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length, { if (table_sort.buffpek && table_sort.buffpek_len < maxbuffer) { - x_free(table_sort.buffpek); + my_free(table_sort.buffpek); table_sort.buffpek= 0; } if (!(table_sort.buffpek= @@ -304,13 +304,12 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length, error =0; err: - if (param.tmp_buffer) - x_free(param.tmp_buffer); + my_free(param.tmp_buffer); if (!subselect || !subselect->is_uncacheable()) { - x_free((uchar*) sort_keys); + my_free(sort_keys); table_sort.sort_keys= 0; - x_free((uchar*) buffpek); + my_free(buffpek); table_sort.buffpek= 0; table_sort.buffpek_len= 0; } @@ -347,32 +346,22 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length, void filesort_free_buffers(TABLE *table, bool full) { - if (table->sort.record_pointers) - { - my_free((uchar*) table->sort.record_pointers,MYF(0)); - table->sort.record_pointers=0; - } + my_free(table->sort.record_pointers); + table->sort.record_pointers= NULL; + if (full) { - if (table->sort.sort_keys ) - { - x_free((uchar*) table->sort.sort_keys); - table->sort.sort_keys= 0; - } - if (table->sort.buffpek) - { - x_free((uchar*) table->sort.buffpek); - table->sort.buffpek= 0; - table->sort.buffpek_len= 0; - } - } - if (table->sort.addon_buf) - { - my_free((char *) table->sort.addon_buf, MYF(0)); - my_free((char *) table->sort.addon_field, MYF(MY_ALLOW_ZERO_PTR)); - table->sort.addon_buf=0; - table->sort.addon_field=0; + my_free(table->sort.sort_keys); + table->sort.sort_keys= NULL; + my_free(table->sort.buffpek); + table->sort.buffpek= NULL; + table->sort.buffpek_len= NULL; } + + my_free(table->sort.addon_buf); + my_free(table->sort.addon_field); + table->sort.addon_buf= NULL; + table->sort.addon_field= NULL; } /** Make a array of string pointers. */ @@ -413,7 +402,7 @@ static uchar *read_buffpek_from_file(IO_CACHE *buffpek_pointers, uint count, if (reinit_io_cache(buffpek_pointers,READ_CACHE,0L,0,0) || my_b_read(buffpek_pointers, (uchar*) tmp, length)) { - my_free((char*) tmp, MYF(0)); + my_free(tmp); tmp=0; } } diff --git a/sql/gstream.h b/sql/gstream.h index 65acc2ff193..6bb3c9bac10 100644 --- a/sql/gstream.h +++ b/sql/gstream.h @@ -45,7 +45,7 @@ public: {} ~Gis_read_stream() { - my_free((uchar*) m_err_msg, MYF(MY_ALLOW_ZERO_PTR)); + my_free(m_err_msg); } enum enum_tok_types get_next_toc_type(); diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 68b98c79a50..ecf2984a4c0 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -1035,7 +1035,7 @@ int get_ndb_blobs_value(TABLE* table, NdbValue* value_array, } if (loop == 0 && offset > buffer_size) { - my_free(buffer, MYF(MY_ALLOW_ZERO_PTR)); + my_free(buffer); buffer_size= 0; DBUG_PRINT("info", ("allocate blobs buffer size %u", offset)); buffer= (uchar*) my_malloc(offset, MYF(MY_WME)); @@ -1188,8 +1188,8 @@ int ha_ndbcluster::get_metadata(const char *path) if (readfrm(path, &data, &length) || packfrm(data, length, &pack_data, &pack_length)) { - my_free(data, MYF(MY_ALLOW_ZERO_PTR)); - my_free(pack_data, MYF(MY_ALLOW_ZERO_PTR)); + my_free(data); + my_free(pack_data); DBUG_RETURN(1); } @@ -1208,8 +1208,8 @@ int ha_ndbcluster::get_metadata(const char *path) DBUG_DUMP("frm", (uchar*) tab->getFrmData(), tab->getFrmLength()); error= HA_ERR_TABLE_DEF_CHANGED; } - my_free((char*)data, MYF(0)); - my_free((char*)pack_data, MYF(0)); + my_free(data); + my_free(pack_data); if (error) goto err; @@ -1235,7 +1235,7 @@ static int fix_unique_index_attr_order(NDB_INDEX_DATA &data, unsigned sz= index->getNoOfIndexColumns(); if (data.unique_index_attrid_map) - my_free((char*)data.unique_index_attrid_map, MYF(0)); + my_free(data.unique_index_attrid_map); data.unique_index_attrid_map= (uchar*)my_malloc(sz,MYF(MY_WME)); if (data.unique_index_attrid_map == 0) { @@ -1313,7 +1313,7 @@ static void ndb_clear_index(NDB_INDEX_DATA &data) { if (data.unique_index_attrid_map) { - my_free((char*)data.unique_index_attrid_map, MYF(0)); + my_free(data.unique_index_attrid_map); } if (data.index_stat) { @@ -5399,15 +5399,15 @@ int ha_ndbcluster::create(const char *name, DBUG_RETURN(1); if (packfrm(data, length, &pack_data, &pack_length)) { - my_free((char*)data, MYF(0)); + my_free(data); DBUG_RETURN(2); } DBUG_PRINT("info", ("setFrm data: 0x%lx len: %lu", (long) pack_data, (ulong) pack_length)); tab.setFrm(pack_data, pack_length); - my_free((char*)data, MYF(0)); - my_free((char*)pack_data, MYF(0)); + my_free(data); + my_free(pack_data); /* Check for disk options @@ -5751,8 +5751,8 @@ int ha_ndbcluster::create_handler_files(const char *file, packfrm(data, length, &pack_data, &pack_length)) { DBUG_PRINT("info", ("Missing frm for %s", m_tabname)); - my_free((char*)data, MYF(MY_ALLOW_ZERO_PTR)); - my_free((char*)pack_data, MYF(MY_ALLOW_ZERO_PTR)); + my_free(data); + my_free(pack_data); error= 1; } else @@ -5766,8 +5766,8 @@ int ha_ndbcluster::create_handler_files(const char *file, set_ndb_err(current_thd, dict->getNdbError()); error= ndb_to_mysql_error(&dict->getNdbError()); } - my_free((char*)data, MYF(MY_ALLOW_ZERO_PTR)); - my_free((char*)pack_data, MYF(MY_ALLOW_ZERO_PTR)); + my_free(data); + my_free(pack_data); } set_ndb_share_state(m_share, NSS_INITIAL); @@ -6565,7 +6565,7 @@ ha_ndbcluster::~ha_ndbcluster() free_share(&m_share); } release_metadata(thd, ndb); - my_free(m_blobs_buffer, MYF(MY_ALLOW_ZERO_PTR)); + my_free(m_blobs_buffer); m_blobs_buffer= 0; // Check for open cursor/transaction @@ -6911,7 +6911,7 @@ int ndbcluster_discover(handlerton *hton, THD* thd, const char *db, DBUG_RETURN(0); err: - my_free((char*)data, MYF(MY_ALLOW_ZERO_PTR)); + my_free(data); if (share) { /* ndb_share reference temporary free */ @@ -7177,8 +7177,8 @@ int ndbcluster_find_all_files(THD *thd) free_share(&share); } } - my_free((char*) data, MYF(MY_ALLOW_ZERO_PTR)); - my_free((char*) pack_data, MYF(MY_ALLOW_ZERO_PTR)); + my_free(data); + my_free(pack_data); mysql_mutex_lock(&LOCK_open); if (discover) @@ -8681,7 +8681,7 @@ NDB_SHARE *ndbcluster_get_share(const char *key, TABLE *table, if (my_hash_insert(&ndbcluster_open_tables, (uchar*) share)) { free_root(&share->mem_root, MYF(0)); - my_free((uchar*) share, 0); + my_free(share); *root_ptr= old_root; if (!have_lock) mysql_mutex_unlock(&ndbcluster_mutex); @@ -8752,7 +8752,7 @@ void ndbcluster_real_free_share(NDB_SHARE **share) } #endif free_root(&(*share)->mem_root, MYF(0)); - my_free((uchar*) *share, MYF(0)); + my_free(*share); *share= 0; dbug_print_open_tables(); @@ -10076,7 +10076,7 @@ int ha_ndbcluster::set_range_data(void *tab_ref, partition_info *part_info) } tab->setRangeListData(range_data, sizeof(int32)*part_info->num_parts); error: - my_free((char*)range_data, MYF(0)); + my_free(range_data); DBUG_RETURN(error); } @@ -10113,7 +10113,7 @@ int ha_ndbcluster::set_list_data(void *tab_ref, partition_info *part_info) } tab->setRangeListData(list_data, 2*sizeof(int32)*part_info->num_list_values); error: - my_free((char*)list_data, MYF(0)); + my_free(list_data); DBUG_RETURN(error); } diff --git a/sql/ha_ndbcluster_binlog.cc b/sql/ha_ndbcluster_binlog.cc index ab046164485..4f8bb66fcb0 100644 --- a/sql/ha_ndbcluster_binlog.cc +++ b/sql/ha_ndbcluster_binlog.cc @@ -1020,7 +1020,7 @@ static void ndbcluster_get_schema(NDB_SHARE *share, ptrdiff); if (ret != 0) { - my_free(blobs_buffer, MYF(MY_ALLOW_ZERO_PTR)); + my_free(blobs_buffer); DBUG_PRINT("info", ("blob read error")); DBUG_ASSERT(FALSE); } @@ -1071,7 +1071,7 @@ static void ndbcluster_get_schema(NDB_SHARE *share, field++; s->type= ((Field_long *)*field)->val_int(); /* free blobs buffer */ - my_free(blobs_buffer, MYF(MY_ALLOW_ZERO_PTR)); + my_free(blobs_buffer); dbug_tmp_restore_column_map(table->read_set, old_map); } @@ -1739,7 +1739,7 @@ ndb_handle_schema_change(THD *thd, Ndb *ndb, NdbEventOperation *pOp, old->getObjectVersion() != altered_table->getObjectVersion()) dict->putTable(altered_table); - my_free((char*)data, MYF(MY_ALLOW_ZERO_PTR)); + my_free(data); data= NULL; if ((error= unpackfrm(&data, &length, (const uchar*) altered_table->getFrmData())) || @@ -1772,8 +1772,8 @@ ndb_handle_schema_change(THD *thd, Ndb *ndb, NdbEventOperation *pOp, mysql_mutex_unlock(&LOCK_open); } - my_free((char*)data, MYF(MY_ALLOW_ZERO_PTR)); - my_free((char*)pack_data, MYF(MY_ALLOW_ZERO_PTR)); + my_free(data); + my_free(pack_data); } // If only frm was changed continue replicating @@ -3507,8 +3507,8 @@ ndb_binlog_thread_handle_data_event(Ndb *ndb, NdbEventOperation *pOp, if (share->flags & NSF_BLOB_FLAG) { - my_free(blobs_buffer[0], MYF(MY_ALLOW_ZERO_PTR)); - my_free(blobs_buffer[1], MYF(MY_ALLOW_ZERO_PTR)); + my_free(blobs_buffer[0]); + my_free(blobs_buffer[1]); } return 0; @@ -3580,7 +3580,7 @@ static NDB_SCHEMA_OBJECT *ndb_get_schema_object(const char *key, ndb_schema_object->key_length= length; if (my_hash_insert(&ndb_schema_objects, (uchar*) ndb_schema_object)) { - my_free((uchar*) ndb_schema_object, 0); + my_free(ndb_schema_object); break; } mysql_mutex_init(key_ndb_schema_object_mutex, &ndb_schema_object->mutex, MY_MUTEX_INIT_FAST); @@ -3612,7 +3612,7 @@ static void ndb_free_schema_object(NDB_SCHEMA_OBJECT **ndb_schema_object, DBUG_PRINT("info", ("use_count: %d", (*ndb_schema_object)->use_count)); my_hash_delete(&ndb_schema_objects, (uchar*) *ndb_schema_object); mysql_mutex_destroy(&(*ndb_schema_object)->mutex); - my_free((uchar*) *ndb_schema_object, MYF(0)); + my_free(*ndb_schema_object); *ndb_schema_object= 0; } else diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 3fb5a30b560..90a4802082b 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -287,7 +287,7 @@ ha_partition::~ha_partition() for (i= 0; i < m_tot_parts; i++) delete m_file[i]; } - my_free((char*) m_ordered_rec_buffer, MYF(MY_ALLOW_ZERO_PTR)); + my_free(m_ordered_rec_buffer); clear_handler_file(); DBUG_VOID_RETURN; @@ -2267,7 +2267,7 @@ bool ha_partition::create_handler_file(const char *name) } else result= TRUE; - my_free((char*) file_buffer, MYF(0)); + my_free(file_buffer); DBUG_RETURN(result); } @@ -2285,8 +2285,8 @@ void ha_partition::clear_handler_file() { if (m_engine_array) plugin_unlock_list(NULL, m_engine_array, m_tot_parts); - my_free((char*) m_file_buffer, MYF(MY_ALLOW_ZERO_PTR)); - my_free((char*) m_engine_array, MYF(MY_ALLOW_ZERO_PTR)); + my_free(m_file_buffer); + my_free(m_engine_array); m_file_buffer= NULL; m_engine_array= NULL; } @@ -2495,7 +2495,7 @@ bool ha_partition::get_from_handler_file(const char *name, MEM_ROOT *mem_root) err3: my_afree((gptr) engine_array); err2: - my_free(file_buffer, MYF(0)); + my_free(file_buffer); err1: (void) mysql_file_close(file, MYF(0)); DBUG_RETURN(TRUE); diff --git a/sql/handler.cc b/sql/handler.cc index 587490dd708..b42840c7b1b 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -392,7 +392,7 @@ static int ha_finish_errors(void) /* Allocate a pointer array for the error message strings. */ if (! (errmsgs= my_error_unregister(HA_ERR_FIRST, HA_ERR_LAST))) return 1; - my_free((uchar*) errmsgs, MYF(0)); + my_free(errmsgs); return 0; } @@ -447,7 +447,7 @@ int ha_finalize_handlerton(st_plugin_int *plugin) hton2plugin[hton->slot]= NULL; } - my_free((uchar*)hton, MYF(0)); + my_free(hton); end: DBUG_RETURN(0); @@ -580,7 +580,7 @@ err_deinit: (void) plugin->plugin->deinit(NULL); err: - my_free((uchar*) hton, MYF(0)); + my_free(hton); err_no_hton_memory: plugin->data= NULL; DBUG_RETURN(1); @@ -1630,7 +1630,7 @@ int ha_recover(HASH *commit_list) plugin_foreach(NULL, xarecover_handlerton, MYSQL_STORAGE_ENGINE_PLUGIN, &info); - my_free((uchar*)info.list, MYF(0)); + my_free(info.list); if (info.found_foreign_xids) sql_print_warning("Found %d prepared XA transactions", info.found_foreign_xids); @@ -3658,7 +3658,7 @@ int ha_create_table_from_engine(THD* thd, const char *db, const char *name) build_table_filename(path, sizeof(path) - 1, db, name, "", 0); // Save the frm file error= writefrm(path, frmblob, frmlen); - my_free(frmblob, MYF(0)); + my_free(frmblob); if (error) DBUG_RETURN(2); @@ -4865,7 +4865,7 @@ int fl_log_iterator_next(struct handler_iterator *iterator, void fl_log_iterator_destroy(struct handler_iterator *iterator) { - my_free((uchar*)iterator->buffer, MYF(MY_ALLOW_ZERO_PTR)); + my_free(iterator->buffer); } diff --git a/sql/handler.h b/sql/handler.h index fc49d9e647d..5e08ed23bef 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -458,11 +458,7 @@ typedef struct xid_t XID; /* for recover() handlerton call */ #define MIN_XID_LIST_SIZE 128 -#ifdef SAFEMALLOC -#define MAX_XID_LIST_SIZE 256 -#else #define MAX_XID_LIST_SIZE (1024*128) -#endif /* These structures are used to pass information from a set of SQL commands diff --git a/sql/item_func.cc b/sql/item_func.cc index efa14c8498b..2d5848e314e 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -3560,7 +3560,7 @@ public: { if (my_hash_insert(&hash_user_locks,(uchar*) this)) { - my_free(key,MYF(0)); + my_free(key); key=0; } } @@ -3570,7 +3570,7 @@ public: if (key) { my_hash_delete(&hash_user_locks,(uchar*) this); - my_free(key, MYF(0)); + my_free(key); } mysql_cond_destroy(&cond); } @@ -4079,7 +4079,7 @@ static user_var_entry *get_variable(HASH *hash, LEX_STRING &name, memcpy(entry->name.str, name.str, name.length+1); if (my_hash_insert(hash,(uchar*) entry)) { - my_free((char*) entry,MYF(0)); + my_free(entry); return 0; } } @@ -4217,7 +4217,7 @@ update_hash(user_var_entry *entry, bool set_null, void *ptr, uint length, { char *pos= (char*) entry+ ALIGN_SIZE(sizeof(user_var_entry)); if (entry->value && entry->value != pos) - my_free(entry->value,MYF(0)); + my_free(entry->value); entry->value= 0; entry->length= 0; } @@ -4232,7 +4232,7 @@ update_hash(user_var_entry *entry, bool set_null, void *ptr, uint length, if (entry->value != pos) { if (entry->value) - my_free(entry->value,MYF(0)); + my_free(entry->value); entry->value=pos; } } diff --git a/sql/keycaches.cc b/sql/keycaches.cc index d68e2bccd96..14551803cfc 100644 --- a/sql/keycaches.cc +++ b/sql/keycaches.cc @@ -44,7 +44,7 @@ public: } ~NAMED_ILINK() { - my_free((uchar*) name, MYF(0)); + my_free((void *) name); } }; @@ -104,7 +104,7 @@ KEY_CACHE *create_key_cache(const char *name, uint length) { if (!new NAMED_ILINK(&key_caches, name, length, (uchar*) key_cache)) { - my_free((char*) key_cache, MYF(0)); + my_free(key_cache); key_cache= 0; } else @@ -140,7 +140,7 @@ KEY_CACHE *get_or_create_key_cache(const char *name, uint length) void free_key_cache(const char *name, KEY_CACHE *key_cache) { end_key_cache(key_cache, 1); // Can never fail - my_free((char*) key_cache, MYF(0)); + my_free(key_cache); } diff --git a/sql/lock.cc b/sql/lock.cc index 52d97a2422b..0743120ec6b 100644 --- a/sql/lock.cc +++ b/sql/lock.cc @@ -262,7 +262,7 @@ static void reset_lock_data(MYSQL_LOCK *sql_lock) static void reset_lock_data_and_free(MYSQL_LOCK **mysql_lock) { reset_lock_data(*mysql_lock); - my_free(*mysql_lock, MYF(0)); + my_free(*mysql_lock); *mysql_lock= 0; } @@ -384,7 +384,7 @@ void mysql_unlock_tables(THD *thd, MYSQL_LOCK *sql_lock) thr_multi_unlock(sql_lock->locks,sql_lock->lock_count); if (sql_lock->table_count) (void) unlock_external(thd,sql_lock->table,sql_lock->table_count); - my_free((uchar*) sql_lock,MYF(0)); + my_free(sql_lock); DBUG_VOID_RETURN; } @@ -545,7 +545,7 @@ void mysql_lock_abort(THD *thd, TABLE *table, bool upgrade_lock) { for (uint i=0; i < locked->lock_count; i++) thr_abort_locks(locked->locks[i]->lock, upgrade_lock); - my_free((uchar*) locked,MYF(0)); + my_free(locked); } DBUG_VOID_RETURN; } @@ -577,7 +577,7 @@ bool mysql_lock_abort_for_thread(THD *thd, TABLE *table) table->in_use->thread_id)) result= TRUE; } - my_free((uchar*) locked,MYF(0)); + my_free(locked); } DBUG_RETURN(result); } @@ -619,8 +619,8 @@ MYSQL_LOCK *mysql_lock_merge(MYSQL_LOCK *a,MYSQL_LOCK *b) } /* Delete old, not needed locks */ - my_free((uchar*) a,MYF(0)); - my_free((uchar*) b,MYF(0)); + my_free(a); + my_free(b); thr_lock_merge_status(sql_lock->locks, sql_lock->lock_count); DBUG_RETURN(sql_lock); diff --git a/sql/log.cc b/sql/log.cc index 0ac61513d22..521cedffc81 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -1501,7 +1501,7 @@ static int binlog_close_connection(handlerton *hton, THD *thd) DBUG_ASSERT(cache_mngr->trx_cache.empty() && cache_mngr->stmt_cache.empty()); thd_set_ha_data(thd, binlog_hton, NULL); cache_mngr->~binlog_cache_mngr(); - my_free((uchar*)cache_mngr, MYF(0)); + my_free(cache_mngr); return 0; } @@ -2245,7 +2245,8 @@ shutdown the MySQL server and restart it.", name, errno); if (file >= 0) mysql_file_close(file, MYF(0)); end_io_cache(&log_file); - safeFree(name); + my_free(name); + name= NULL; log_state= LOG_CLOSED; DBUG_RETURN(1); } @@ -2306,7 +2307,8 @@ void MYSQL_LOG::close(uint exiting) } log_state= (exiting & LOG_CLOSE_TO_BE_OPENED) ? LOG_TO_BE_OPENED : LOG_CLOSED; - safeFree(name); + my_free(name); + name= NULL; DBUG_VOID_RETURN; } @@ -2384,7 +2386,7 @@ void MYSQL_QUERY_LOG::reopen_file() */ open(save_name, log_type, 0, io_cache_type); - my_free(save_name, MYF(0)); + my_free(save_name); mysql_mutex_unlock(&LOCK_log); @@ -2985,7 +2987,8 @@ shutdown the MySQL server and restart it.", name, errno); mysql_file_close(file, MYF(0)); end_io_cache(&log_file); end_io_cache(&index_file); - safeFree(name); + my_free(name); + name= NULL; log_state= LOG_CLOSED; DBUG_RETURN(1); } @@ -3318,7 +3321,7 @@ bool MYSQL_BIN_LOG::reset_logs(THD* thd) need_start_event=1; if (!open_index_file(index_file_name, 0, FALSE)) open(save_name, log_type, 0, io_cache_type, no_auto_events, max_size, 0, FALSE); - my_free((uchar*) save_name, MYF(0)); + my_free((void *) save_name); err: if (error == 1) @@ -3456,7 +3459,7 @@ int MYSQL_BIN_LOG::purge_first_log(Relay_log_info* rli, bool included) DBUG_ASSERT(!included || rli->linfo.index_file_start_offset == 0); err: - my_free(to_purge_if_included, MYF(0)); + my_free(to_purge_if_included); mysql_mutex_unlock(&LOCK_index); DBUG_RETURN(error); } @@ -4096,7 +4099,7 @@ void MYSQL_BIN_LOG::new_file_impl(bool need_lock) if (!open_index_file(index_file_name, 0, FALSE)) open(old_name, log_type, new_name_ptr, io_cache_type, no_auto_events, max_size, 1, FALSE); - my_free(old_name,MYF(0)); + my_free(old_name); end: if (need_lock) @@ -4354,7 +4357,7 @@ int THD::binlog_setup_trx_data() open_cached_file(&cache_mngr->trx_cache.cache_log, mysql_tmpdir, LOG_PREFIX, binlog_cache_size, MYF(MY_WME))) { - my_free((uchar*)cache_mngr, MYF(MY_ALLOW_ZERO_PTR)); + my_free(cache_mngr); DBUG_RETURN(1); // Didn't manage to set it up } thd_set_ha_data(this, binlog_hton, cache_mngr); @@ -5361,7 +5364,8 @@ void MYSQL_BIN_LOG::close(uint exiting) } } log_state= (exiting & LOG_CLOSE_TO_BE_OPENED) ? LOG_TO_BE_OPENED : LOG_CLOSED; - safeFree(name); + my_free(name); + name= NULL; DBUG_VOID_RETURN; } @@ -6052,7 +6056,7 @@ void TC_LOG_MMAP::close() mysql_cond_destroy(&pages[i].cond); } case 3: - my_free((uchar*)pages, MYF(0)); + my_free(pages); case 2: my_munmap((char*)data, (size_t)file_length); case 1: diff --git a/sql/log_event.cc b/sql/log_event.cc index 606f5945a07..52275a4b6bd 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -1149,7 +1149,7 @@ err: sql_print_error("Error in Log_event::read_log_event(): " "'%s', data_len: %d, event_type: %d", error,data_len,head[EVENT_TYPE_OFFSET]); - my_free(buf, MYF(MY_ALLOW_ZERO_PTR)); + my_free(buf); /* The SQL slave thread will check if file->error<0 to know if there was an I/O error. Even if there is no "low-level" I/O errors @@ -2066,7 +2066,7 @@ void Log_event::print_base64(IO_CACHE* file, } } - my_free(tmp_str, MYF(0)); + my_free(tmp_str); DBUG_VOID_RETURN; } @@ -2146,7 +2146,7 @@ void Query_log_event::pack_info(Protocol *protocol) pos+= q_len; } protocol->store(buf, pos-buf, &my_charset_bin); - my_free(buf, MYF(MY_ALLOW_ZERO_PTR)); + my_free(buf); } #endif @@ -3965,7 +3965,7 @@ Format_description_log_event(const char* buf, DBUG_PRINT("info", (" number_of_event_types=%d", number_of_event_types)); /* this makes is_valid() return false. */ - my_free(post_header_len, MYF(MY_ALLOW_ZERO_PTR)); + my_free(post_header_len); post_header_len= NULL; DBUG_VOID_RETURN; } @@ -4288,7 +4288,7 @@ void Load_log_event::pack_info(Protocol *protocol) return; print_query(TRUE, NULL, buf, &end, 0, 0); protocol->store(buf, end-buf, &my_charset_bin); - my_free(buf, MYF(0)); + my_free(buf); } #endif /* defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) */ @@ -5557,7 +5557,7 @@ void User_var_log_event::pack_info(Protocol* protocol) buf[2+name_len]= '`'; buf[3+name_len]= '='; protocol->store(buf, event_len, &my_charset_bin); - my_free(buf, MYF(0)); + my_free(buf); } #endif /* !MYSQL_CLIENT */ @@ -5972,7 +5972,7 @@ Slave_log_event::Slave_log_event(THD* thd_arg, Slave_log_event::~Slave_log_event() { - my_free(mem_pool, MYF(MY_ALLOW_ZERO_PTR)); + my_free(mem_pool); } @@ -6794,7 +6794,7 @@ int Execute_load_log_event::do_apply_event(Relay_log_info const *rli) { rli->report(ERROR_LEVEL, rli->last_error().number, "%s. Failed executing load from '%s'", tmp, fname); - my_free(tmp,MYF(0)); + my_free(tmp); } goto err; } @@ -6999,7 +6999,7 @@ void Execute_load_query_log_event::pack_info(Protocol *protocol) pos= strmov(pos, " ;file_id="); pos= int10_to_str((long) file_id, pos, 10); protocol->store(buf, pos-buf, &my_charset_bin); - my_free(buf, MYF(MY_ALLOW_ZERO_PTR)); + my_free(buf); } @@ -7015,7 +7015,7 @@ Execute_load_query_log_event::do_apply_event(Relay_log_info const *rli) buf= (char*) my_malloc(q_len + 1 - (fn_pos_end - fn_pos_start) + (FN_REFLEN + 10) + 10 + 8 + 5, MYF(MY_WME)); - DBUG_EXECUTE_IF("LOAD_DATA_INFILE_has_fatal_error", my_free(buf, MYF(0)); buf= NULL;); + DBUG_EXECUTE_IF("LOAD_DATA_INFILE_has_fatal_error", my_free(buf); buf= NULL;); /* Replace filename and LOCAL keyword in query before executing it */ if (buf == NULL) @@ -7058,7 +7058,7 @@ Execute_load_query_log_event::do_apply_event(Relay_log_info const *rli) if (!error) mysql_file_delete(key_file_log_event_data, fname, MYF(MY_WME)); - my_free(buf, MYF(MY_ALLOW_ZERO_PTR)); + my_free(buf); return error; } #endif @@ -7323,7 +7323,7 @@ Rows_log_event::~Rows_log_event() if (m_cols.bitmap == m_bitbuf) // no my_malloc happened m_cols.bitmap= 0; // so no my_free in bitmap_free bitmap_free(&m_cols); // To pair with bitmap_init(). - my_free((uchar*)m_rows_buf, MYF(MY_ALLOW_ZERO_PTR)); + my_free(m_rows_buf); } int Rows_log_event::get_data_size() @@ -8247,8 +8247,8 @@ Table_map_log_event::Table_map_log_event(const char *buf, uint event_len, Table_map_log_event::~Table_map_log_event() { - my_free(m_meta_memory, MYF(MY_ALLOW_ZERO_PTR)); - my_free(m_memory, MYF(MY_ALLOW_ZERO_PTR)); + my_free(m_meta_memory); + my_free(m_memory); } /* @@ -8298,7 +8298,7 @@ int Table_map_log_event::do_apply_event(Relay_log_info const *rli) (!rpl_filter->db_ok(table_list->db) || (rpl_filter->is_on() && !rpl_filter->tables_ok("", table_list)))) { - my_free(memory, MYF(MY_WME)); + my_free(memory); } else { @@ -9353,7 +9353,7 @@ Delete_rows_log_event::do_after_row_operations(const Slave_reporting_capability { /*error= ToDo:find out what this should really be, this triggers close_scan in nbd, returning error?*/ m_table->file->ha_index_or_rnd_end(); - my_free(m_key, MYF(MY_ALLOW_ZERO_PTR)); + my_free(m_key); m_key= NULL; return error; @@ -9476,7 +9476,7 @@ Update_rows_log_event::do_after_row_operations(const Slave_reporting_capability { /*error= ToDo:find out what this should really be, this triggers close_scan in nbd, returning error?*/ m_table->file->ha_index_or_rnd_end(); - my_free(m_key, MYF(MY_ALLOW_ZERO_PTR)); // Free for multi_malloc + my_free(m_key); // Free for multi_malloc m_key= NULL; return error; diff --git a/sql/log_event.h b/sql/log_event.h index bd95c74b6c5..0119b11cc23 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -1031,7 +1031,7 @@ public: static void operator delete(void *ptr, size_t size) { - my_free((uchar*) ptr, MYF(MY_WME|MY_ALLOW_ZERO_PTR)); + my_free(ptr); } /* Placement version of the above operators */ @@ -1088,7 +1088,7 @@ public: { if (temp_buf) { - my_free(temp_buf, MYF(0)); + my_free(temp_buf); temp_buf = 0; } } @@ -1720,7 +1720,7 @@ public: ~Query_log_event() { if (data_buf) - my_free((uchar*) data_buf, MYF(0)); + my_free(data_buf); } Log_event_type get_type_code() { return QUERY_EVENT; } #ifdef MYSQL_SERVER @@ -2299,7 +2299,7 @@ public: *description_event); ~Format_description_log_event() { - my_free((uchar*)post_header_len, MYF(MY_ALLOW_ZERO_PTR)); + my_free(post_header_len); } Log_event_type get_type_code() { return FORMAT_DESCRIPTION_EVENT;} #ifdef MYSQL_SERVER @@ -2698,7 +2698,7 @@ public: ~Rotate_log_event() { if (flags & DUP_NAME) - my_free((uchar*) new_log_ident, MYF(MY_ALLOW_ZERO_PTR)); + my_free((void*) new_log_ident); } Log_event_type get_type_code() { return ROTATE_EVENT;} int get_data_size() { return ident_len + ROTATE_HEADER_LEN;} @@ -2760,7 +2760,7 @@ public: const Format_description_log_event* description_event); ~Create_file_log_event() { - my_free((char*) event_buf, MYF(MY_ALLOW_ZERO_PTR)); + my_free((void*) event_buf); } Log_event_type get_type_code() diff --git a/sql/log_event_old.cc b/sql/log_event_old.cc index d9b48cd134e..9263578e0b5 100644 --- a/sql/log_event_old.cc +++ b/sql/log_event_old.cc @@ -1017,7 +1017,7 @@ int Delete_rows_log_event_old::do_after_row_operations(TABLE *table, int error) { /*error= ToDo:find out what this should really be, this triggers close_scan in nbd, returning error?*/ table->file->ha_index_or_rnd_end(); - my_free(m_memory, MYF(MY_ALLOW_ZERO_PTR)); // Free for multi_malloc + my_free(m_memory); // Free for multi_malloc m_memory= NULL; m_after_image= NULL; m_key= NULL; @@ -1116,7 +1116,7 @@ int Update_rows_log_event_old::do_after_row_operations(TABLE *table, int error) { /*error= ToDo:find out what this should really be, this triggers close_scan in nbd, returning error?*/ table->file->ha_index_or_rnd_end(); - my_free(m_memory, MYF(MY_ALLOW_ZERO_PTR)); + my_free(m_memory); m_memory= NULL; m_after_image= NULL; m_key= NULL; @@ -1360,7 +1360,7 @@ Old_rows_log_event::~Old_rows_log_event() if (m_cols.bitmap == m_bitbuf) // no my_malloc happened m_cols.bitmap= 0; // so no my_free in bitmap_free bitmap_free(&m_cols); // To pair with bitmap_init(). - my_free((uchar*)m_rows_buf, MYF(MY_ALLOW_ZERO_PTR)); + my_free(m_rows_buf); } @@ -2698,7 +2698,7 @@ Delete_rows_log_event_old::do_after_row_operations(const Slave_reporting_capabil { /*error= ToDo:find out what this should really be, this triggers close_scan in nbd, returning error?*/ m_table->file->ha_index_or_rnd_end(); - my_free(m_key, MYF(MY_ALLOW_ZERO_PTR)); + my_free(m_key); m_key= NULL; return error; @@ -2797,7 +2797,7 @@ Update_rows_log_event_old::do_after_row_operations(const Slave_reporting_capabil { /*error= ToDo:find out what this should really be, this triggers close_scan in nbd, returning error?*/ m_table->file->ha_index_or_rnd_end(); - my_free(m_key, MYF(MY_ALLOW_ZERO_PTR)); // Free for multi_malloc + my_free(m_key); // Free for multi_malloc m_key= NULL; return error; diff --git a/sql/mdl.cc b/sql/mdl.cc index 184b3c6051d..0426a410d98 100644 --- a/sql/mdl.cc +++ b/sql/mdl.cc @@ -1935,7 +1935,7 @@ bool MDL_context::acquire_locks(MDL_request_list *mdl_requests, if (acquire_lock(*p_req, lock_wait_timeout)) goto err; } - my_free(sort_buf, MYF(0)); + my_free(sort_buf); return FALSE; err: @@ -1951,7 +1951,7 @@ err: { (*p_req)->ticket= NULL; } - my_free(sort_buf, MYF(0)); + my_free(sort_buf); return TRUE; } diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 28cad51aa41..35d6137789d 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -1523,7 +1523,7 @@ void clean_up(bool print_message) if (defaults_argv) free_defaults(defaults_argv); free_tmpdir(&mysql_tmpdir_list); - x_free(opt_bin_logname); + my_free(opt_bin_logname); bitmap_free(&temp_pool); free_max_user_conn(); #ifdef HAVE_REPLICATION @@ -3135,7 +3135,7 @@ void *my_str_malloc_mysqld(size_t size) void my_str_free_mysqld(void *ptr) { - my_free(ptr, MYF(MY_FAE)); + my_free(ptr); } #endif /* EMBEDDED_LIBRARY */ @@ -3708,7 +3708,7 @@ static int init_common_variables() #define FIX_LOG_VAR(VAR, ALT) \ if (!VAR || !*VAR) \ { \ - x_free(VAR); /* it could be an allocated empty string "" */ \ + my_free(VAR); /* it could be an allocated empty string "" */ \ VAR= my_strdup(ALT, MYF(0)); \ } @@ -4144,7 +4144,7 @@ a file name for --log-bin-index option", opt_binlog_index_name); } if (ln == buf) { - my_free(opt_bin_logname, MYF(MY_ALLOW_ZERO_PTR)); + my_free(opt_bin_logname); opt_bin_logname=my_strdup(buf, MYF(0)); } if (mysql_bin_log.open_index_file(opt_binlog_index_name, ln, TRUE)) @@ -5931,7 +5931,7 @@ errorconn: /* End shared memory handling */ error: if (tmp) - my_free(tmp, MYF(0)); + my_free(tmp); if (errmsg) { @@ -6231,14 +6231,6 @@ struct my_option my_long_options[]= "Don't allow new user creation by the user who has no write privileges to the mysql.user table.", &opt_safe_user_create, &opt_safe_user_create, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, -#if !defined(DBUG_OFF) && defined(SAFEMALLOC) - {"safemalloc", 0, "Enable the memory allocation checking.", - &sf_malloc_quick, &sf_malloc_quick, 0, - GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, - {"safemalloc-mem-limit", 0, "Simulate memory shortage.", - &sf_malloc_mem_limit, &sf_malloc_mem_limit, 0, GET_UINT, - REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, -#endif {"show-slave-auth-info", 0, "Show user and password in SHOW SLAVE HOSTS on this master.", &opt_show_slave_auth_info, &opt_show_slave_auth_info, 0, @@ -7867,7 +7859,7 @@ static int fix_paths(void) } char *secure_file_real_path= (char *)my_malloc(FN_REFLEN, MYF(MY_FAE)); convert_dirname(secure_file_real_path, buff, NullS); - my_free(opt_secure_file_priv, MYF(0)); + my_free(opt_secure_file_priv); opt_secure_file_priv= secure_file_real_path; } } diff --git a/sql/net_serv.cc b/sql/net_serv.cc index 918798529de..83435740ead 100644 --- a/sql/net_serv.cc +++ b/sql/net_serv.cc @@ -152,7 +152,7 @@ my_bool my_net_init(NET *net, Vio* vio) void net_end(NET *net) { DBUG_ENTER("net_end"); - my_free(net->buff,MYF(MY_ALLOW_ZERO_PTR)); + my_free(net->buff); net->buff=0; DBUG_VOID_RETURN; } @@ -696,7 +696,7 @@ net_real_write(NET *net,const uchar *packet, size_t len) #endif #ifdef HAVE_COMPRESS if (net->compress) - my_free((char*) packet,MYF(0)); + my_free((void*) packet); #endif if (thr_alarm_in_use(&alarmed)) { diff --git a/sql/opt_range.cc b/sql/opt_range.cc index f195da9ae02..48235ba588a 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -1091,7 +1091,7 @@ SQL_SELECT *make_select(TABLE *head, table_map const_tables, select->file= *head->sort.io_cache; select->records=(ha_rows) (select->file.end_of_file/ head->file->ref_length); - my_free(head->sort.io_cache, MYF(0)); + my_free(head->sort.io_cache); head->sort.io_cache=0; } DBUG_RETURN(select); @@ -1216,11 +1216,11 @@ QUICK_RANGE_SELECT::~QUICK_RANGE_SELECT() } delete_dynamic(&ranges); /* ranges are allocated in alloc */ free_root(&alloc,MYF(0)); - my_free((char*) column_bitmap.bitmap, MYF(MY_ALLOW_ZERO_PTR)); + my_free(column_bitmap.bitmap); } head->column_bitmaps_set(save_read_set, save_write_set); - x_free(multi_range); - x_free(multi_range_buff); + my_free(multi_range); + my_free(multi_range_buff); DBUG_VOID_RETURN; } @@ -8589,7 +8589,7 @@ int QUICK_RANGE_SELECT::reset() } if (! multi_range_buff) { - my_free((char*) multi_range, MYF(0)); + my_free(multi_range); multi_range= NULL; multi_range_length= 0; DBUG_RETURN(HA_ERR_OUT_OF_MEM); diff --git a/sql/records.cc b/sql/records.cc index 70b7cedb0a5..ccacdc33b36 100644 --- a/sql/records.cc +++ b/sql/records.cc @@ -293,7 +293,7 @@ void end_read_record(READ_RECORD *info) { /* free cache if used */ if (info->cache) { - my_free_lock((char*) info->cache,MYF(0)); + my_free_lock(info->cache); info->cache=0; } if (info->table) diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc index 81366d55fc6..9a1f7fb826b 100644 --- a/sql/repl_failsafe.cc +++ b/sql/repl_failsafe.cc @@ -205,7 +205,7 @@ int register_slave(THD* thd, uchar* packet, uint packet_length) return res; err: - my_free(si, MYF(MY_WME)); + my_free(si); my_message(ER_UNKNOWN_ERROR, errmsg, MYF(0)); /* purecov: inspected */ err2: return 1; @@ -221,7 +221,7 @@ extern "C" uint32 extern "C" void slave_info_free(void *s) { - my_free(s, MYF(MY_WME)); + my_free(s); } #ifdef HAVE_PSI_INTERFACE diff --git a/sql/rpl_filter.cc b/sql/rpl_filter.cc index 63521c0398f..42a9a034efd 100644 --- a/sql/rpl_filter.cc +++ b/sql/rpl_filter.cc @@ -383,7 +383,7 @@ void free_table_ent(void* a) { TABLE_RULE_ENT *e= (TABLE_RULE_ENT *) a; - my_free((uchar*) e, MYF(0)); + my_free(e); } @@ -434,7 +434,7 @@ Rpl_filter::free_string_array(DYNAMIC_ARRAY *a) { char* p; get_dynamic(a, (uchar*) &p, i); - my_free(p, MYF(MY_WME)); + my_free(p); } delete_dynamic(a); } diff --git a/sql/rpl_handler.cc b/sql/rpl_handler.cc index be0a61bcae2..55418cbec84 100644 --- a/sql/rpl_handler.cc +++ b/sql/rpl_handler.cc @@ -213,7 +213,7 @@ int Trans_delegate::after_commit(THD *thd, bool all) if (is_real_trans && log_info) { my_pthread_setspecific_ptr(RPL_TRANS_BINLOG_INFO, NULL); - my_free(log_info, MYF(0)); + my_free(log_info); } return ret; } @@ -241,7 +241,7 @@ int Trans_delegate::after_rollback(THD *thd, bool all) if (is_real_trans && log_info) { my_pthread_setspecific_ptr(RPL_TRANS_BINLOG_INFO, NULL); - my_free(log_info, MYF(0)); + my_free(log_info); } return ret; } diff --git a/sql/rpl_injector.cc b/sql/rpl_injector.cc index 0f636f5b2ab..75ccb617e9e 100644 --- a/sql/rpl_injector.cc +++ b/sql/rpl_injector.cc @@ -58,7 +58,7 @@ injector::transaction::~transaction() */ *the_memory= '\0'; - my_free(the_memory, MYF(0)); + my_free(the_memory); } /** diff --git a/sql/rpl_mi.cc b/sql/rpl_mi.cc index 443af94e0d0..308f6d7f06e 100644 --- a/sql/rpl_mi.cc +++ b/sql/rpl_mi.cc @@ -520,7 +520,7 @@ int flush_master_info(Master_info* mi, (int)(mi->ssl), mi->ssl_ca, mi->ssl_capath, mi->ssl_cert, mi->ssl_cipher, mi->ssl_key, mi->ssl_verify_server_cert, heartbeat_buf, "", ignore_server_ids_buf); - my_free(ignore_server_ids_buf, MYF(0)); + my_free(ignore_server_ids_buf); err= flush_io_cache(file); if (sync_masterinfo_period && !err && ++(mi->sync_counter) >= sync_masterinfo_period) diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc index 8f070c51410..08377fe887d 100644 --- a/sql/rpl_rli.cc +++ b/sql/rpl_rli.cc @@ -1251,7 +1251,7 @@ void Relay_log_info::clear_tables_to_lock() tables_to_lock= static_cast(tables_to_lock->next_global); tables_to_lock_count--; - my_free(to_free, MYF(MY_WME)); + my_free(to_free); } DBUG_ASSERT(tables_to_lock == NULL && tables_to_lock_count == 0); } diff --git a/sql/rpl_utility.cc b/sql/rpl_utility.cc index 0675e9b51ad..2c6a9e5d9b9 100644 --- a/sql/rpl_utility.cc +++ b/sql/rpl_utility.cc @@ -1047,7 +1047,7 @@ table_def::table_def(unsigned char *types, ulong size, table_def::~table_def() { - my_free(m_memory, MYF(0)); + my_free(m_memory); #ifndef DBUG_OFF m_type= 0; m_size= 0; diff --git a/sql/slave.cc b/sql/slave.cc index bcb01d77e15..58b23c44bc7 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -1154,7 +1154,7 @@ int init_dynarray_intvar_from_file(DYNAMIC_ARRAY* arr, IO_CACHE* f) } err: if (buf_act != buf) - my_free(buf_act, MYF(0)); + my_free(buf_act); DBUG_RETURN(ret); } @@ -3686,7 +3686,7 @@ static int queue_binlog_ver_1_event(Master_info *mi, const char *buf, sql_print_error("Read invalid event from master: '%s',\ master could be corrupt but a more likely cause of this is a bug", errmsg); - my_free((char*) tmp_buf, MYF(MY_ALLOW_ZERO_PTR)); + my_free(tmp_buf); DBUG_RETURN(1); } @@ -3723,7 +3723,7 @@ static int queue_binlog_ver_1_event(Master_info *mi, const char *buf, mi->master_log_pos += inc_pos; DBUG_PRINT("info", ("master_log_pos: %lu", (ulong) mi->master_log_pos)); mysql_mutex_unlock(&mi->data_lock); - my_free((char*)tmp_buf, MYF(0)); + my_free(tmp_buf); DBUG_RETURN(error); } default: @@ -3774,7 +3774,7 @@ static int queue_binlog_ver_3_event(Master_info *mi, const char *buf, sql_print_error("Read invalid event from master: '%s',\ master could be corrupt but a more likely cause of this is a bug", errmsg); - my_free((char*) tmp_buf, MYF(MY_ALLOW_ZERO_PTR)); + my_free(tmp_buf); DBUG_RETURN(1); } mysql_mutex_lock(&mi->data_lock); diff --git a/sql/sp_pcontext.cc b/sql/sp_pcontext.cc index 74dda9f456b..bbf38f52efb 100644 --- a/sql/sp_pcontext.cc +++ b/sql/sp_pcontext.cc @@ -19,10 +19,6 @@ #pragma implementation #endif -#if defined(WIN32) || defined(__WIN__) -#undef SAFEMALLOC /* Problems with threads */ -#endif - #include "sp_pcontext.h" #include "sp_head.h" diff --git a/sql/sp_rcontext.cc b/sql/sp_rcontext.cc index e3cdf328659..047cec76486 100644 --- a/sql/sp_rcontext.cc +++ b/sql/sp_rcontext.cc @@ -19,10 +19,6 @@ #pragma implementation #endif -#if defined(WIN32) || defined(__WIN__) -#undef SAFEMALLOC /* Problems with threads */ -#endif - #include "mysql.h" #include "sp_head.h" #include "sql_cursor.h" diff --git a/sql/sql_base.cc b/sql/sql_base.cc index a83c0b1c1fd..c3e26bb665d 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -885,7 +885,7 @@ static void free_cache_entry(TABLE *table) intern_close_table(table); - my_free((uchar*) table,MYF(0)); + my_free(table); DBUG_VOID_RETURN; } @@ -897,7 +897,7 @@ void free_io_cache(TABLE *table) if (table->sort.io_cache) { close_cached_file(table->sort.io_cache); - my_free((uchar*) table->sort.io_cache,MYF(0)); + my_free(table->sort.io_cache); table->sort.io_cache=0; } DBUG_VOID_RETURN; @@ -2136,7 +2136,7 @@ void close_temporary(TABLE *table, bool free_share, bool delete_table) if (free_share) { free_table_share(table->s); - my_free((char*) table,MYF(0)); + my_free(table); } DBUG_VOID_RETURN; } @@ -3018,7 +3018,7 @@ bool open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root, if (error) { - my_free(table, MYF(0)); + my_free(table); if (error == 7) (void) ot_ctx->request_backoff_action(Open_table_context::OT_DISCOVER, @@ -3033,7 +3033,7 @@ bool open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root, if (open_table_entry_fini(thd, share, table)) { closefrm(table, 0); - my_free((uchar*)table, MYF(0)); + my_free(table); goto err_lock; } @@ -3779,10 +3779,10 @@ static bool open_table_entry_fini(THD *thd, TABLE_SHARE *share, TABLE *entry) query, (ulong)(end-query), FALSE, FALSE, FALSE, errcode)) { - my_free(query, MYF(0)); + my_free(query); return TRUE; } - my_free(query, MYF(0)); + my_free(query); } else { @@ -3867,7 +3867,7 @@ static bool auto_repair_table(THD *thd, TABLE_LIST *table_list) closefrm(entry, 0); result= FALSE; } - my_free(entry, MYF(0)); + my_free(entry); mysql_mutex_lock(&LOCK_open); release_table_share(share); @@ -5751,7 +5751,7 @@ TABLE *open_temporary_table(THD *thd, const char *path, const char *db, { /* No need to lock share->mutex as this is not needed for tmp tables */ free_table_share(share); - my_free((char*) tmp_table,MYF(0)); + my_free(tmp_table); DBUG_RETURN(0); } diff --git a/sql/sql_binlog.cc b/sql/sql_binlog.cc index 0730f7df00c..52ac34b7b60 100644 --- a/sql/sql_binlog.cc +++ b/sql/sql_binlog.cc @@ -252,6 +252,6 @@ void mysql_client_binlog_statement(THD* thd) end: rli->slave_close_thread_tables(thd); - my_free(buf, MYF(MY_ALLOW_ZERO_PTR)); + my_free(buf); DBUG_VOID_RETURN; } diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index 92d54c8e71b..b73de320ef5 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -2223,7 +2223,7 @@ void Query_cache::free_cache() { DBUG_ENTER("Query_cache::free_cache"); - my_free((uchar*) cache, MYF(MY_ALLOW_ZERO_PTR)); + my_free(cache); make_disabled(); my_hash_free(&queries); my_hash_free(&tables); diff --git a/sql/sql_class.cc b/sql/sql_class.cc index e781f08b6d4..2fbdc2b58ac 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -100,8 +100,8 @@ extern "C" void free_user_var(user_var_entry *entry) { char *pos= (char*) entry+ALIGN_SIZE(sizeof(*entry)); if (entry->value && entry->value != pos) - my_free(entry->value, MYF(0)); - my_free((char*) entry,MYF(0)); + my_free(entry->value); + my_free(entry); } bool Key_part_spec::operator==(const Key_part_spec& other) const @@ -1122,7 +1122,8 @@ THD::~THD() DBUG_PRINT("info", ("freeing security context")); main_security_ctx.destroy(); - safeFree(db); + my_free(db); + db= NULL; free_root(&transaction.mem_root,MYF(0)); mysys_var=0; // Safety (shouldn't be needed) mysql_mutex_destroy(&LOCK_thd_data); @@ -2954,10 +2955,18 @@ void Security_context::destroy() { // If not pointer to constant if (host != my_localhost) - safeFree(host); + { + my_free(host); + host= NULL; + } if (user != delayed_user) - safeFree(user); - safeFree(ip); + { + my_free(user); + user= NULL; + } + + my_free(ip); + ip= NULL; } @@ -2973,7 +2982,7 @@ void Security_context::skip_grants() bool Security_context::set_user(char *user_arg) { - safeFree(user); + my_free(user); user= my_strdup(user_arg, MYF(0)); return user == 0; } @@ -3449,7 +3458,7 @@ uchar *xid_get_hash_key(const uchar *ptr, size_t *length, void xid_free_hash(void *ptr) { if (!((XID_STATE*)ptr)->in_thd) - my_free((uchar*)ptr, MYF(0)); + my_free(ptr); } #ifdef HAVE_PSI_INTERFACE @@ -4256,7 +4265,7 @@ CPP_UNNAMED_NS_START ~Row_data_memory() { if (m_memory != 0 && m_release_memory_on_destruction) - my_free((uchar*) m_memory, MYF(MY_WME)); + my_free(m_memory); } /** diff --git a/sql/sql_class.h b/sql/sql_class.h index 7808cbe4d41..db22fc5d67b 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -2657,7 +2657,7 @@ public: memcpy(db, new_db, new_db_len+1); else { - x_free(db); + my_free(db); if (new_db) db= my_strndup(new_db, new_db_len, MYF(MY_WME | ME_FATALERROR)); else diff --git a/sql/sql_connect.cc b/sql/sql_connect.cc index 35ba39afd81..05d20b386dd 100644 --- a/sql/sql_connect.cc +++ b/sql/sql_connect.cc @@ -98,7 +98,7 @@ static int get_or_create_user_conn(THD *thd, const char *user, if (my_hash_insert(&hash_user_connections, (uchar*) uc)) { /* The only possible error is out of memory, MY_WME sets an error. */ - my_free((char*) uc,0); + my_free(uc); return_val= 1; goto end; } @@ -555,7 +555,7 @@ extern "C" uchar *get_key_conn(user_conn *buff, size_t *length, extern "C" void free_user(struct user_conn *uc) { - my_free((char*) uc,MYF(0)); + my_free(uc); } @@ -940,8 +940,7 @@ static int check_connection(THD *thd) user_len-= 2; } - if (thd->main_security_ctx.user) - x_free(thd->main_security_ctx.user); + my_free(thd->main_security_ctx.user); if (!(thd->main_security_ctx.user= my_strdup(user, MYF(MY_WME)))) return 1; /* The error is set by my_strdup(). */ return check_user(thd, COM_CONNECT, passwd, passwd_len, db, TRUE); diff --git a/sql/sql_db.cc b/sql/sql_db.cc index 2e48475f298..1040fc92851 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -94,7 +94,7 @@ extern "C" void lock_db_free_element(void *ptr); void lock_db_free_element(void *ptr) { - my_free(ptr, MYF(0)); + my_free(ptr); } @@ -136,7 +136,7 @@ static my_bool lock_db_insert(const char *dbname, uint length) opt->name_length= length; if ((error= my_hash_insert(&lock_db_cache, (uchar*) opt))) - my_free(opt, MYF(0)); + my_free(opt); } end: @@ -209,7 +209,7 @@ extern "C" void free_dbopt(void *dbopt); void free_dbopt(void *dbopt) { - my_free((uchar*) dbopt, MYF(0)); + my_free(dbopt); } #ifdef HAVE_PSI_INTERFACE @@ -377,7 +377,7 @@ static my_bool put_dbopt(const char *dbname, HA_CREATE_INFO *create) if ((error= my_hash_insert(&dboptions, (uchar*) opt))) { - my_free(opt, MYF(0)); + my_free(opt); goto end; } } @@ -1438,8 +1438,7 @@ static void mysql_change_db_impl(THD *thd, we just call THD::reset_db(). Since THD::reset_db() does not releases the previous database name, we should do it explicitly. */ - - x_free(thd->db); + my_free(thd->db); thd->reset_db(new_db_name->str, new_db_name->length); } @@ -1652,7 +1651,7 @@ bool mysql_change_db(THD *thd, const LEX_STRING *new_db_name, bool force_switch) if (check_db_name(&new_db_file_name)) { my_error(ER_WRONG_DB_NAME, MYF(0), new_db_file_name.str); - my_free(new_db_file_name.str, MYF(0)); + my_free(new_db_file_name.str); if (force_switch) mysql_change_db_impl(thd, NULL, 0, thd->variables.collation_server); @@ -1682,7 +1681,7 @@ bool mysql_change_db(THD *thd, const LEX_STRING *new_db_name, bool force_switch) new_db_file_name.str); general_log_print(thd, COM_INIT_DB, ER(ER_DBACCESS_DENIED_ERROR), sctx->priv_user, sctx->priv_host, new_db_file_name.str); - my_free(new_db_file_name.str, MYF(0)); + my_free(new_db_file_name.str); DBUG_RETURN(TRUE); } #endif @@ -1697,7 +1696,7 @@ bool mysql_change_db(THD *thd, const LEX_STRING *new_db_name, bool force_switch) ER_BAD_DB_ERROR, ER(ER_BAD_DB_ERROR), new_db_file_name.str); - my_free(new_db_file_name.str, MYF(0)); + my_free(new_db_file_name.str); /* Change db to NULL. */ @@ -1712,7 +1711,7 @@ bool mysql_change_db(THD *thd, const LEX_STRING *new_db_name, bool force_switch) /* Report an error and free new_db_file_name. */ my_error(ER_BAD_DB_ERROR, MYF(0), new_db_file_name.str); - my_free(new_db_file_name.str, MYF(0)); + my_free(new_db_file_name.str); /* The operation failed. */ diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc index d6f2a472e05..06a453f7b12 100644 --- a/sql/sql_handler.cc +++ b/sql/sql_handler.cc @@ -109,7 +109,7 @@ static char *mysql_ha_hash_get_key(TABLE_LIST *tables, size_t *key_len_p, static void mysql_ha_hash_free(TABLE_LIST *tables) { - my_free((char*) tables, MYF(0)); + my_free(tables); } /** @@ -259,7 +259,7 @@ bool mysql_ha_open(THD *thd, TABLE_LIST *tables, bool reopen) /* add to hash */ if (my_hash_insert(&thd->handler_tables_hash, (uchar*) hash_tables)) { - my_free((char*) hash_tables, MYF(0)); + my_free(hash_tables); DBUG_PRINT("exit",("ERROR")); DBUG_RETURN(TRUE); } diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 24a418f8f25..c783d74b363 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -93,7 +93,7 @@ static bool check_view_insertability(THD *thd, TABLE_LIST *view); #define my_safe_afree(ptr, size, min_length) my_afree(ptr) #else #define my_safe_alloca(size, min_length) ((size <= min_length) ? my_alloca(size) : my_malloc(size,MYF(0))) -#define my_safe_afree(ptr, size, min_length) if (size > min_length) my_free(ptr,MYF(0)) +#define my_safe_afree(ptr, size, min_length) if (size > min_length) my_free(ptr) #endif /* @@ -1779,8 +1779,8 @@ public: {} ~delayed_row() { - x_free(query.str); - x_free(record); + my_free(query.str); + my_free(record); } }; @@ -1868,7 +1868,7 @@ public: mysql_cond_destroy(&cond); mysql_cond_destroy(&cond_client); thd.unlink(); // Must be unlinked under lock - x_free(thd.query()); + my_free(thd.query()); thd.security_ctx->user= thd.security_ctx->host=0; thread_count--; delayed_insert_threads--; @@ -2276,7 +2276,7 @@ int write_delayed(THD *thd, TABLE *table, enum_duplicates duplic, row= new delayed_row(query, duplic, ignore, log_on); if (row == NULL) { - my_free(query.str, MYF(MY_WME)); + my_free(query.str); goto err; } @@ -2680,7 +2680,7 @@ static void free_delayed_insert_blobs(register TABLE *table) { uchar *str; ((Field_blob *) (*ptr))->get_ptr(&str); - my_free(str,MYF(MY_ALLOW_ZERO_PTR)); + my_free(str); ((Field_blob *) (*ptr))->reset(); } } diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 5f8b1148dcb..aefddc0b6a5 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -457,8 +457,8 @@ Yacc_state::~Yacc_state() { if (yacc_yyss) { - my_free(yacc_yyss, MYF(0)); - my_free(yacc_yyvs, MYF(0)); + my_free(yacc_yyss); + my_free(yacc_yyvs); } } diff --git a/sql/sql_list.h b/sql/sql_list.h index d57534b0999..cc42fcae91b 100644 --- a/sql/sql_list.h +++ b/sql/sql_list.h @@ -534,7 +534,7 @@ struct ilink } static void operator delete(void* ptr_arg, size_t size) { - my_free((uchar*)ptr_arg, MYF(MY_WME|MY_ALLOW_ZERO_PTR)); + my_free(ptr_arg); } inline ilink() diff --git a/sql/sql_load.cc b/sql/sql_load.cc index 7e540ffbe4b..9a5792407b1 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -1337,7 +1337,7 @@ READ_INFO::READ_INFO(File file_par, uint tot_length, CHARSET_INFO *cs, (is_fifo ? READ_FIFO : READ_CACHE),0L,1, MYF(MY_WME))) { - my_free((uchar*) buffer,MYF(0)); /* purecov: inspected */ + my_free(buffer); /* purecov: inspected */ error=1; } else @@ -1368,7 +1368,7 @@ READ_INFO::~READ_INFO() { if (need_end_io_cache) ::end_io_cache(&cache); - my_free((uchar*) buffer,MYF(0)); + my_free(buffer); error=1; } List_iterator xmlit(taglist); diff --git a/sql/sql_locale.cc b/sql/sql_locale.cc index abd9c395083..c8aee307362 100644 --- a/sql/sql_locale.cc +++ b/sql/sql_locale.cc @@ -3442,6 +3442,6 @@ void cleanup_errmsgs() { for (MY_LOCALE_ERRMSGS *msgs= global_errmsgs; msgs->language; msgs++) { - my_free(msgs->errmsgs, MYF(MY_WME | MY_FAE | MY_ALLOW_ZERO_PTR)); + my_free(msgs->errmsgs); } } diff --git a/sql/sql_manager.cc b/sql/sql_manager.cc index 2189b1e124f..e3929066361 100644 --- a/sql/sql_manager.cc +++ b/sql/sql_manager.cc @@ -117,7 +117,7 @@ pthread_handler_t handle_manager(void *arg __attribute__((unused))) { struct handler_cb *next= cb->next; cb->action(); - my_free((uchar*)cb, MYF(0)); + my_free(cb); cb= next; } } diff --git a/sql/sql_map.cc b/sql/sql_map.cc index 35a248e5465..ca8a88bcbf8 100644 --- a/sql/sql_map.cc +++ b/sql/sql_map.cc @@ -74,7 +74,7 @@ mapped_files::~mapped_files() (void) mysql_file_close(file, MYF(0)); file= -1; map=0; } - my_free(name,MYF(0)); + my_free(name); #endif } diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index b48491577d1..a7d538dd3e8 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1058,7 +1058,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, if (res) { - x_free(thd->security_ctx->user); + my_free(thd->security_ctx->user); *thd->security_ctx= save_security_ctx; thd->user_connect= save_user_connect; thd->db= save_db; @@ -1071,8 +1071,8 @@ bool dispatch_command(enum enum_server_command command, THD *thd, if (save_user_connect) decrease_user_connections(save_user_connect); #endif /* NO_EMBEDDED_ACCESS_CHECKS */ - x_free(save_db); - x_free(save_security_ctx.user); + my_free(save_db); + my_free(save_security_ctx.user); if (cs_number) { @@ -1415,18 +1415,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, #ifdef EMBEDDED_LIBRARY /* Store the buffer in permanent memory */ my_ok(thd, 0, 0, buff); -#endif -#ifdef SAFEMALLOC - if (sf_malloc_cur_memory) // Using SAFEMALLOC - { - char *end= buff + length; - length+= my_snprintf(end, buff_len - length - 1, - end," Memory in use: %ldK Max memory used: %ldK", - (sf_malloc_cur_memory+1023L)/1024L, - (sf_malloc_max_memory+1023L)/1024L); - } -#endif -#ifndef EMBEDDED_LIBRARY +#else (void) my_net_write(net, (uchar*) buff, length); (void) net_flush(net); thd->stmt_da->disable_status(); diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index bc9a7d8ee65..d7ff753dfd0 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -2624,7 +2624,7 @@ char *generate_partition_syntax(partition_info *part_info, if (unlikely(mysql_file_read(fptr, (uchar*)buf, *buf_length, MYF(MY_FNABP)))) { if (!use_sql_alloc) - my_free(buf, MYF(0)); + my_free(buf); else buf= NULL; } diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index 97c480ea0bd..2b6be403fc6 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -254,10 +254,9 @@ static void plugin_vars_free_values(sys_var *vars); static void restore_pluginvar_names(sys_var *first); static void plugin_opt_set_limits(struct my_option *, const struct st_mysql_sys_var *); -#define my_intern_plugin_lock(A,B) intern_plugin_lock(A,B CALLER_INFO) -#define my_intern_plugin_lock_ci(A,B) intern_plugin_lock(A,B ORIG_CALLER_INFO) -static plugin_ref intern_plugin_lock(LEX *lex, plugin_ref plugin - CALLER_INFO_PROTO); +#define my_intern_plugin_lock(A,B) intern_plugin_lock(A,B) +#define my_intern_plugin_lock_ci(A,B) intern_plugin_lock(A,B) +static plugin_ref intern_plugin_lock(LEX *lex, plugin_ref plugin); static void intern_plugin_unlock(LEX *lex, plugin_ref plugin); static void reap_plugins(void); @@ -392,9 +391,9 @@ static inline void free_plugin_mem(struct st_plugin_dl *p) if (p->handle) dlclose(p->handle); #endif - my_free(p->dl.str, MYF(MY_ALLOW_ZERO_PTR)); + my_free(p->dl.str); if (p->version != MYSQL_PLUGIN_INTERFACE_VERSION) - my_free((uchar*)p->plugins, MYF(MY_ALLOW_ZERO_PTR)); + my_free(p->plugins); } @@ -660,7 +659,7 @@ SHOW_COMP_OPTION plugin_status(const char *name, int len, size_t type) } -static plugin_ref intern_plugin_lock(LEX *lex, plugin_ref rc CALLER_INFO_PROTO) +static plugin_ref intern_plugin_lock(LEX *lex, plugin_ref rc) { st_plugin_int *pi= plugin_ref_to_int(rc); DBUG_ENTER("intern_plugin_lock"); @@ -682,7 +681,7 @@ static plugin_ref intern_plugin_lock(LEX *lex, plugin_ref rc CALLER_INFO_PROTO) memory manager and/or valgrind to track locked references and double unlocks to aid resolving reference counting problems. */ - if (!(plugin= (plugin_ref) my_malloc_ci(sizeof(pi), MYF(MY_WME)))) + if (!(plugin= (plugin_ref) my_malloc(sizeof(pi), MYF(MY_WME)))) DBUG_RETURN(NULL); *plugin= pi; @@ -699,7 +698,7 @@ static plugin_ref intern_plugin_lock(LEX *lex, plugin_ref rc CALLER_INFO_PROTO) } -plugin_ref plugin_lock(THD *thd, plugin_ref *ptr CALLER_INFO_PROTO) +plugin_ref plugin_lock(THD *thd, plugin_ref *ptr) { LEX *lex= thd ? thd->lex : 0; plugin_ref rc; @@ -711,8 +710,7 @@ plugin_ref plugin_lock(THD *thd, plugin_ref *ptr CALLER_INFO_PROTO) } -plugin_ref plugin_lock_by_name(THD *thd, const LEX_STRING *name, int type - CALLER_INFO_PROTO) +plugin_ref plugin_lock_by_name(THD *thd, const LEX_STRING *name, int type) { LEX *lex= thd ? thd->lex : 0; plugin_ref rc= NULL; @@ -973,7 +971,7 @@ static void intern_plugin_unlock(LEX *lex, plugin_ref plugin) if (!pi->plugin_dl) DBUG_VOID_RETURN; #else - my_free((uchar*) plugin, MYF(MY_WME)); + my_free(plugin); #endif DBUG_PRINT("info",("unlocking plugin, name= %s, ref_count= %d", @@ -2245,7 +2243,7 @@ static void update_func_str(THD *thd, struct st_mysql_sys_var *var, if (var->flags & PLUGIN_VAR_MEMALLOC) { *(char **)tgt= my_strdup(*(char **) save, MYF(0)); - my_free(old, MYF(0)); + my_free(old); } } @@ -2637,7 +2635,7 @@ static void cleanup_variables(THD *thd, struct system_variables *vars) flags & PLUGIN_VAR_THDLOCAL && flags & PLUGIN_VAR_MEMALLOC) { char **ptr= (char**) pivar->real_value_ptr(thd, OPT_SESSION); - my_free(*ptr, MYF(MY_WME | MY_FAE | MY_ALLOW_ZERO_PTR)); + my_free(*ptr); *ptr= NULL; } } @@ -2645,7 +2643,7 @@ static void cleanup_variables(THD *thd, struct system_variables *vars) DBUG_ASSERT(vars->table_plugin == NULL); - my_free(vars->dynamic_variables_ptr, MYF(MY_ALLOW_ZERO_PTR)); + my_free(vars->dynamic_variables_ptr); vars->dynamic_variables_ptr= NULL; vars->dynamic_variables_size= 0; vars->dynamic_variables_version= 0; @@ -2706,7 +2704,7 @@ static void plugin_vars_free_values(sys_var *vars) char **valptr= (char**) piv->real_value_ptr(NULL, OPT_GLOBAL); DBUG_PRINT("plugin", ("freeing value for: '%s' addr: 0x%lx", var->name.str, (long) valptr)); - my_free(*valptr, MYF(MY_WME | MY_FAE | MY_ALLOW_ZERO_PTR)); + my_free(*valptr); *valptr= NULL; } } diff --git a/sql/sql_plugin.h b/sql/sql_plugin.h index e7ecca029b9..079dc4e6dca 100644 --- a/sql/sql_plugin.h +++ b/sql/sql_plugin.h @@ -30,8 +30,6 @@ #include "m_string.h" /* LEX_STRING */ #include "my_alloc.h" /* MEM_ROOT */ -#include "my_sys.h" /* CALLER_INFO_PROTO */ - class sys_var; enum SHOW_COMP_OPTION { SHOW_OPTION_YES, SHOW_OPTION_NO, SHOW_OPTION_DISABLED}; @@ -134,13 +132,13 @@ extern int plugin_init(int *argc, char **argv, int init_flags); extern void plugin_shutdown(void); void add_plugin_options(DYNAMIC_ARRAY *options, MEM_ROOT *mem_root); extern bool plugin_is_ready(const LEX_STRING *name, int type); -#define my_plugin_lock_by_name(A,B,C) plugin_lock_by_name(A,B,C CALLER_INFO) -#define my_plugin_lock_by_name_ci(A,B,C) plugin_lock_by_name(A,B,C ORIG_CALLER_INFO) -#define my_plugin_lock(A,B) plugin_lock(A,B CALLER_INFO) -#define my_plugin_lock_ci(A,B) plugin_lock(A,B ORIG_CALLER_INFO) -extern plugin_ref plugin_lock(THD *thd, plugin_ref *ptr CALLER_INFO_PROTO); +#define my_plugin_lock_by_name(A,B,C) plugin_lock_by_name(A,B,C) +#define my_plugin_lock_by_name_ci(A,B,C) plugin_lock_by_name(A,B,C) +#define my_plugin_lock(A,B) plugin_lock(A,B) +#define my_plugin_lock_ci(A,B) plugin_lock(A,B) +extern plugin_ref plugin_lock(THD *thd, plugin_ref *ptr); extern plugin_ref plugin_lock_by_name(THD *thd, const LEX_STRING *name, - int type CALLER_INFO_PROTO); + int type); extern void plugin_unlock(THD *thd, plugin_ref plugin); extern void plugin_unlock_list(THD *thd, plugin_ref *list, uint count); extern bool mysql_install_plugin(THD *thd, const LEX_STRING *name, diff --git a/sql/sql_profile.cc b/sql/sql_profile.cc index 4a0d3d944ad..ce3d786cf92 100644 --- a/sql/sql_profile.cc +++ b/sql/sql_profile.cc @@ -177,8 +177,7 @@ PROF_MEASUREMENT::PROF_MEASUREMENT(QUERY_PROFILE *profile_arg, PROF_MEASUREMENT::~PROF_MEASUREMENT() { - if (allocated_status_memory != NULL) - my_free(allocated_status_memory, MYF(0)); + my_free(allocated_status_memory); status= function= file= NULL; } @@ -268,8 +267,7 @@ QUERY_PROFILE::~QUERY_PROFILE() while (! entries.is_empty()) delete entries.pop(); - if (query_source != NULL) - my_free(query_source, MYF(0)); + my_free(query_source); } /** diff --git a/sql/sql_profile.h b/sql/sql_profile.h index ff16a2da19b..7d17dc69b88 100644 --- a/sql/sql_profile.h +++ b/sql/sql_profile.h @@ -82,7 +82,7 @@ public: for (i= first; i != NULL; i= after_i) { after_i= i->next; - my_free((char *) i, MYF(0)); + my_free(i); } elements= 0; } @@ -129,7 +129,7 @@ public: last= NULL; first= first->next; - my_free((char *)old_item, MYF(0)); + my_free(old_item); elements--; return ret; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 22190eeefed..24d2a21147c 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -6957,7 +6957,7 @@ void JOIN_TAB::cleanup() select= 0; delete quick; quick= 0; - x_free(cache.buff); + my_free(cache.buff); cache.buff= 0; limit= 0; if (table) @@ -14251,7 +14251,7 @@ static int remove_dup_with_hash_index(THD *thd, TABLE *table, if (my_hash_init(&hash, &my_charset_bin, (uint) file->stats.records, 0, key_length, (my_hash_get_key) 0, 0, 0)) { - my_free((char*) key_buffer,MYF(0)); + my_free(key_buffer); DBUG_RETURN(1); } @@ -14303,14 +14303,14 @@ static int remove_dup_with_hash_index(THD *thd, TABLE *table, } key_pos+=extra_length; } - my_free((char*) key_buffer,MYF(0)); + my_free(key_buffer); my_hash_free(&hash); file->extra(HA_EXTRA_NO_CACHE); (void) file->ha_rnd_end(); DBUG_RETURN(0); err: - my_free((char*) key_buffer,MYF(0)); + my_free(key_buffer); my_hash_free(&hash); file->extra(HA_EXTRA_NO_CACHE); (void) file->ha_rnd_end(); @@ -14393,7 +14393,7 @@ join_init_cache(THD *thd,JOIN_TAB *tables,uint table_count) sizeof(CACHE_FIELD*)))) { - my_free((uchar*) cache->buff,MYF(0)); /* purecov: inspected */ + my_free(cache->buff); /* purecov: inspected */ cache->buff=0; /* purecov: inspected */ DBUG_RETURN(1); /* purecov: inspected */ } diff --git a/sql/sql_show.cc b/sql/sql_show.cc index f1d7e48ffcc..fc2f22f6f48 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -1353,7 +1353,7 @@ int store_create_info(THD *thd, TABLE_LIST *table_list, String *packet, packet->append(STRING_WITH_LEN(" /*!50100 TABLESPACE ")); packet->append(for_str, strlen(for_str)); packet->append(STRING_WITH_LEN(" STORAGE DISK */")); - my_free(for_str, MYF(0)); + my_free(for_str); } /* @@ -1495,7 +1495,7 @@ int store_create_info(THD *thd, TABLE_LIST *table_list, String *packet, table->part_info->set_show_version_string(packet); packet->append(part_syntax, part_syntax_len); packet->append(STRING_WITH_LEN(" */")); - my_free(part_syntax, MYF(0)); + my_free(part_syntax); } } #endif @@ -3323,7 +3323,7 @@ static int fill_schema_table_from_frm(THD *thd, TABLE_LIST *tables, res= schema_table->process_table(thd, &table_list, table, res, db_name, table_name); free_root(&tbl.mem_root, MYF(0)); - my_free((char*) tbl.alias, MYF(MY_ALLOW_ZERO_PTR)); + my_free((void *) tbl.alias); } end_share: @@ -5375,7 +5375,7 @@ static void store_schema_partitions_record(THD *thd, TABLE *schema_table, if(ts) { table->field[24]->store(ts, strlen(ts), cs); - my_free(ts, MYF(0)); + my_free(ts); } else table->field[24]->set_null(); @@ -7470,7 +7470,7 @@ int initialize_schema_table(st_plugin_int *plugin) sql_print_error("Plugin '%s' init function returned error.", plugin->name.str); plugin->data= NULL; - my_free(schema_table, MYF(0)); + my_free(schema_table); DBUG_RETURN(1); } @@ -7493,7 +7493,7 @@ int finalize_schema_table(st_plugin_int *plugin) DBUG_PRINT("warning", ("Plugin '%s' deinit function returned error.", plugin->name.str)); } - my_free(schema_table, MYF(0)); + my_free(schema_table); } DBUG_RETURN(0); } diff --git a/sql/sql_string.h b/sql/sql_string.h index debfb7aa9c6..0ce67108423 100644 --- a/sql/sql_string.h +++ b/sql/sql_string.h @@ -205,7 +205,7 @@ public: { alloced=0; Alloced_length=0; - my_free(Ptr,MYF(0)); + my_free(Ptr); Ptr=0; str_length=0; /* Safety */ } diff --git a/sql/sql_table.cc b/sql/sql_table.cc index f300ecec2c6..fa9f9b7f633 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -1534,13 +1534,13 @@ void release_ddl_log() while (used_list) { DDL_LOG_MEMORY_ENTRY *tmp= used_list->next_log_entry; - my_free(used_list, MYF(0)); + my_free(used_list); used_list= tmp; } while (free_list) { DDL_LOG_MEMORY_ENTRY *tmp= free_list->next_log_entry; - my_free(free_list, MYF(0)); + my_free(free_list); free_list= tmp; } close_ddl_log(); @@ -1696,8 +1696,8 @@ bool mysql_write_frm(ALTER_PARTITION_PARAM_TYPE *lpt, uint flags) if (readfrm(shadow_path, &data, &length) || packfrm(data, length, &lpt->pack_frm_data, &lpt->pack_frm_len)) { - my_free(data, MYF(MY_ALLOW_ZERO_PTR)); - my_free(lpt->pack_frm_data, MYF(MY_ALLOW_ZERO_PTR)); + my_free(data); + my_free(lpt->pack_frm_data); mem_alloc_error(length); error= 1; goto end; @@ -7534,7 +7534,7 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name, if (t_table) { intern_close_table(t_table); - my_free(t_table, MYF(0)); + my_free(t_table); } else sql_print_warning("Could not open table %s.%s after rename\n", diff --git a/sql/sql_test.cc b/sql/sql_test.cc index 48fd5f9dff8..501c4cf6a94 100644 --- a/sql/sql_test.cc +++ b/sql/sql_test.cc @@ -555,11 +555,6 @@ Next alarm time: %lu\n", #endif display_table_locks(); fflush(stdout); - my_checkmalloc(); - fprintf(stdout,"\nBegin safemalloc memory dump:\n"); // tag needed for test suite - TERMINATE(stdout, 1); // Write malloc information - fprintf(stdout,"\nEnd safemalloc memory dump.\n"); - fflush(stdout); #ifdef HAVE_MALLINFO struct mallinfo info= mallinfo(); printf("\nMemory status:\n\ diff --git a/sql/sql_truncate.cc b/sql/sql_truncate.cc index 901ab8e987d..c2482ef1ce0 100644 --- a/sql/sql_truncate.cc +++ b/sql/sql_truncate.cc @@ -216,7 +216,7 @@ static bool recreate_temporary_table(THD *thd, TABLE *table) rm_temporary_table(table_type, share->path.str); free_table_share(share); - my_free(table, MYF(0)); + my_free(table); DBUG_RETURN(error); } diff --git a/sql/sys_vars.h b/sql/sys_vars.h index fbc48573487..18c073b1e90 100644 --- a/sql/sys_vars.h +++ b/sql/sys_vars.h @@ -388,7 +388,7 @@ public: ~Sys_var_charptr() { if (flags & ALLOCATED) - my_free(global_var(char*), MYF(MY_ALLOW_ZERO_PTR)); + my_free(global_var(char*)); flags&= ~ALLOCATED; } bool do_check(THD *thd, set_var *var) @@ -435,7 +435,7 @@ public: else new_val= 0; if (flags & ALLOCATED) - my_free(global_var(char*), MYF(MY_ALLOW_ZERO_PTR)); + my_free(global_var(char*)); flags|= ALLOCATED; global_var(char*)= new_val; return false; diff --git a/sql/table.cc b/sql/table.cc index 4e6f2ae2860..a58623f0036 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -896,7 +896,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, if (mysql_file_pread(file, buff, n_length, record_offset + share->reclength, MYF(MY_NABP))) { - my_free(buff, MYF(0)); + my_free(buff); goto err; } share->connect_string.length= uint2korr(buff); @@ -905,7 +905,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, share->connect_string. length))) { - my_free(buff, MYF(0)); + my_free(buff); goto err; } next_chunk+= share->connect_string.length + 2; @@ -926,7 +926,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, plugin_data(tmp_plugin, handlerton *))) { /* bad file, legacy_db_type did not match the name */ - my_free(buff, MYF(0)); + my_free(buff); goto err; } /* @@ -956,7 +956,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, error= 8; my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--skip-partition"); - my_free(buff, MYF(0)); + my_free(buff); goto err; } plugin_unlock(NULL, share->db_plugin); @@ -972,7 +972,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, error= 8; name.str[name.length]=0; my_error(ER_UNKNOWN_STORAGE_ENGINE, MYF(0), name.str); - my_free(buff, MYF(0)); + my_free(buff); goto err; /* purecov: end */ } @@ -989,7 +989,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, memdup_root(&share->mem_root, next_chunk + 4, partition_info_str_len + 1))) { - my_free(buff, MYF(0)); + my_free(buff); goto err; } } @@ -997,7 +997,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, if (partition_info_str_len) { DBUG_PRINT("info", ("WITH_PARTITION_STORAGE_ENGINE is not defined")); - my_free(buff, MYF(0)); + my_free(buff); goto err; } #endif @@ -1035,7 +1035,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, { DBUG_PRINT("error", ("fulltext key uses parser that is not defined in .frm")); - my_free(buff, MYF(0)); + my_free(buff); goto err; } parser_name.str= (char*) next_chunk; @@ -1046,7 +1046,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, if (! keyinfo->parser) { my_error(ER_PLUGIN_IS_NOT_LOADED, MYF(0), parser_name.str); - my_free(buff, MYF(0)); + my_free(buff); goto err; } } @@ -1058,19 +1058,19 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, { DBUG_PRINT("error", ("long table comment is not defined in .frm")); - my_free(buff, MYF(0)); + my_free(buff); goto err; } share->comment.length = uint2korr(next_chunk); if (! (share->comment.str= strmake_root(&share->mem_root, (char*)next_chunk + 2, share->comment.length))) { - my_free(buff, MYF(0)); + my_free(buff); goto err; } next_chunk+= 2 + share->comment.length; } - my_free(buff, MYF(0)); + my_free(buff); } share->key_block_size= uint2korr(head+62); @@ -1586,7 +1586,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, } else share->primary_key= MAX_KEY; - x_free((uchar*) disk_buff); + my_free(disk_buff); disk_buff=0; if (new_field_pack_flag <= 1) { @@ -1658,7 +1658,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, share->error= error; share->open_errno= my_errno; share->errarg= errarg; - x_free((uchar*) disk_buff); + my_free(disk_buff); delete crypted; delete handler_file; my_hash_free(&share->name_hash); @@ -2010,7 +2010,7 @@ partititon_err: outparam->file= 0; // For easier error checking outparam->db_stat=0; free_root(&outparam->mem_root, MYF(0)); // Safe to call on bzero'd root - my_free((char*) outparam->alias, MYF(MY_ALLOW_ZERO_PTR)); + my_free((void *) outparam->alias); DBUG_RETURN (error); } @@ -2032,7 +2032,7 @@ int closefrm(register TABLE *table, bool free_share) if (table->db_stat) error=table->file->close(); - my_free((char*) table->alias, MYF(MY_ALLOW_ZERO_PTR)); + my_free((void *) table->alias); table->alias= 0; if (table->field) { @@ -2127,14 +2127,14 @@ static ulong get_form_pos(File file, uchar *head) if (mysql_file_read(file, buf, length+names*4, MYF(MY_NABP))) { - x_free(buf); + my_free(buf); DBUG_RETURN(0); } pos= buf+length; ret_value= uint4korr(pos); - my_free(buf, MYF(0)); + my_free(buf); DBUG_RETURN(ret_value); } @@ -2151,11 +2151,11 @@ int read_string(File file, uchar**to, size_t length) { DBUG_ENTER("read_string"); - x_free(*to); + my_free(*to); if (!(*to= (uchar*) my_malloc(length+1,MYF(MY_WME))) || mysql_file_read(file, *to, length, MYF(MY_NABP))) { - x_free(*to); /* purecov: inspected */ + my_free(*to); /* purecov: inspected */ *to= 0; /* purecov: inspected */ DBUG_RETURN(1); /* purecov: inspected */ } diff --git a/sql/uniques.cc b/sql/uniques.cc index 7b5a6d1ce4f..690b310bde5 100644 --- a/sql/uniques.cc +++ b/sql/uniques.cc @@ -566,7 +566,7 @@ bool Unique::walk(tree_walk_action action, void *walk_action_arg) (BUFFPEK *) file_ptrs.buffer + file_ptrs.elements, action, walk_action_arg, tree.compare, tree.custom_arg, &file); - my_free((char*) merge_buffer, MYF(0)); + my_free(merge_buffer); return res; } @@ -642,7 +642,7 @@ bool Unique::get(TABLE *table) goto err; error=0; err: - x_free(sort_buffer); + my_free(sort_buffer); if (flush_io_cache(outfile)) error=1; diff --git a/sql/unireg.cc b/sql/unireg.cc index 802e5b7429c..6433b8bc7c2 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -148,7 +148,7 @@ bool mysql_create_frm(THD *thd, const char *file_name, if (error) { - my_free(screen_buff, MYF(0)); + my_free(screen_buff); if (! pack_header_error_handler.is_handled) DBUG_RETURN(1); @@ -159,7 +159,7 @@ bool mysql_create_frm(THD *thd, const char *file_name, create_fields,info_length, screens, create_info->table_options, data_offset, db_file)) { - my_free(screen_buff, MYF(0)); + my_free(screen_buff); DBUG_RETURN(1); } } @@ -228,7 +228,7 @@ bool mysql_create_frm(THD *thd, const char *file_name, { my_error(ER_TOO_LONG_TABLE_COMMENT, MYF(0), real_table_name, (uint) TABLE_COMMENT_MAXLEN); - my_free(screen_buff,MYF(0)); + my_free(screen_buff); DBUG_RETURN(1); } char warn_buff[MYSQL_ERRMSG_SIZE]; @@ -259,7 +259,7 @@ bool mysql_create_frm(THD *thd, const char *file_name, if ((file=create_frm(thd, file_name, db, table, reclength, fileinfo, create_info, keys, key_info)) < 0) { - my_free(screen_buff, MYF(0)); + my_free(screen_buff); DBUG_RETURN(1); } @@ -374,15 +374,15 @@ bool mysql_create_frm(THD *thd, const char *file_name, delete crypted; if (mysql_file_pwrite(file, disk_buff, read_length, filepos+256, MYF_RW)) { - my_free(disk_buff,MYF(0)); + my_free(disk_buff); goto err; } - my_free(disk_buff,MYF(0)); + my_free(disk_buff); } #endif - my_free(screen_buff,MYF(0)); - my_free(keybuff, MYF(0)); + my_free(screen_buff); + my_free(keybuff); if (opt_sync_frm && !(create_info->options & HA_LEX_CREATE_TMP_TABLE) && (mysql_file_sync(file, MYF(MY_WME)) || @@ -411,8 +411,8 @@ bool mysql_create_frm(THD *thd, const char *file_name, DBUG_RETURN(0); err: - my_free(screen_buff, MYF(0)); - my_free(keybuff, MYF(0)); + my_free(screen_buff); + my_free(keybuff); err2: (void) mysql_file_close(file, MYF(MY_WME)); err3: @@ -1095,7 +1095,7 @@ static bool make_empty_rec(THD *thd, File file,enum legacy_db_type table_type, error= mysql_file_write(file, buff, (size_t) reclength, MYF_RW) != 0; err: - my_free(buff, MYF(MY_FAE)); + my_free(buff); thd->count_cuted_fields= old_count_cuted_fields; DBUG_RETURN(error); } /* make_empty_rec */ diff --git a/storage/archive/archive_reader.c b/storage/archive/archive_reader.c index bad02835d86..ce4be92a521 100644 --- a/storage/archive/archive_reader.c +++ b/storage/archive/archive_reader.c @@ -201,7 +201,7 @@ int main(int argc, char *argv[]) ptr= (char *)my_malloc(sizeof(char) * reader_handle.frm_length, MYF(0)); azread_frm(&reader_handle, ptr); azwrite_frm(&writer_handle, ptr, reader_handle.frm_length); - my_free(ptr, MYF(0)); + my_free(ptr); } if (reader_handle.comment_length) @@ -210,7 +210,7 @@ int main(int argc, char *argv[]) ptr= (char *)my_malloc(sizeof(char) * reader_handle.comment_length, MYF(0)); azread_comment(&reader_handle, ptr); azwrite_comment(&writer_handle, ptr, reader_handle.comment_length); - my_free(ptr, MYF(0)); + my_free(ptr); } while ((read= azread(&reader_handle, (uchar *)size_buffer, @@ -265,7 +265,7 @@ int main(int argc, char *argv[]) azread_frm(&reader_handle, ptr); my_write(frm_file, (uchar*) ptr, reader_handle.frm_length, MYF(0)); my_close(frm_file, MYF(0)); - my_free(ptr, MYF(0)); + my_free(ptr); } end: diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc index 2bcfc3ff672..63848370ff1 100644 --- a/storage/archive/ha_archive.cc +++ b/storage/archive/ha_archive.cc @@ -387,7 +387,7 @@ ARCHIVE_SHARE *ha_archive::get_share(const char *table_name, int *rc) { *rc= my_errno ? my_errno : -1; mysql_mutex_unlock(&archive_mutex); - my_free(share, MYF(0)); + my_free(share); DBUG_RETURN(NULL); } stats.auto_increment_value= archive_tmp.auto_increment + 1; @@ -447,7 +447,7 @@ int ha_archive::free_share() if (azclose(&(share->archive_write))) rc= 1; } - my_free((uchar*) share, MYF(0)); + my_free(share); } mysql_mutex_unlock(&archive_mutex); @@ -706,7 +706,7 @@ int ha_archive::create(const char *name, TABLE *table_arg, { my_read(frm_file, frm_ptr, file_stat.st_size, MYF(0)); azwrite_frm(&create_stream, (char *)frm_ptr, file_stat.st_size); - my_free((uchar*)frm_ptr, MYF(0)); + my_free(frm_ptr); } } my_close(frm_file, MYF(0)); @@ -932,8 +932,7 @@ int ha_archive::write_row(uchar *buf) rc= real_write_row(buf, &(share->archive_write)); error: mysql_mutex_unlock(&share->mutex); - if (read_buf) - my_free((uchar*) read_buf, MYF(0)); + my_free(read_buf); DBUG_RETURN(rc); } @@ -1696,7 +1695,7 @@ archive_record_buffer *ha_archive::create_record_buffer(unsigned int length) if (!(r->buffer= (uchar*) my_malloc(r->length, MYF(MY_WME)))) { - my_free((char*) r, MYF(MY_ALLOW_ZERO_PTR)); + my_free(r); DBUG_RETURN(NULL); /* purecov: inspected */ } @@ -1706,8 +1705,8 @@ archive_record_buffer *ha_archive::create_record_buffer(unsigned int length) void ha_archive::destroy_record_buffer(archive_record_buffer *r) { DBUG_ENTER("ha_archive::destroy_record_buffer"); - my_free((char*) r->buffer, MYF(MY_ALLOW_ZERO_PTR)); - my_free((char*) r, MYF(MY_ALLOW_ZERO_PTR)); + my_free(r->buffer); + my_free(r); DBUG_VOID_RETURN; } diff --git a/storage/blackhole/ha_blackhole.cc b/storage/blackhole/ha_blackhole.cc index 7ec60aad88a..6591c3a2c78 100644 --- a/storage/blackhole/ha_blackhole.cc +++ b/storage/blackhole/ha_blackhole.cc @@ -335,7 +335,7 @@ static st_blackhole_share *get_share(const char *table_name) if (my_hash_insert(&blackhole_open_tables, (uchar*) share)) { - my_free((uchar*) share, MYF(0)); + my_free(share); share= NULL; goto error; } @@ -360,7 +360,7 @@ static void free_share(st_blackhole_share *share) static void blackhole_free_key(st_blackhole_share *share) { thr_lock_delete(&share->lock); - my_free((uchar*) share, MYF(0)); + my_free(share); } static uchar* blackhole_get_key(st_blackhole_share *share, size_t *length, diff --git a/storage/csv/ha_tina.cc b/storage/csv/ha_tina.cc index 11edf690f2a..30c4c4d58ca 100644 --- a/storage/csv/ha_tina.cc +++ b/storage/csv/ha_tina.cc @@ -251,7 +251,7 @@ static TINA_SHARE *get_share(const char *table_name, TABLE *table) error: mysql_mutex_unlock(&tina_mutex); - my_free((uchar*) share, MYF(0)); + my_free(share); return NULL; } @@ -429,7 +429,7 @@ static int free_share(TINA_SHARE *share) my_hash_delete(&tina_open_tables, (uchar*) share); thr_lock_delete(&share->lock); mysql_mutex_destroy(&share->mutex); - my_free((uchar*) share, MYF(0)); + my_free(share); } mysql_mutex_unlock(&tina_mutex); @@ -1529,7 +1529,7 @@ int ha_tina::repair(THD* thd, HA_CHECK_OPT* check_opt) free_root(&blobroot, MYF(0)); - my_free((char*)buf, MYF(0)); + my_free(buf); if (rc == HA_ERR_END_OF_FILE) { @@ -1735,7 +1735,7 @@ int ha_tina::check(THD* thd, HA_CHECK_OPT* check_opt) free_root(&blobroot, MYF(0)); - my_free((char*)buf, MYF(0)); + my_free(buf); thd_proc_info(thd, old_proc_info); if ((rc != HA_ERR_END_OF_FILE) || count) diff --git a/storage/csv/ha_tina.h b/storage/csv/ha_tina.h index 7bb80170e87..845b50e3869 100644 --- a/storage/csv/ha_tina.h +++ b/storage/csv/ha_tina.h @@ -95,7 +95,7 @@ public: ~ha_tina() { if (chain_alloced) - my_free(chain, 0); + my_free(chain); if (file_buff) delete file_buff; free_root(&blobroot, MYF(0)); diff --git a/storage/csv/transparent_file.cc b/storage/csv/transparent_file.cc index 44ca2df026f..f92746c7b93 100644 --- a/storage/csv/transparent_file.cc +++ b/storage/csv/transparent_file.cc @@ -29,7 +29,7 @@ Transparent_file::Transparent_file() : lower_bound(0), buff_size(IO_SIZE) Transparent_file::~Transparent_file() { - my_free((uchar*)buff, MYF(MY_ALLOW_ZERO_PTR)); + my_free(buff); } void Transparent_file::init_buff(File filedes_arg) diff --git a/storage/example/ha_example.cc b/storage/example/ha_example.cc index 2fbb17e46bd..899f55a33f7 100644 --- a/storage/example/ha_example.cc +++ b/storage/example/ha_example.cc @@ -232,7 +232,7 @@ static EXAMPLE_SHARE *get_share(const char *table_name, TABLE *table) error: mysql_mutex_destroy(&share->mutex); - my_free(share, MYF(0)); + my_free(share); return NULL; } @@ -252,7 +252,7 @@ static int free_share(EXAMPLE_SHARE *share) my_hash_delete(&example_open_tables, (uchar*) share); thr_lock_delete(&share->lock); mysql_mutex_destroy(&share->mutex); - my_free(share, MYF(0)); + my_free(share); } mysql_mutex_unlock(&example_mutex); diff --git a/storage/heap/ha_heap.cc b/storage/heap/ha_heap.cc index 541650bd5e8..350958f8230 100644 --- a/storage/heap/ha_heap.cc +++ b/storage/heap/ha_heap.cc @@ -112,7 +112,7 @@ int ha_heap::open(const char *name, int mode, uint test_if_locked) create_info.pin_share= TRUE; rc= heap_create(name, &create_info, &internal_share, &created_new_share); - my_free((uchar*) create_info.keydef, MYF(0)); + my_free(create_info.keydef); if (rc) goto end; @@ -764,7 +764,7 @@ int ha_heap::create(const char *name, TABLE *table_arg, hp_create_info.auto_increment= (create_info->auto_increment_value ? create_info->auto_increment_value - 1 : 0); error= heap_create(name, &hp_create_info, &internal_share, &created); - my_free((uchar*) hp_create_info.keydef, MYF(0)); + my_free(hp_create_info.keydef); DBUG_ASSERT(file == 0); return (error); } diff --git a/storage/heap/hp_block.c b/storage/heap/hp_block.c index c622a9e52f8..7f6cc1ef90a 100644 --- a/storage/heap/hp_block.c +++ b/storage/heap/hp_block.c @@ -145,7 +145,7 @@ uchar *hp_free_level(HP_BLOCK *block, uint level, HP_PTRS *pos, uchar *last_pos) } if ((uchar*) pos != last_pos) { - my_free((uchar*) pos,MYF(0)); + my_free(pos); return last_pos; } return next_ptr; /* next memory position */ diff --git a/storage/heap/hp_close.c b/storage/heap/hp_close.c index 49d8ec376bb..e5a826423db 100644 --- a/storage/heap/hp_close.c +++ b/storage/heap/hp_close.c @@ -46,6 +46,6 @@ int hp_close(register HP_INFO *info) heap_open_list=list_delete(heap_open_list,&info->open_list); if (!--info->s->open_count && info->s->delete_on_close) hp_free(info->s); /* Table was deleted */ - my_free((uchar*) info,MYF(0)); + my_free(info); DBUG_RETURN(error); } diff --git a/storage/heap/hp_create.c b/storage/heap/hp_create.c index cf0f5d5ba6d..bbf649c5e46 100644 --- a/storage/heap/hp_create.c +++ b/storage/heap/hp_create.c @@ -189,7 +189,7 @@ int heap_create(const char *name, HP_CREATE_INFO *create_info, /* Must be allocated separately for rename to work */ if (!(share->name= my_strdup(name,MYF(0)))) { - my_free((uchar*) share,MYF(0)); + my_free(share); goto err; } #ifdef THREAD @@ -305,7 +305,7 @@ void hp_free(HP_SHARE *share) thr_lock_delete(&share->lock); mysql_mutex_destroy(&share->intern_lock); #endif - my_free((uchar*) share->name, MYF(0)); - my_free((uchar*) share, MYF(0)); + my_free(share->name); + my_free(share); return; } diff --git a/storage/heap/hp_rename.c b/storage/heap/hp_rename.c index c4e8390cc43..cf0d2b2b387 100644 --- a/storage/heap/hp_rename.c +++ b/storage/heap/hp_rename.c @@ -33,7 +33,7 @@ int heap_rename(const char *old_name, const char *new_name) mysql_mutex_unlock(&THR_LOCK_heap); DBUG_RETURN(my_errno); } - my_free(info->name,MYF(0)); + my_free(info->name); info->name=name_buff; } mysql_mutex_unlock(&THR_LOCK_heap); diff --git a/storage/ibmdb2i/db2i_constraints.cc b/storage/ibmdb2i/db2i_constraints.cc index cc2821238b6..3afa12032d0 100644 --- a/storage/ibmdb2i/db2i_constraints.cc +++ b/storage/ibmdb2i/db2i_constraints.cc @@ -421,7 +421,7 @@ void ha_ibmdb2i::free_foreign_key_create_info(char* info) if (info) { - my_free(info, MYF(0)); + my_free(info); } DBUG_VOID_RETURN; } diff --git a/storage/ibmdb2i/db2i_conversion.cc b/storage/ibmdb2i/db2i_conversion.cc index 9a85eb01c9b..71a30802bf9 100644 --- a/storage/ibmdb2i/db2i_conversion.cc +++ b/storage/ibmdb2i/db2i_conversion.cc @@ -292,7 +292,7 @@ static void get_field_default_value(Field *field, if (iconv(iconvD, (char**)&tempIn, &ilen, &tempOut, &olen, &substitutedChars) < 0) { warning(current_thd, DB2I_ERR_WARN_COL_ATTRS, field->field_name); - my_free(out, MYF(0)); + my_free(out); return; } // Now we process the converted string to represent it as @@ -310,7 +310,7 @@ static void get_field_default_value(Field *field, if (length > 16370) { warning(current_thd, DB2I_ERR_WARN_COL_ATTRS, field->field_name); - my_free(out, MYF(0)); + my_free(out); return; } @@ -335,7 +335,7 @@ static void get_field_default_value(Field *field, if (field->charset() == &my_charset_bin) defaultClause.append(")"); - my_free(out, MYF(0)); + my_free(out); } } else diff --git a/storage/ibmdb2i/db2i_file.cc b/storage/ibmdb2i/db2i_file.cc index a16aa927527..2d83248eea7 100644 --- a/storage/ibmdb2i/db2i_file.cc +++ b/storage/ibmdb2i/db2i_file.cc @@ -280,12 +280,9 @@ void db2i_table::renameAssocFiles(const char* from, const char* to) db2i_table::~db2i_table() { - if (blobFieldActualSizes) - my_free(blobFieldActualSizes, MYF(0)); + my_free(blobFieldActualSizes); + my_free(conversionDefinitions[toMySQL]); - if (conversionDefinitions[toMySQL]) - my_free(conversionDefinitions[toMySQL], MYF(0)); - if (logicalFiles) { for (int k = 0; k < logicalFileCount; ++k) @@ -296,8 +293,8 @@ db2i_table::~db2i_table() delete[] logicalFiles; } delete physicalFile; - - my_free(db2LibNameEbcdic, 0); + + my_free(db2LibNameEbcdic); } void db2i_table::getDB2QualifiedName(char* to) @@ -334,14 +331,14 @@ size_t db2i_table::smartFilenameToTableName(const char *in, char* out, size_t ou if ((*cur <= 0x20) || (*cur >= 0x80)) { strncpy(out, in, outlen); - my_free(test, MYF(0)); + my_free(test); return min(outlen, strlen(out)); } ++cur; } strncpy(out, test, outlen); - my_free(test, MYF(0)); + my_free(test); return min(outlen, strlen(out)); } diff --git a/storage/ibmdb2i/db2i_file.h b/storage/ibmdb2i/db2i_file.h index ff35a473b05..6cc6ae8947b 100644 --- a/storage/ibmdb2i/db2i_file.h +++ b/storage/ibmdb2i/db2i_file.h @@ -353,7 +353,7 @@ public: db2i_ileBridge::getBridgeForThread()->deallocateFile(masterDefn); if (db2FileName != (char*)db2Table->getDB2TableName(db2i_table::EBCDIC_NATIVE)) - my_free(db2FileName, MYF(0)); + my_free(db2FileName); } // This is roughly equivalent to an "open". It tells ILE to allocate a descriptor diff --git a/storage/ibmdb2i/db2i_global.h b/storage/ibmdb2i/db2i_global.h index d201fbd8124..1cf8a9a7c61 100644 --- a/storage/ibmdb2i/db2i_global.h +++ b/storage/ibmdb2i/db2i_global.h @@ -131,7 +131,7 @@ void free_aligned(void* p) { if (likely(p)) { - my_free(*(char**)((char*)p-sizeof(void*)), MYF(0)); + my_free(*(char**)((char*)p-sizeof(void*))); } } diff --git a/storage/ibmdb2i/db2i_ileBridge.cc b/storage/ibmdb2i/db2i_ileBridge.cc index 68ae2c2bb72..fac98dd7107 100644 --- a/storage/ibmdb2i/db2i_ileBridge.cc +++ b/storage/ibmdb2i/db2i_ileBridge.cc @@ -102,7 +102,7 @@ db2i_ileBridge* db2i_ileBridge::createNewBridge(CONNECTION_HANDLE connID) void db2i_ileBridge::destroyBridge(db2i_ileBridge* bridge) { bridge->freeErrorStorage(); - my_free(bridge, MYF(0)); + my_free(bridge); } @@ -1306,7 +1306,7 @@ FILE_HANDLE db2i_ileBridge::PreservedHandleList::findAndRemove(const char* fileN prev->next = next; if (current == head) head = next; - my_free(current, MYF(0)); + my_free(current); DBUG_PRINT("db2i_ileBridge", ("Found handle %d for %s", uint32(tmp), fileName)); return tmp; } diff --git a/storage/ibmdb2i/db2i_ileBridge.h b/storage/ibmdb2i/db2i_ileBridge.h index 10b9820d983..3a3ca141f69 100644 --- a/storage/ibmdb2i/db2i_ileBridge.h +++ b/storage/ibmdb2i/db2i_ileBridge.h @@ -320,7 +320,7 @@ public: { if (likely(connErrText)) { - my_free(connErrText, MYF(0)); + my_free(connErrText); connErrText = NULL; } } diff --git a/storage/ibmdb2i/ha_ibmdb2i.cc b/storage/ibmdb2i/ha_ibmdb2i.cc index 81d7e59d8e3..947df8ad2fe 100644 --- a/storage/ibmdb2i/ha_ibmdb2i.cc +++ b/storage/ibmdb2i/ha_ibmdb2i.cc @@ -404,7 +404,7 @@ IBMDB2I_SHARE *ha_ibmdb2i::get_share(const char *table_name, TABLE *table) error: pthread_mutex_destroy(&share->mutex); - my_free((uchar*) share, MYF(0)); + my_free(share); pthread_mutex_unlock(&ibmdb2i_mutex); return NULL; @@ -423,7 +423,7 @@ int ha_ibmdb2i::free_share(IBMDB2I_SHARE *share) my_hash_delete(&ibmdb2i_open_tables, (uchar*) share); thr_lock_delete(&share->lock); pthread_mutex_destroy(&share->mutex); - my_free(share, MYF(0)); + my_free(share); pthread_mutex_unlock(&ibmdb2i_mutex); return 1; } @@ -571,9 +571,9 @@ ha_ibmdb2i::~ha_ibmdb2i() DBUG_ASSERT(activeReferences == 0 || outstanding_start_bulk_insert); if (indexHandles) - my_free(indexHandles, MYF(0)); + my_free(indexHandles); if (indexReadSizeEstimates) - my_free(indexReadSizeEstimates, MYF(0)); + my_free(indexReadSizeEstimates); cleanupBuffers(); } diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index b3445f86274..6b0d68241ea 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -2199,8 +2199,7 @@ innobase_init( "InnoDB: syntax error in innodb_data_file_path"); mem_free_and_error: srv_free_paths_and_sizes(); - my_free(internal_innobase_data_file_path, - MYF(MY_ALLOW_ZERO_PTR)); + my_free(internal_innobase_data_file_path); goto error; } @@ -2485,8 +2484,7 @@ innobase_end( err = 1; } srv_free_paths_and_sizes(); - my_free(internal_innobase_data_file_path, - MYF(MY_ALLOW_ZERO_PTR)); + my_free(internal_innobase_data_file_path); mysql_mutex_destroy(&innobase_share_mutex); mysql_mutex_destroy(&prepare_commit_mutex); mysql_mutex_destroy(&commit_threads_m); @@ -3439,7 +3437,7 @@ innobase_build_index_translation( func_exit: if (!ret) { /* Build translation table failed. */ - my_free(index_mapping, MYF(MY_ALLOW_ZERO_PTR)); + my_free(index_mapping); share->idx_trans_tbl.array_size = 0; share->idx_trans_tbl.index_count = 0; @@ -3673,7 +3671,7 @@ retry: "how you can resolve the problem.\n", norm_name); free_share(share); - my_free(upd_buff, MYF(0)); + my_free(upd_buff); my_errno = ENOENT; DBUG_RETURN(HA_ERR_NO_SUCH_TABLE); @@ -3689,7 +3687,7 @@ retry: "how you can resolve the problem.\n", norm_name); free_share(share); - my_free(upd_buff, MYF(0)); + my_free(upd_buff); my_errno = ENOENT; dict_table_decrement_handle_count(ib_table, FALSE); @@ -3883,7 +3881,7 @@ ha_innobase::close(void) row_prebuilt_free(prebuilt, FALSE); - my_free(upd_buff, MYF(0)); + my_free(upd_buff); free_share(share); /* Tell InnoDB server that there might be work for @@ -6404,7 +6402,7 @@ create_index( error = convert_error_code_to_mysql(error, flags, NULL); - my_free(field_lengths, MYF(0)); + my_free(field_lengths); DBUG_RETURN(error); } @@ -7215,7 +7213,7 @@ innobase_drop_database( trx = innobase_trx_allocate(thd); #endif error = row_drop_database_for_mysql(namebuf, trx); - my_free(namebuf, MYF(0)); + my_free(namebuf); /* Flush the log to reduce probability that the .frm files and the InnoDB data dictionary get out-of-sync if the user runs @@ -7291,8 +7289,8 @@ innobase_rename_table( log_buffer_flush_to_disk(); } - my_free(norm_to, MYF(0)); - my_free(norm_from, MYF(0)); + my_free(norm_to); + my_free(norm_from); return error; } @@ -7455,7 +7453,7 @@ ha_innobase::records_in_range( mem_heap_free(heap); func_exit: - my_free(key_val_buff2, MYF(0)); + my_free(key_val_buff2); prebuilt->trx->op_info = (char*)""; @@ -8464,7 +8462,7 @@ ha_innobase::free_foreign_key_create_info( char* str) /*!< in, own: create info string to free */ { if (str) { - my_free(str, MYF(0)); + my_free(str); } } @@ -9008,7 +9006,7 @@ innodb_show_status( STRING_WITH_LEN(""), str, flen)) { result= TRUE; } - my_free(str, MYF(0)); + my_free(str); DBUG_RETURN(FALSE); } @@ -9279,10 +9277,9 @@ static void free_share(INNOBASE_SHARE* share) thr_lock_delete(&share->lock); /* Free any memory from index translation table */ - my_free(share->idx_trans_tbl.index_mapping, - MYF(MY_ALLOW_ZERO_PTR)); + my_free(share->idx_trans_tbl.index_mapping); - my_free(share, MYF(0)); + my_free(share); /* TODO: invoke HASH_MIGRATE if innobase_open_tables shrinks too much */ diff --git a/storage/myisam/ft_boolean_search.c b/storage/myisam/ft_boolean_search.c index 52ad6b11aa1..33c1e092a00 100644 --- a/storage/myisam/ft_boolean_search.c +++ b/storage/myisam/ft_boolean_search.c @@ -608,7 +608,7 @@ FT_INFO * ft_init_boolean_search(MI_INFO *info, uint keynr, uchar *query, return ftb; err: free_root(& ftb->mem_root, MYF(0)); - my_free((uchar*)ftb,MYF(0)); + my_free(ftb); return 0; } @@ -1032,7 +1032,7 @@ void ft_boolean_close_search(FT_INFO *ftb) delete_tree(& ftb->no_dupes); } free_root(& ftb->mem_root, MYF(0)); - my_free((uchar*)ftb,MYF(0)); + my_free(ftb); } diff --git a/storage/myisam/ft_nlq_search.c b/storage/myisam/ft_nlq_search.c index 5317da78ee4..7d9b13b7714 100644 --- a/storage/myisam/ft_nlq_search.c +++ b/storage/myisam/ft_nlq_search.c @@ -357,7 +357,7 @@ float ft_nlq_find_relevance(FT_INFO *handler, void ft_nlq_close_search(FT_INFO *handler) { - my_free((uchar*)handler,MYF(0)); + my_free(handler); } diff --git a/storage/myisam/ft_stopwords.c b/storage/myisam/ft_stopwords.c index 9838b15af34..1467cc56759 100644 --- a/storage/myisam/ft_stopwords.c +++ b/storage/myisam/ft_stopwords.c @@ -38,7 +38,7 @@ static void FT_STOPWORD_free(FT_STOPWORD *w, TREE_FREE action, void *arg __attribute__((unused))) { if (action == free_free) - my_free((uchar*) w->pos, MYF(0)); + my_free((void*)w->pos); } static int ft_add_stopword(const char *w) @@ -87,7 +87,7 @@ int ft_init_stopwords() } error=0; err1: - my_free(buffer, MYF(0)); + my_free(buffer); err0: my_close(fd, MYF(MY_WME)); return error; @@ -121,7 +121,7 @@ void ft_free_stopwords() if (stopwords3) { delete_tree(stopwords3); /* purecov: inspected */ - my_free((char*) stopwords3,MYF(0)); + my_free(stopwords3); stopwords3=0; } ft_stopword_file= 0; diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc index 26f6a3903a8..87de58076cd 100644 --- a/storage/myisam/ha_myisam.cc +++ b/storage/myisam/ha_myisam.cc @@ -756,7 +756,7 @@ int ha_myisam::open(const char *name, int mode, uint test_if_locked) recinfo must be freed. */ if (recinfo) - my_free((uchar*) recinfo, MYF(0)); + my_free(recinfo); return my_errno; } @@ -1883,7 +1883,7 @@ int ha_myisam::create(const char *name, register TABLE *table_arg, records, recinfo, 0, (MI_UNIQUEDEF*) 0, &create_info, create_flags); - my_free((uchar*) recinfo, MYF(0)); + my_free(recinfo); DBUG_RETURN(error); } diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c index 25267bfb9ea..13427130069 100644 --- a/storage/myisam/mi_check.c +++ b/storage/myisam/mi_check.c @@ -1369,12 +1369,12 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend) printf("Lost space: %12s Linkdata: %10s\n", llstr(empty,llbuff),llstr(link_used,llbuff2)); } - my_free(mi_get_rec_buff_ptr(info, record), MYF(0)); + my_free(mi_get_rec_buff_ptr(info, record)); DBUG_RETURN (error); err: mi_check_print_error(param,"got error: %d when reading datafile at record: %s",my_errno, llstr(records,llbuff)); err2: - my_free(mi_get_rec_buff_ptr(info, record), MYF(0)); + my_free(mi_get_rec_buff_ptr(info, record)); param->testflag|=T_RETRY_WITHOUT_QUICK; DBUG_RETURN(1); } /* chk_data_link */ @@ -1774,11 +1774,9 @@ err: } mi_mark_crashed_on_repair(info); } - my_free(mi_get_rec_buff_ptr(info, sort_param.rec_buff), - MYF(MY_ALLOW_ZERO_PTR)); - my_free(mi_get_rec_buff_ptr(info, sort_param.record), - MYF(MY_ALLOW_ZERO_PTR)); - my_free(sort_info.buff,MYF(MY_ALLOW_ZERO_PTR)); + my_free(mi_get_rec_buff_ptr(info, sort_param.rec_buff)); + my_free(mi_get_rec_buff_ptr(info, sort_param.record)); + my_free(sort_info.buff); (void) end_io_cache(¶m->read_cache); info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED); (void) end_io_cache(&info->rec_cache); @@ -2208,11 +2206,11 @@ int filecopy(MI_CHECK *param, File to,File from,my_off_t start, mysql_file_write(to, (uchar*) buff, (uint) length, param->myf_rw)) goto err; if (buff != tmp_buff) - my_free(buff,MYF(0)); + my_free(buff); DBUG_RETURN(0); err: if (buff != tmp_buff) - my_free(buff,MYF(0)); + my_free(buff); mi_check_print_error(param,"Can't copy %s to tempfile, error %d", type,my_errno); DBUG_RETURN(1); @@ -2595,13 +2593,11 @@ err: share->state.changed&= ~STATE_NOT_OPTIMIZED_KEYS; share->state.changed|=STATE_NOT_SORTED_PAGES; - my_free(mi_get_rec_buff_ptr(info, sort_param.rec_buff), - MYF(MY_ALLOW_ZERO_PTR)); - my_free(mi_get_rec_buff_ptr(info, sort_param.record), - MYF(MY_ALLOW_ZERO_PTR)); - my_free((uchar*) sort_info.key_block,MYF(MY_ALLOW_ZERO_PTR)); - my_free((uchar*) sort_info.ft_buf, MYF(MY_ALLOW_ZERO_PTR)); - my_free(sort_info.buff,MYF(MY_ALLOW_ZERO_PTR)); + my_free(mi_get_rec_buff_ptr(info, sort_param.rec_buff)); + my_free(mi_get_rec_buff_ptr(info, sort_param.record)); + my_free(sort_info.key_block); + my_free(sort_info.ft_buf); + my_free(sort_info.buff); (void) end_io_cache(¶m->read_cache); info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED); if (!got_error && (param->testflag & T_UNPACK)) @@ -3142,10 +3138,10 @@ err: mysql_mutex_destroy(¶m->print_msg_mutex); param->need_print_msg_lock= 0; - my_free((uchar*) sort_info.ft_buf, MYF(MY_ALLOW_ZERO_PTR)); - my_free((uchar*) sort_info.key_block,MYF(MY_ALLOW_ZERO_PTR)); - my_free((uchar*) sort_param,MYF(MY_ALLOW_ZERO_PTR)); - my_free(sort_info.buff,MYF(MY_ALLOW_ZERO_PTR)); + my_free(sort_info.ft_buf); + my_free(sort_info.key_block); + my_free(sort_param); + my_free(sort_info.buff); (void) end_io_cache(¶m->read_cache); info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED); if (!got_error && (param->testflag & T_UNPACK)) @@ -4551,7 +4547,7 @@ void update_auto_increment_key(MI_CHECK *param, MI_INFO *info, if (my_errno != HA_ERR_END_OF_FILE) { mi_extra(info,HA_EXTRA_NO_KEYREAD,0); - my_free(mi_get_rec_buff_ptr(info, record), MYF(0)); + my_free(mi_get_rec_buff_ptr(info, record)); mi_check_print_error(param,"%d when reading last record",my_errno); DBUG_VOID_RETURN; } @@ -4566,7 +4562,7 @@ void update_auto_increment_key(MI_CHECK *param, MI_INFO *info, set_if_bigger(info->s->state.auto_increment, param->auto_increment_value); } mi_extra(info,HA_EXTRA_NO_KEYREAD,0); - my_free(mi_get_rec_buff_ptr(info, record), MYF(0)); + my_free(mi_get_rec_buff_ptr(info, record)); update_state_info(param, info, UPDATE_AUTO_INC); DBUG_VOID_RETURN; } diff --git a/storage/myisam/mi_close.c b/storage/myisam/mi_close.c index 8ec0bf14e0a..51408ab191c 100644 --- a/storage/myisam/mi_close.c +++ b/storage/myisam/mi_close.c @@ -57,7 +57,7 @@ int mi_close(register MI_INFO *info) myisam_open_list=list_delete(myisam_open_list,&info->open_list); mysql_mutex_unlock(&share->intern_lock); - my_free(mi_get_rec_buff_ptr(info, info->rec_buff), MYF(MY_ALLOW_ZERO_PTR)); + my_free(mi_get_rec_buff_ptr(info, info->rec_buff)); if (flag) { DBUG_EXECUTE_IF("crash_before_flush_keys", @@ -88,8 +88,8 @@ int mi_close(register MI_INFO *info) #endif if (share->decode_trees) { - my_free((uchar*) share->decode_trees,MYF(0)); - my_free((uchar*) share->decode_tables,MYF(0)); + my_free(share->decode_trees); + my_free(share->decode_tables); } #ifdef THREAD thr_lock_delete(&share->lock); @@ -103,19 +103,19 @@ int mi_close(register MI_INFO *info) } } #endif - my_free((uchar*) info->s,MYF(0)); + my_free(info->s); } mysql_mutex_unlock(&THR_LOCK_myisam); if (info->ftparser_param) { - my_free((uchar*)info->ftparser_param, MYF(0)); + my_free(info->ftparser_param); info->ftparser_param= 0; } if (info->dfile >= 0 && mysql_file_close(info->dfile, MYF(0))) error = my_errno; myisam_log_command(MI_LOG_CLOSE,info,NULL,0,error); - my_free((uchar*) info,MYF(0)); + my_free(info); if (error) { diff --git a/storage/myisam/mi_create.c b/storage/myisam/mi_create.c index 3db03e23637..c415264cd98 100644 --- a/storage/myisam/mi_create.c +++ b/storage/myisam/mi_create.c @@ -834,7 +834,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs, mysql_mutex_unlock(&THR_LOCK_myisam); if (mysql_file_close(file, MYF(0))) goto err; - my_free((char*) rec_per_key_part,MYF(0)); + my_free(rec_per_key_part); DBUG_RETURN(0); err: @@ -860,7 +860,7 @@ err: MY_UNPACK_FILENAME | MY_APPEND_EXT), MYF(0)); } - my_free((char*) rec_per_key_part, MYF(0)); + my_free(rec_per_key_part); DBUG_RETURN(my_errno=save_errno); /* return the fatal errno */ } diff --git a/storage/myisam/mi_dynrec.c b/storage/myisam/mi_dynrec.c index 02a8f21e3e2..59b895b5e64 100644 --- a/storage/myisam/mi_dynrec.c +++ b/storage/myisam/mi_dynrec.c @@ -44,7 +44,7 @@ static int _mi_cmp_buffer(File file, const uchar *buff, my_off_t filepos, #undef my_alloca #undef my_afree #define my_alloca(A) my_malloc((A),MYF(0)) -#define my_afree(A) my_free((A),MYF(0)) +#define my_afree(A) my_free((A)) #endif /* Interface function from MI_INFO */ @@ -1575,7 +1575,7 @@ int _mi_cmp_dynamic_unique(MI_INFO *info, MI_UNIQUEDEF *def, error=mi_unique_comp(def, record, old_record, def->null_are_equal); if (info->s->base.blobs) { - my_free(mi_get_rec_buff_ptr(info, info->rec_buff), MYF(MY_ALLOW_ZERO_PTR)); + my_free(mi_get_rec_buff_ptr(info, info->rec_buff)); info->rec_buff=rec_buff; } my_afree(old_record); diff --git a/storage/myisam/mi_open.c b/storage/myisam/mi_open.c index 1d877748b31..014cf1c5a2c 100644 --- a/storage/myisam/mi_open.c +++ b/storage/myisam/mi_open.c @@ -676,7 +676,7 @@ err: mi_report_error(save_errno, name); switch (errpos) { case 6: - my_free((uchar*) m_info,MYF(0)); + my_free(m_info); /* fall through */ case 5: (void) mysql_file_close(info.dfile, MYF(0)); @@ -684,7 +684,7 @@ err: break; /* Don't remove open table */ /* fall through */ case 4: - my_free((uchar*) share,MYF(0)); + my_free(share); /* fall through */ case 3: if (! lock_error) diff --git a/storage/myisam/mi_packrec.c b/storage/myisam/mi_packrec.c index 580c58e6ea1..0ba495fdd68 100644 --- a/storage/myisam/mi_packrec.c +++ b/storage/myisam/mi_packrec.c @@ -298,9 +298,9 @@ my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys) err3: my_errno=HA_ERR_WRONG_IN_RECORD; err2: - my_free((uchar*) share->decode_tables,MYF(0)); + my_free(share->decode_tables); err1: - my_free((uchar*) share->decode_trees,MYF(0)); + my_free(share->decode_trees); err0: DBUG_RETURN(1); } diff --git a/storage/myisam/mi_preload.c b/storage/myisam/mi_preload.c index ae45014eab5..31537f7054b 100644 --- a/storage/myisam/mi_preload.c +++ b/storage/myisam/mi_preload.c @@ -113,11 +113,11 @@ int mi_preload(MI_INFO *info, ulonglong key_map, my_bool ignore_leaves) } while (pos != key_file_length); - my_free((char*) buff, MYF(0)); + my_free(buff); DBUG_RETURN(0); err: - my_free((char*) buff, MYF(MY_ALLOW_ZERO_PTR)); + my_free(buff); DBUG_RETURN(my_errno= errno); } diff --git a/storage/myisam/mi_test2.c b/storage/myisam/mi_test2.c index 63525b08820..60b16d5549e 100644 --- a/storage/myisam/mi_test2.c +++ b/storage/myisam/mi_test2.c @@ -21,9 +21,6 @@ #ifdef DBUG_OFF #undef DBUG_OFF #endif -#ifndef SAFEMALLOC -#define SAFEMALLOC -#endif #include "myisamdef.h" #include #include @@ -856,7 +853,7 @@ reads: %10lu\n", } end_key_cache(dflt_key_cache,1); if (blob_buffer) - my_free(blob_buffer,MYF(0)); + my_free(blob_buffer); my_end(silent ? MY_CHECK_ERROR : MY_CHECK_ERROR | MY_GIVE_INFO); return(0); err: diff --git a/storage/myisam/mi_write.c b/storage/myisam/mi_write.c index 5b46db111b3..f2d43585eef 100644 --- a/storage/myisam/mi_write.c +++ b/storage/myisam/mi_write.c @@ -286,7 +286,7 @@ int _mi_ck_write_btree(register MI_INFO *info, uint keynr, uchar *key, if (!error) error= _mi_ft_convert_to_ft2(info, keynr, key); delete_dynamic(info->ft1_to_ft2); - my_free((uchar*)info->ft1_to_ft2, MYF(0)); + my_free(info->ft1_to_ft2); info->ft1_to_ft2=0; } DBUG_RETURN(error); @@ -1045,7 +1045,7 @@ void mi_end_bulk_insert(MI_INFO *info) delete_tree(& info->bulk_insert[i]); } } - my_free((void *)info->bulk_insert, MYF(0)); + my_free(info->bulk_insert); info->bulk_insert=0; } } diff --git a/storage/myisam/myisamchk.c b/storage/myisam/myisamchk.c index 11ec52fd123..0e32dc59d89 100644 --- a/storage/myisam/myisamchk.c +++ b/storage/myisam/myisamchk.c @@ -1629,11 +1629,10 @@ err: { my_afree((uchar*) temp_buff); } - my_free(mi_get_rec_buff_ptr(info, sort_param.record), - MYF(MY_ALLOW_ZERO_PTR)); + my_free(mi_get_rec_buff_ptr(info, sort_param.record)); info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED); (void) end_io_cache(&info->rec_cache); - my_free(sort_info.buff,MYF(MY_ALLOW_ZERO_PTR)); + my_free(sort_info.buff); sort_info.buff=0; share->state.sortkey=sort_key; DBUG_RETURN(flush_blocks(param, share->key_cache, share->kfile) | @@ -1673,7 +1672,6 @@ static int sort_record_index(MI_SORT_PARAM *sort_param,MI_INFO *info, endpos=buff+used_length; for ( ;; ) { - _sanity(__FILE__,__LINE__); if (nod_flag) { next_page=_mi_kpos(nod_flag,keypos); @@ -1689,7 +1687,6 @@ static int sort_record_index(MI_SORT_PARAM *sort_param,MI_INFO *info, new_file, update_index)) goto err; } - _sanity(__FILE__,__LINE__); if (keypos >= endpos || (key_length=(*keyinfo->get_key)(keyinfo,nod_flag,&keypos,lastkey)) == 0) diff --git a/storage/myisam/myisamlog.c b/storage/myisam/myisamlog.c index 089e3480da6..1733d7140cd 100644 --- a/storage/myisam/myisamlog.c +++ b/storage/myisam/myisamlog.c @@ -616,7 +616,7 @@ static int examine_log(char * file_name, char **table_names) } } } - my_free(buff,MYF(0)); + my_free(buff); break; case MI_LOG_LOCK: if (my_b_read(&cache,(uchar*) head,sizeof(lock_command))) @@ -683,12 +683,12 @@ static int read_string(IO_CACHE *file, register uchar* *to, register uint length DBUG_ENTER("read_string"); if (*to) - my_free((uchar*) *to,MYF(0)); + my_free(*to); if (!(*to= (uchar*) my_malloc(length+1,MYF(MY_WME))) || my_b_read(file,(uchar*) *to,length)) { if (*to) - my_free(*to,MYF(0)); + my_free(*to); *to= 0; DBUG_RETURN(1); } @@ -759,10 +759,10 @@ static void file_info_free(struct file_info *fileinfo) if (!fileinfo->closed) (void) mi_close(fileinfo->isam); if (fileinfo->record) - my_free(fileinfo->record,MYF(0)); + my_free(fileinfo->record); } - my_free(fileinfo->name,MYF(0)); - my_free(fileinfo->show_name,MYF(0)); + my_free(fileinfo->name); + my_free(fileinfo->show_name); DBUG_VOID_RETURN; } diff --git a/storage/myisam/myisampack.c b/storage/myisam/myisampack.c index 18810a60166..d4997a2bcbb 100644 --- a/storage/myisam/myisampack.c +++ b/storage/myisam/myisampack.c @@ -486,7 +486,7 @@ static my_bool open_isam_files(PACK_MRG_INFO *mrg, char **names, uint count) error: while (i--) mi_close(mrg->file[i]); - my_free((uchar*) mrg->file,MYF(0)); + my_free(mrg->file); return 1; } @@ -534,10 +534,10 @@ static int compress(PACK_MRG_INFO *mrg,char *result_table) my_write(join_isam_file,buff,length, MYF(MY_WME | MY_NABP | MY_WAIT_IF_FULL))) { - my_free(buff,MYF(0)); + my_free(buff); goto err; } - my_free(buff,MYF(0)); + my_free(buff); (void) fn_format(new_name,result_table,"",MI_NAME_DEXT,2); } else if (!tmp_dir[0]) @@ -564,7 +564,6 @@ static int compress(PACK_MRG_INFO *mrg,char *result_table) } trees=fields=share->base.fields; huff_counts=init_huff_count(isam_file,mrg->records); - QUICK_SAFEMALLOC; /* Read the whole data file(s) for statistics. @@ -574,7 +573,7 @@ static int compress(PACK_MRG_INFO *mrg,char *result_table) printf("- Calculating statistics\n"); if (get_statistic(mrg,huff_counts)) goto err; - NORMAL_SAFEMALLOC; + old_length=0; for (i=0; i < mrg->count ; i++) old_length+= (mrg->file[i]->s->state.state.data_file_length - @@ -857,11 +856,11 @@ static void free_counts_and_tree_and_queue(HUFF_TREE *huff_trees, uint trees, for (i=0 ; i < trees ; i++) { if (huff_trees[i].element_buffer) - my_free((uchar*) huff_trees[i].element_buffer,MYF(0)); + my_free(huff_trees[i].element_buffer); if (huff_trees[i].code) - my_free((uchar*) huff_trees[i].code,MYF(0)); + my_free(huff_trees[i].code); } - my_free((uchar*) huff_trees,MYF(0)); + my_free(huff_trees); } if (huff_counts) { @@ -869,11 +868,11 @@ static void free_counts_and_tree_and_queue(HUFF_TREE *huff_trees, uint trees, { if (huff_counts[i].tree_buff) { - my_free((uchar*) huff_counts[i].tree_buff,MYF(0)); + my_free(huff_counts[i].tree_buff); delete_tree(&huff_counts[i].int_tree); } } - my_free((uchar*) huff_counts,MYF(0)); + my_free(huff_counts); } delete_queue(&queue); /* This is safe to free */ return; @@ -977,7 +976,7 @@ static int get_statistic(PACK_MRG_INFO *mrg,HUFF_COUNTS *huff_counts) count->int_tree.elements_in_tree > 1)) { delete_tree(&count->int_tree); - my_free(count->tree_buff,MYF(0)); + my_free(count->tree_buff); count->tree_buff=0; } else @@ -1374,12 +1373,12 @@ static void check_counts(HUFF_COUNTS *huff_counts, uint trees, } else { - my_free((uchar*) huff_counts->tree_buff,MYF(0)); + my_free(huff_counts->tree_buff); delete_tree(&huff_counts->int_tree); huff_counts->tree_buff=0; } if (tree.element_buffer) - my_free((uchar*) tree.element_buffer,MYF(0)); + my_free(tree.element_buffer); } if (huff_counts->pack_type & PACK_TYPE_SPACE_FIELDS) space_fields++; @@ -1496,8 +1495,8 @@ static HUFF_TREE* make_huff_trees(HUFF_COUNTS *huff_counts, uint trees) if (make_huff_tree(huff_tree+tree,huff_counts+tree)) { while (tree--) - my_free((uchar*) huff_tree[tree].element_buffer,MYF(0)); - my_free((uchar*) huff_tree,MYF(0)); + my_free(huff_tree[tree].element_buffer); + my_free(huff_tree); DBUG_RETURN(0); } } @@ -1907,7 +1906,7 @@ static uint join_same_trees(HUFF_COUNTS *huff_counts, uint trees) { memcpy_fixed((uchar*) i->counts,(uchar*) count.counts, sizeof(count.counts[0])*256); - my_free((uchar*) j->tree->element_buffer,MYF(0)); + my_free(j->tree->element_buffer); j->tree->element_buffer=0; j->tree=i->tree; bmove((uchar*) i->counts,(uchar*) count.counts, @@ -2913,7 +2912,7 @@ static int flush_buffer(ulong neaded_length) static void end_file_buffer(void) { - my_free((uchar*) file_buffer.buffer,MYF(0)); + my_free(file_buffer.buffer); } /* output `bits` low bits of `value' */ @@ -3117,7 +3116,7 @@ static int mrg_close(PACK_MRG_INFO *mrg) for (i=0 ; i < mrg->count ; i++) error|=mi_close(mrg->file[i]); if (mrg->free_file) - my_free((uchar*) mrg->file,MYF(0)); + my_free(mrg->file); return error; } @@ -3180,7 +3179,7 @@ static void fakebigcodes(HUFF_COUNTS *huff_counts, HUFF_COUNTS *end_count) */ if (huff_counts->tree_buff) { - my_free((uchar*) huff_counts->tree_buff, MYF(0)); + my_free(huff_counts->tree_buff); delete_tree(&huff_counts->int_tree); huff_counts->tree_buff= NULL; DBUG_PRINT("fakebigcodes", ("freed distinct column values")); diff --git a/storage/myisam/rt_index.c b/storage/myisam/rt_index.c index 410badd3145..32cf1fd924d 100644 --- a/storage/myisam/rt_index.c +++ b/storage/myisam/rt_index.c @@ -972,7 +972,7 @@ int rtree_delete(MI_INFO *info, uint keynr, uchar *key, uint key_length) goto err1; } if (ReinsertList.pages) - my_free((uchar*) ReinsertList.pages, MYF(0)); + my_free(ReinsertList.pages); /* check for redundant root (not leaf, 1 child) and eliminate */ if ((old_root = info->s->state.key_root[keynr]) == HA_OFFSET_ERROR) diff --git a/storage/myisam/sort.c b/storage/myisam/sort.c index 539630899f4..a824de8c9fb 100644 --- a/storage/myisam/sort.c +++ b/storage/myisam/sort.c @@ -162,7 +162,7 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages, if (my_init_dynamic_array(&buffpek, sizeof(BUFFPEK), maxbuffer, maxbuffer/2)) { - my_free((uchar*) sort_keys,MYF(0)); + my_free(sort_keys); sort_keys= 0; } else @@ -242,8 +242,7 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages, error =0; err: - if (sort_keys) - my_free((uchar*) sort_keys,MYF(0)); + my_free(sort_keys); delete_dynamic(&buffpek); close_cached_file(&tempfile); close_cached_file(&tempfile_for_exceptions); @@ -382,7 +381,7 @@ pthread_handler_t thr_find_all_keys(void *arg) if (my_init_dynamic_array(&sort_param->buffpek, sizeof(BUFFPEK), maxbuffer, maxbuffer/2)) { - my_free((uchar*) sort_keys,MYF(0)); + my_free(sort_keys); sort_keys= (uchar **) NULL; /* for err: label */ } else @@ -451,8 +450,7 @@ pthread_handler_t thr_find_all_keys(void *arg) err: DBUG_PRINT("error", ("got some error")); sort_param->sort_info->got_error= 1; /* no need to protect with a mutex */ - if (sort_keys) - my_free((uchar*) sort_keys,MYF(0)); + my_free(sort_keys); sort_param->sort_keys= 0; delete_dynamic(& sort_param->buffpek); close_cached_file(&sort_param->tempfile); @@ -509,8 +507,7 @@ int thr_write_keys(MI_SORT_PARAM *sort_param) if (!sinfo->sort_keys) { got_error=1; - my_free(mi_get_rec_buff_ptr(info, sinfo->rec_buff), - MYF(MY_ALLOW_ZERO_PTR)); + my_free(mi_get_rec_buff_ptr(info, sinfo->rec_buff)); continue; } if (!got_error) @@ -528,9 +525,8 @@ int thr_write_keys(MI_SORT_PARAM *sort_param) got_error=1; } } - my_free((uchar*) sinfo->sort_keys,MYF(0)); - my_free(mi_get_rec_buff_ptr(info, sinfo->rec_buff), - MYF(MY_ALLOW_ZERO_PTR)); + my_free(sinfo->sort_keys); + my_free(mi_get_rec_buff_ptr(info, sinfo->rec_buff)); sinfo->sort_keys=0; } @@ -638,7 +634,7 @@ int thr_write_keys(MI_SORT_PARAM *sort_param) sinfo->notnull : NULL, (ulonglong) info->state->records); } - my_free((uchar*) mergebuf,MYF(MY_ALLOW_ZERO_PTR)); + my_free(mergebuf); DBUG_RETURN(got_error); } #endif /* THREAD */ @@ -1057,7 +1053,7 @@ flush_ft_buf(MI_SORT_PARAM *info) if (info->sort_info->ft_buf) { err=sort_ft_buf_flush(info); - my_free((uchar*)info->sort_info->ft_buf, MYF(0)); + my_free(info->sort_info->ft_buf); info->sort_info->ft_buf=0; } return err; diff --git a/storage/myisammrg/ha_myisammrg.cc b/storage/myisammrg/ha_myisammrg.cc index 67b81225b13..bf34bf538a1 100644 --- a/storage/myisammrg/ha_myisammrg.cc +++ b/storage/myisammrg/ha_myisammrg.cc @@ -831,7 +831,7 @@ int ha_myisammrg::attach_children(void) error= HA_ERR_WRONG_MRG_TABLE_DEF; if (!(this->test_if_locked & HA_OPEN_FOR_REPAIR)) { - my_free((uchar*) recinfo, MYF(0)); + my_free(recinfo); goto err; } /* purecov: begin inspected */ @@ -839,7 +839,7 @@ int ha_myisammrg::attach_children(void) /* purecov: end */ } } - my_free((uchar*) recinfo, MYF(0)); + my_free(recinfo); if (error == HA_ERR_WRONG_MRG_TABLE_DEF) goto err; /* purecov: inspected */ diff --git a/storage/myisammrg/myrg_close.c b/storage/myisammrg/myrg_close.c index 45e0a82913a..066a09cadbc 100644 --- a/storage/myisammrg/myrg_close.c +++ b/storage/myisammrg/myrg_close.c @@ -53,13 +53,13 @@ int myrg_close(MYRG_INFO *info) } } else - my_free((uchar*) info->rec_per_key_part, MYF(MY_ALLOW_ZERO_PTR)); + my_free(info->rec_per_key_part); delete_queue(&info->by_key); mysql_mutex_lock(&THR_LOCK_open); myrg_open_list=list_delete(myrg_open_list,&info->open_list); mysql_mutex_unlock(&THR_LOCK_open); mysql_mutex_destroy(&info->mutex); - my_free((uchar*) info,MYF(0)); + my_free(info); if (error) { DBUG_RETURN(my_errno=error); diff --git a/storage/myisammrg/myrg_open.c b/storage/myisammrg/myrg_open.c index 915680ab64c..e4793ffe672 100644 --- a/storage/myisammrg/myrg_open.c +++ b/storage/myisammrg/myrg_open.c @@ -186,7 +186,7 @@ err: case 3: while (files) (void) mi_close(m_info->open_tables[--files].table); - my_free((char*) m_info,MYF(0)); + my_free(m_info); /* Fall through */ case 2: end_io_cache(&file); @@ -339,7 +339,7 @@ MYRG_INFO *myrg_parent_open(const char *parent_name, save_errno= my_errno; switch (errpos) { case 3: - my_free((char*) m_info, MYF(0)); + my_free(m_info); /* Fall through */ case 2: end_io_cache(&file_cache); @@ -422,7 +422,7 @@ int myrg_attach_children(MYRG_INFO *m_info, int handle_locking, key_parts= myisam->s->base.key_parts; if (*need_compat_check && m_info->rec_per_key_part) { - my_free((char *) m_info->rec_per_key_part, MYF(0)); + my_free(m_info->rec_per_key_part); m_info->rec_per_key_part= NULL; } if (!m_info->rec_per_key_part) @@ -491,7 +491,7 @@ err: save_errno= my_errno; switch (errpos) { case 1: - my_free((char*) m_info->rec_per_key_part, MYF(0)); + my_free(m_info->rec_per_key_part); m_info->rec_per_key_part= NULL; } mysql_mutex_unlock(&m_info->mutex); diff --git a/storage/ndb/config/win-lib.am b/storage/ndb/config/win-lib.am index 05ac1ec8a40..1e7bbfae19b 100644 --- a/storage/ndb/config/win-lib.am +++ b/storage/ndb/config/win-lib.am @@ -68,7 +68,7 @@ LIB32=xilink6.exe -lib # PROP Intermediate_Dir "debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /D "WIN32" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /FD /c +# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /D "WIN32" /D "_DEBUG" /D "SAFE_MUTEX" /D "_WINDOWS" /FD /c # ADD BASE CPP @includes@ # ADD CPP @includes@ # SUBTRACT CPP /YX diff --git a/storage/ndb/config/win-prg.am b/storage/ndb/config/win-prg.am index 70c19a70c6d..5d56d79c41e 100644 --- a/storage/ndb/config/win-prg.am +++ b/storage/ndb/config/win-prg.am @@ -71,7 +71,7 @@ LINK32=xilink6.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "NDB_WIN32" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /D "NDB_WIN32" /I "../include" /I "../regex" /I "../zlib" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "HAVE_INNOBASE_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /FD /c +# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /D "NDB_WIN32" /I "../include" /I "../regex" /I "../zlib" /D "_DEBUG" /D "SAFE_MUTEX" /D "HAVE_INNOBASE_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /FD /c # ADD BASE CPP @includes@ # ADD CPP @includes@ # SUBTRACT CPP /Fr /YX diff --git a/storage/ndb/include/util/NdbAutoPtr.hpp b/storage/ndb/include/util/NdbAutoPtr.hpp index 5210fbc6dde..f11b8f0d5bc 100644 --- a/storage/ndb/include/util/NdbAutoPtr.hpp +++ b/storage/ndb/include/util/NdbAutoPtr.hpp @@ -51,8 +51,8 @@ class My_auto_ptr { T * m_obj; public: My_auto_ptr(T * obj = 0){ m_obj = obj;} - void reset(T * obj = 0) { if (m_obj) my_free(m_obj,MYF(0)); m_obj = obj; } - ~My_auto_ptr() { if (m_obj) my_free(m_obj,MYF(0));} + void reset(T * obj = 0) { if (m_obj) my_free(m_obj); m_obj = obj; } + ~My_auto_ptr() { if (m_obj) my_free(m_obj);} }; #endif diff --git a/storage/ndb/src/mgmapi/mgmapi.cpp b/storage/ndb/src/mgmapi/mgmapi.cpp index 662e5c22f48..78c767c31c6 100644 --- a/storage/ndb/src/mgmapi/mgmapi.cpp +++ b/storage/ndb/src/mgmapi/mgmapi.cpp @@ -212,7 +212,7 @@ extern "C" void ndb_mgm_set_name(NdbMgmHandle handle, const char *name) { - my_free(handle->m_name, MYF(MY_ALLOW_ZERO_PTR)); + my_free(handle->m_name); handle->m_name= my_strdup(name, MYF(MY_WME)); } @@ -278,10 +278,10 @@ ndb_mgm_destroy_handle(NdbMgmHandle * handle) } #endif (*handle)->cfg.~LocalConfig(); - my_free((*handle)->m_name, MYF(MY_ALLOW_ZERO_PTR)); + my_free((*handle)->m_name); if ((*handle)->m_bindaddress) free((*handle)->m_bindaddress); - my_free((char*)* handle,MYF(MY_ALLOW_ZERO_PTR)); + my_free(* handle); * handle = 0; DBUG_VOID_RETURN; } diff --git a/storage/ndb/src/mgmapi/ndb_logevent.cpp b/storage/ndb/src/mgmapi/ndb_logevent.cpp index fbf026fd79d..c372f852144 100644 --- a/storage/ndb/src/mgmapi/ndb_logevent.cpp +++ b/storage/ndb/src/mgmapi/ndb_logevent.cpp @@ -82,7 +82,7 @@ void ndb_mgm_destroy_logevent_handle(NdbLogEventHandle * h) if ( *h ) close((*h)->socket); - my_free((char*)* h,MYF(MY_ALLOW_ZERO_PTR)); + my_free(* h); * h = 0; } diff --git a/storage/ndb/test/ndbapi/testIndexStat.cpp b/storage/ndb/test/ndbapi/testIndexStat.cpp index 0e15cdd80d1..559fade3132 100644 --- a/storage/ndb/test/ndbapi/testIndexStat.cpp +++ b/storage/ndb/test/ndbapi/testIndexStat.cpp @@ -404,9 +404,9 @@ static void freekeys() { if (g_keys != 0) - my_free((char*)g_keys, MYF(0)); + my_free(g_keys); if (g_sortkeys != 0) - my_free((char*)g_sortkeys, MYF(0)); + my_free(g_sortkeys); g_keys = 0; g_sortkeys = 0; } @@ -896,7 +896,7 @@ static void freeranges() { if (g_ranges != 0) - my_free((char*)g_ranges, MYF(0)); + my_free(g_ranges); g_ranges = 0; } diff --git a/storage/ndb/tools/restore/consumer_restore.cpp b/storage/ndb/tools/restore/consumer_restore.cpp index e8e8d584f09..f63cbdd2aa2 100644 --- a/storage/ndb/tools/restore/consumer_restore.cpp +++ b/storage/ndb/tools/restore/consumer_restore.cpp @@ -449,13 +449,13 @@ bool BackupRestore::translate_frm(NdbDictionary::Table *table) } if (map_in_frm(new_data, (const char*)data, data_len, &new_data_len)) { - my_free(new_data, MYF(0)); + my_free(new_data); DBUG_RETURN(TRUE); } if (packfrm((uchar*) new_data, new_data_len, &new_pack_data, &new_pack_len)) { - my_free(new_data, MYF(0)); + my_free(new_data); DBUG_RETURN(TRUE); } table->setFrm(new_pack_data, new_pack_len); diff --git a/storage/perfschema/pfs.cc b/storage/perfschema/pfs.cc index f5901540ab0..3cd637ffa66 100644 --- a/storage/perfschema/pfs.cc +++ b/storage/perfschema/pfs.cc @@ -1009,7 +1009,7 @@ void* pfs_spawn_thread(void *arg) */ user_start_routine= typed_arg->m_user_start_routine; user_arg= typed_arg->m_user_arg; - my_free(typed_arg, MYF(0)); + my_free(typed_arg); /* Then, execute the user code for this thread. */ (*user_start_routine)(user_arg); @@ -1037,7 +1037,7 @@ static int spawn_thread_v1(PSI_thread_key key, int result= pthread_create(thread, attr, pfs_spawn_thread, psi_arg); if (unlikely(result != 0)) - my_free(psi_arg, MYF(0)); + my_free(psi_arg); return result; } diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index a490cac054d..1fd2c45cb63 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -19519,7 +19519,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), if (argument) { char *start=argument; - my_free(opt_password, MYF(MY_ALLOW_ZERO_PTR)); + my_free(opt_password); opt_password= my_strdup(argument, MYF(MY_FAE)); while (*argument) *argument++= 'x'; /* Destroy argument */ if (*start) @@ -19676,7 +19676,7 @@ int main(int argc, char **argv) print_test_output(); while (embedded_server_arg_count > 1) - my_free(embedded_server_args[--embedded_server_arg_count],MYF(0)); + my_free(embedded_server_args[--embedded_server_arg_count]); mysql_server_end(); diff --git a/tests/thread_test.c b/tests/thread_test.c index def133f4a3f..1a3dd60c1fd 100644 --- a/tests/thread_test.c +++ b/tests/thread_test.c @@ -150,7 +150,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), case 'p': if (argument) { - my_free(password, MYF(MY_ALLOW_ZERO_PTR)); + my_free(password); password= my_strdup(argument, MYF(MY_FAE)); while (*argument) *argument++= 'x'; /* Destroy argument */ } diff --git a/unittest/mysys/CMakeLists.txt b/unittest/mysys/CMakeLists.txt index 3bf23df6066..56a3d67f25f 100644 --- a/unittest/mysys/CMakeLists.txt +++ b/unittest/mysys/CMakeLists.txt @@ -27,6 +27,6 @@ MACRO (MY_ADD_TEST name) ENDMACRO() -FOREACH(testname bitmap base64 my_vsnprintf my_atomic my_rdtsc lf) +FOREACH(testname bitmap base64 my_vsnprintf my_atomic my_rdtsc lf my_malloc) MY_ADD_TEST(${testname}) ENDFOREACH() diff --git a/unittest/mysys/Makefile.am b/unittest/mysys/Makefile.am index 25b30e331b0..64d2749987e 100644 --- a/unittest/mysys/Makefile.am +++ b/unittest/mysys/Makefile.am @@ -23,7 +23,7 @@ LDADD = $(top_builddir)/unittest/mytap/libmytap.a \ $(top_builddir)/dbug/libdbug.a \ $(top_builddir)/strings/libmystrings.a -noinst_PROGRAMS = bitmap-t base64-t lf-t my_rdtsc-t my_vsnprintf-t +noinst_PROGRAMS = bitmap-t base64-t lf-t my_rdtsc-t my_vsnprintf-t my_malloc-t if NEED_THREAD # my_atomic-t is used to check thread functions, so it is safe to diff --git a/unittest/mysys/my_malloc-t.c b/unittest/mysys/my_malloc-t.c new file mode 100644 index 00000000000..00cac0d21b7 --- /dev/null +++ b/unittest/mysys/my_malloc-t.c @@ -0,0 +1,43 @@ +/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + + 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + +#include +#include +#include "tap.h" + +int main(void) +{ + void *p; + MY_INIT("my_malloc-t"); + + plan(4); + + p= my_malloc(0, MYF(0)); + ok(p != NULL, "Zero-sized block allocation."); + + p= my_realloc(p, 32, MYF(0)); + ok(p != NULL, "Reallocated zero-sized block."); + + p= my_realloc(p, 16, MYF(0)); + ok(p != NULL, "Trimmed block."); + + my_free(p); + p= NULL; + + ok((my_free(p), 1), "Free NULL pointer."); + + return exit_status(); +} + diff --git a/vio/test-ssl.c b/vio/test-ssl.c index 855dc5fbb3e..25a394a1ce0 100644 --- a/vio/test-ssl.c +++ b/vio/test-ssl.c @@ -106,8 +106,8 @@ main(int argc, char** argv) child_pid = fork(); if (child_pid==-1) { - my_free((uchar*)ssl_acceptor,MYF(0)); - my_free((uchar*)ssl_connector,MYF(0)); + my_free(ssl_acceptor); + my_free(ssl_connector); fatal_error("fork"); } if (child_pid==0) @@ -116,28 +116,28 @@ main(int argc, char** argv) char xbuf[100]; int r = vio_read(client_vio,xbuf, sizeof(xbuf)); if (r<=0) { - my_free((uchar*)ssl_acceptor,MYF(0)); - my_free((uchar*)ssl_connector,MYF(0)); + my_free(ssl_acceptor); + my_free(ssl_connector); fatal_error("client:SSL_read"); } xbuf[r] = 0; printf("client:got %s\n", xbuf); - my_free((uchar*)client_vio,MYF(0)); - my_free((uchar*)ssl_acceptor,MYF(0)); - my_free((uchar*)ssl_connector,MYF(0)); + my_free(client_vio); + my_free(ssl_acceptor); + my_free(ssl_connector); } else { const char* s = "Huhuhuh"; int r = vio_write(server_vio,(uchar*)s, strlen(s)); if (r<=0) { - my_free((uchar*)ssl_acceptor,MYF(0)); - my_free((uchar*)ssl_connector,MYF(0)); + my_free(ssl_acceptor); + my_free(ssl_connector); fatal_error("server:SSL_write"); } - my_free((uchar*)server_vio,MYF(0)); - my_free((uchar*)ssl_acceptor,MYF(0)); - my_free((uchar*)ssl_connector,MYF(0)); + my_free(server_vio); + my_free(ssl_acceptor); + my_free(ssl_connector); } return 0; } diff --git a/vio/test-sslclient.c b/vio/test-sslclient.c index e1b8461397b..643dcbf2c8e 100644 --- a/vio/test-sslclient.c +++ b/vio/test-sslclient.c @@ -84,13 +84,13 @@ main( int argc __attribute__((unused)), sslconnect(ssl_connector,client_vio,60L); err = vio_read(client_vio,xbuf, sizeof(xbuf)); if (err<=0) { - my_free((uchar*)ssl_connector,MYF(0)); + my_free(ssl_connector); fatal_error("client:SSL_read"); } xbuf[err] = 0; printf("client:got %s\n", xbuf); - my_free((uchar*)client_vio,MYF(0)); - my_free((uchar*)ssl_connector,MYF(0)); + my_free(client_vio); + my_free(ssl_connector); return 0; } #else /* HAVE_OPENSSL */ diff --git a/vio/test-sslserver.c b/vio/test-sslserver.c index f55b5bae53a..3123a4def2c 100644 --- a/vio/test-sslserver.c +++ b/vio/test-sslserver.c @@ -139,12 +139,12 @@ main(int argc __attribute__((unused)), char** argv) #if 0 if (err<=0) { - my_free((uchar*)ssl_acceptor,MYF(0)); + my_free(ssl_acceptor); fatal_error("server:SSL_write"); } #endif /* 0 */ - my_free((uchar*)ssl_acceptor,MYF(0)); + my_free(ssl_acceptor); return 0; } #else /* HAVE_OPENSSL */ diff --git a/vio/vio.c b/vio/vio.c index 73dd68b938f..67704a56b22 100644 --- a/vio/vio.c +++ b/vio/vio.c @@ -164,7 +164,7 @@ static void vio_init(Vio* vio, enum enum_vio_type type, void vio_reset(Vio* vio, enum enum_vio_type type, my_socket sd, HANDLE hPipe, uint flags) { - my_free(vio->read_buffer, MYF(MY_ALLOW_ZERO_PTR)); + my_free(vio->read_buffer); vio_init(vio, type, sd, hPipe, flags); } @@ -263,8 +263,8 @@ void vio_delete(Vio* vio) if (vio->type != VIO_CLOSED) vio->vioclose(vio); - my_free((uchar*) vio->read_buffer, MYF(MY_ALLOW_ZERO_PTR)); - my_free((uchar*) vio,MYF(0)); + my_free(vio->read_buffer); + my_free(vio); } diff --git a/vio/viosslfactories.c b/vio/viosslfactories.c index d0a0a69f70b..2a38bbdfd57 100644 --- a/vio/viosslfactories.c +++ b/vio/viosslfactories.c @@ -224,7 +224,7 @@ new_VioSSLFd(const char *key_file, const char *cert_file, *error= SSL_INITERR_MEMFAIL; DBUG_PRINT("error", ("%s", sslGetErrString(*error))); report_errors(); - my_free((void*)ssl_fd,MYF(0)); + my_free(ssl_fd); DBUG_RETURN(0); } @@ -240,7 +240,7 @@ new_VioSSLFd(const char *key_file, const char *cert_file, DBUG_PRINT("error", ("%s", sslGetErrString(*error))); report_errors(); SSL_CTX_free(ssl_fd->ssl_context); - my_free((void*)ssl_fd,MYF(0)); + my_free(ssl_fd); DBUG_RETURN(0); } @@ -254,7 +254,7 @@ new_VioSSLFd(const char *key_file, const char *cert_file, DBUG_PRINT("error", ("%s", sslGetErrString(*error))); report_errors(); SSL_CTX_free(ssl_fd->ssl_context); - my_free((void*)ssl_fd,MYF(0)); + my_free(ssl_fd); DBUG_RETURN(0); } } @@ -264,7 +264,7 @@ new_VioSSLFd(const char *key_file, const char *cert_file, DBUG_PRINT("error", ("vio_set_cert_stuff failed")); report_errors(); SSL_CTX_free(ssl_fd->ssl_context); - my_free((void*)ssl_fd,MYF(0)); + my_free(ssl_fd); DBUG_RETURN(0); } @@ -344,6 +344,6 @@ new_VioSSLAcceptorFd(const char *key_file, const char *cert_file, void free_vio_ssl_acceptor_fd(struct st_VioSSLFd *fd) { SSL_CTX_free(fd->ssl_context); - my_free((uchar*) fd, MYF(0)); + my_free(fd); } #endif /* HAVE_OPENSSL */ diff --git a/vio/viotest-ssl.c b/vio/viotest-ssl.c index b8abbac4ed6..5c68e861d2a 100644 --- a/vio/viotest-ssl.c +++ b/vio/viotest-ssl.c @@ -106,8 +106,8 @@ int main(int argc, char **argv) child_pid = fork(); if (child_pid==-1) { - my_free((uchar*)ssl_acceptor,MYF(0)); - my_free((uchar*)ssl_connector,MYF(0)); + my_free(ssl_acceptor); + my_free(ssl_connector); fatal_error("fork"); } if (child_pid==0) @@ -116,15 +116,15 @@ int main(int argc, char **argv) char xbuf[100]; int r = vio_ssl_read(client_vio,xbuf, sizeof(xbuf)); if (r<=0) { - my_free((uchar*)ssl_acceptor,MYF(0)); - my_free((uchar*)ssl_connector,MYF(0)); + my_free(ssl_acceptor); + my_free(ssl_connector); fatal_error("client:SSL_read"); } xbuf[r] = 0; printf("client:got %s\n", xbuf); - my_free((uchar*)client_vio,MYF(0)); - my_free((uchar*)ssl_acceptor,MYF(0)); - my_free((uchar*)ssl_connector,MYF(0)); + my_free(client_vio); + my_free(ssl_acceptor); + my_free(ssl_connector); sleep(1); } else @@ -132,13 +132,13 @@ int main(int argc, char **argv) const char* s = "Huhuhuh"; int r = vio_ssl_write(server_vio,(uchar*)s, strlen(s)); if (r<=0) { - my_free((uchar*)ssl_acceptor,MYF(0)); - my_free((uchar*)ssl_connector,MYF(0)); + my_free(ssl_acceptor); + my_free(ssl_connector); fatal_error("server:SSL_write"); } - my_free((uchar*)server_vio,MYF(0)); - my_free((uchar*)ssl_acceptor,MYF(0)); - my_free((uchar*)ssl_connector,MYF(0)); + my_free(server_vio); + my_free(ssl_acceptor); + my_free(ssl_connector); sleep(1); } return 0; -- cgit v1.2.1 From b9ba876393a302e648897f5091a5b7e0e4eee891 Mon Sep 17 00:00:00 2001 From: Luis Soares Date: Thu, 8 Jul 2010 23:40:48 +0100 Subject: BUG#54744: valgrind reports leak for mysqlbinlog The server was not cleaning up some dbug allocated memory before exiting. This is not a real problem, as this memory would be deallocated anyway. Nonetheless, we improve the mysqlbinlog exit procedure, wrt to memory book-keeping, when no parameter is given. To fix this, we deploy a call to my_end() before the thread exits. --- client/mysqlbinlog.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index 9d85e24d03f..971442e6d60 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -2032,6 +2032,7 @@ int main(int argc, char** argv) { usage(); free_defaults(defaults_argv); + my_end(my_end_arg); exit(1); } -- cgit v1.2.1 From 00e62a03112533adec6e8568c3097eca27823f46 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Thu, 8 Jul 2010 22:19:57 -0300 Subject: Bug#34043: Server loops excessively in _checkchunk() when safemalloc is enabled Post-merge fix: cast argument and correct type in assignment. --- client/mysqltest.cc | 2 +- sql/filesort.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/mysqltest.cc b/client/mysqltest.cc index 1d821c18111..9845a3ec060 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -6338,7 +6338,7 @@ void free_win_path_patterns() for (i=0 ; i < patterns.elements ; i++) { const char** pattern= dynamic_element(&patterns, i, const char**); - my_free(*pattern); + my_free((void *) *pattern); } delete_dynamic(&patterns); } diff --git a/sql/filesort.cc b/sql/filesort.cc index af9387c3129..2398785a038 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -355,7 +355,7 @@ void filesort_free_buffers(TABLE *table, bool full) table->sort.sort_keys= NULL; my_free(table->sort.buffpek); table->sort.buffpek= NULL; - table->sort.buffpek_len= NULL; + table->sort.buffpek_len= 0; } my_free(table->sort.addon_buf); -- cgit v1.2.1 From 1d73bbd3a34750a3e1619b43605b865f4dceccd4 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Fri, 9 Jul 2010 09:39:41 +0400 Subject: Bug#54668 User variable assignments get wrong type Problem: Item_str_ascii_func::val_str() did not set charset of the returned value properly. mysql-test/include/ctype_numconv.inc mysql-test/r/ctype_binary.result mysql-test/r/ctype_cp1251.result mysql-test/r/ctype_latin1.result mysql-test/r/ctype_ucs.result - Adding tests sql/item_strfunc.cc - Adding initialization of charset --- mysql-test/include/ctype_numconv.inc | 19 +++++++++++++++++++ mysql-test/r/ctype_binary.result | 31 +++++++++++++++++++++++++++++++ mysql-test/r/ctype_cp1251.result | 31 +++++++++++++++++++++++++++++++ mysql-test/r/ctype_latin1.result | 31 +++++++++++++++++++++++++++++++ mysql-test/r/ctype_ucs.result | 31 +++++++++++++++++++++++++++++++ sql/item_strfunc.cc | 7 ++++++- 6 files changed, 149 insertions(+), 1 deletion(-) diff --git a/mysql-test/include/ctype_numconv.inc b/mysql-test/include/ctype_numconv.inc index d6bfa23017e..77913fc8c18 100644 --- a/mysql-test/include/ctype_numconv.inc +++ b/mysql-test/include/ctype_numconv.inc @@ -1606,6 +1606,25 @@ drop function f1; --echo # End of WL#2649 Number-to-string conversions --echo # +--echo # +--echo # Bug#54668 User variable assignments get wrong type +--echo # +SET @x=md5('a'); +SELECT charset(@x), collation(@x); +SET @x=old_password('a'); +SELECT charset(@x), collation(@x); +SET @x=password('a'); +SELECT charset(@x), collation(@x); +SET @x=sha('a'); +SELECT charset(@x), collation(@x); +SET @x=sha1('a'); +SELECT charset(@x), collation(@x); +SET @x=astext(point(1,2)); +SELECT charset(@x), collation(@x); +SET @x=aswkt(point(1,2)); +SELECT charset(@x), collation(@x); + + --echo # --echo # Bug#52159 returning time type from function and empty left join causes debug assertion --echo # diff --git a/mysql-test/r/ctype_binary.result b/mysql-test/r/ctype_binary.result index 4b93e6533d7..76a4d0f3cf3 100644 --- a/mysql-test/r/ctype_binary.result +++ b/mysql-test/r/ctype_binary.result @@ -2567,6 +2567,37 @@ drop function f1; # End of WL#2649 Number-to-string conversions # # +# Bug#54668 User variable assignments get wrong type +# +SET @x=md5('a'); +SELECT charset(@x), collation(@x); +charset(@x) collation(@x) +binary binary +SET @x=old_password('a'); +SELECT charset(@x), collation(@x); +charset(@x) collation(@x) +binary binary +SET @x=password('a'); +SELECT charset(@x), collation(@x); +charset(@x) collation(@x) +binary binary +SET @x=sha('a'); +SELECT charset(@x), collation(@x); +charset(@x) collation(@x) +binary binary +SET @x=sha1('a'); +SELECT charset(@x), collation(@x); +charset(@x) collation(@x) +binary binary +SET @x=astext(point(1,2)); +SELECT charset(@x), collation(@x); +charset(@x) collation(@x) +binary binary +SET @x=aswkt(point(1,2)); +SELECT charset(@x), collation(@x); +charset(@x) collation(@x) +binary binary +# # Bug#52159 returning time type from function and empty left join causes debug assertion # CREATE FUNCTION f1() RETURNS TIME RETURN 1; diff --git a/mysql-test/r/ctype_cp1251.result b/mysql-test/r/ctype_cp1251.result index 869a84a34c9..f93cb5f9a12 100644 --- a/mysql-test/r/ctype_cp1251.result +++ b/mysql-test/r/ctype_cp1251.result @@ -2649,6 +2649,37 @@ drop function f1; # End of WL#2649 Number-to-string conversions # # +# Bug#54668 User variable assignments get wrong type +# +SET @x=md5('a'); +SELECT charset(@x), collation(@x); +charset(@x) collation(@x) +cp1251 cp1251_general_ci +SET @x=old_password('a'); +SELECT charset(@x), collation(@x); +charset(@x) collation(@x) +cp1251 cp1251_general_ci +SET @x=password('a'); +SELECT charset(@x), collation(@x); +charset(@x) collation(@x) +cp1251 cp1251_general_ci +SET @x=sha('a'); +SELECT charset(@x), collation(@x); +charset(@x) collation(@x) +cp1251 cp1251_general_ci +SET @x=sha1('a'); +SELECT charset(@x), collation(@x); +charset(@x) collation(@x) +cp1251 cp1251_general_ci +SET @x=astext(point(1,2)); +SELECT charset(@x), collation(@x); +charset(@x) collation(@x) +cp1251 cp1251_general_ci +SET @x=aswkt(point(1,2)); +SELECT charset(@x), collation(@x); +charset(@x) collation(@x) +cp1251 cp1251_general_ci +# # Bug#52159 returning time type from function and empty left join causes debug assertion # CREATE FUNCTION f1() RETURNS TIME RETURN 1; diff --git a/mysql-test/r/ctype_latin1.result b/mysql-test/r/ctype_latin1.result index 8dbd09741ff..43ee365cd53 100644 --- a/mysql-test/r/ctype_latin1.result +++ b/mysql-test/r/ctype_latin1.result @@ -2977,6 +2977,37 @@ drop function f1; # End of WL#2649 Number-to-string conversions # # +# Bug#54668 User variable assignments get wrong type +# +SET @x=md5('a'); +SELECT charset(@x), collation(@x); +charset(@x) collation(@x) +latin1 latin1_swedish_ci +SET @x=old_password('a'); +SELECT charset(@x), collation(@x); +charset(@x) collation(@x) +latin1 latin1_swedish_ci +SET @x=password('a'); +SELECT charset(@x), collation(@x); +charset(@x) collation(@x) +latin1 latin1_swedish_ci +SET @x=sha('a'); +SELECT charset(@x), collation(@x); +charset(@x) collation(@x) +latin1 latin1_swedish_ci +SET @x=sha1('a'); +SELECT charset(@x), collation(@x); +charset(@x) collation(@x) +latin1 latin1_swedish_ci +SET @x=astext(point(1,2)); +SELECT charset(@x), collation(@x); +charset(@x) collation(@x) +latin1 latin1_swedish_ci +SET @x=aswkt(point(1,2)); +SELECT charset(@x), collation(@x); +charset(@x) collation(@x) +latin1 latin1_swedish_ci +# # Bug#52159 returning time type from function and empty left join causes debug assertion # CREATE FUNCTION f1() RETURNS TIME RETURN 1; diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result index 892e893db4d..7bb27e03acc 100644 --- a/mysql-test/r/ctype_ucs.result +++ b/mysql-test/r/ctype_ucs.result @@ -3809,6 +3809,37 @@ drop function f1; # End of WL#2649 Number-to-string conversions # # +# Bug#54668 User variable assignments get wrong type +# +SET @x=md5('a'); +SELECT charset(@x), collation(@x); +charset(@x) collation(@x) +ucs2 ucs2_general_ci +SET @x=old_password('a'); +SELECT charset(@x), collation(@x); +charset(@x) collation(@x) +ucs2 ucs2_general_ci +SET @x=password('a'); +SELECT charset(@x), collation(@x); +charset(@x) collation(@x) +ucs2 ucs2_general_ci +SET @x=sha('a'); +SELECT charset(@x), collation(@x); +charset(@x) collation(@x) +ucs2 ucs2_general_ci +SET @x=sha1('a'); +SELECT charset(@x), collation(@x); +charset(@x) collation(@x) +ucs2 ucs2_general_ci +SET @x=astext(point(1,2)); +SELECT charset(@x), collation(@x); +charset(@x) collation(@x) +ucs2 ucs2_general_ci +SET @x=aswkt(point(1,2)); +SELECT charset(@x), collation(@x); +charset(@x) collation(@x) +ucs2 ucs2_general_ci +# # Bug#52159 returning time type from function and empty left join causes debug assertion # CREATE FUNCTION f1() RETURNS TIME RETURN 1; diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 2a9eef2298d..851d0e07a7e 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -72,7 +72,12 @@ String *Item_str_ascii_func::val_str(String *str) DBUG_ASSERT(fixed == 1); if (!(collation.collation->state & MY_CS_NONASCII)) - return val_str_ascii(str); + { + String *res= val_str_ascii(str); + if (res) + res->set_charset(collation.collation); + return res; + } DBUG_ASSERT(str != &ascii_buf); -- cgit v1.2.1 From 2ccaf604e2aa7ee60a25933671855c8035e6d47c Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Fri, 9 Jul 2010 08:18:36 -0300 Subject: Bug#34043: Server loops excessively in _checkchunk() when safemalloc is enabled Post-merge fix: remove reference to file that is now gone. --- libmysql/Makefile.shared | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmysql/Makefile.shared b/libmysql/Makefile.shared index 2b413831076..e972a6bdec8 100644 --- a/libmysql/Makefile.shared +++ b/libmysql/Makefile.shared @@ -52,7 +52,7 @@ mystringsextra= strto.c dbugobjects = dbug.lo mysysheaders = mysys_priv.h my_static.h vioheaders = vio_priv.h -mysysobjects1 = my_init.lo my_static.lo my_malloc.lo my_realloc.lo \ +mysysobjects1 = my_init.lo my_static.lo my_malloc.lo \ my_create.lo my_delete.lo mf_tempfile.lo my_open.lo \ my_file.lo my_read.lo my_write.lo errors.lo \ my_error.lo my_getwd.lo my_div.lo \ -- cgit v1.2.1 From 5f4033a4d22770840ecc2c977736c44f04cba2b3 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Mon, 12 Jul 2010 09:50:07 -0300 Subject: Following the naming scheme for tests related to functions, rename analyse.test to func_analyse.test. Avoids confusion with the ANALYZE statement. --- mysql-test/r/analyze.result | 66 ------------------------------ mysql-test/r/func_analyse.result | 66 ++++++++++++++++++++++++++++++ mysql-test/t/analyze.test | 87 ---------------------------------------- mysql-test/t/func_analyse.test | 87 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 153 insertions(+), 153 deletions(-) delete mode 100644 mysql-test/r/analyze.result create mode 100644 mysql-test/r/func_analyse.result delete mode 100644 mysql-test/t/analyze.test create mode 100644 mysql-test/t/func_analyse.test diff --git a/mysql-test/r/analyze.result b/mysql-test/r/analyze.result deleted file mode 100644 index df8a6c42924..00000000000 --- a/mysql-test/r/analyze.result +++ /dev/null @@ -1,66 +0,0 @@ -create table t1 (a bigint); -lock tables t1 write; -insert into t1 values(0); -analyze table t1; -Table Op Msg_type Msg_text -test.t1 analyze status OK -unlock tables; -check table t1; -Table Op Msg_type Msg_text -test.t1 check status OK -drop table t1; -create table t1 (a bigint); -insert into t1 values(0); -lock tables t1 write; -delete from t1; -analyze table t1; -Table Op Msg_type Msg_text -test.t1 analyze status OK -unlock tables; -check table t1; -Table Op Msg_type Msg_text -test.t1 check status OK -drop table t1; -create table t1 (a bigint); -insert into t1 values(0); -analyze table t1; -Table Op Msg_type Msg_text -test.t1 analyze status OK -check table t1; -Table Op Msg_type Msg_text -test.t1 check status OK -drop table t1; -create table t1 (a mediumtext, fulltext key key1(a)) charset utf8 collate utf8_general_ci engine myisam; -insert into t1 values ('hello'); -analyze table t1; -Table Op Msg_type Msg_text -test.t1 analyze status OK -analyze table t1; -Table Op Msg_type Msg_text -test.t1 analyze status Table is already up to date -drop table t1; -CREATE TABLE t1 (a int); -prepare stmt1 from "SELECT * FROM t1 PROCEDURE ANALYSE()"; -execute stmt1; -Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype -execute stmt1; -Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype -deallocate prepare stmt1; -drop table t1; -create temporary table t1(a int, index(a)); -insert into t1 values('1'),('2'),('3'),('4'),('5'); -analyze table t1; -Table Op Msg_type Msg_text -test.t1 analyze status OK -show index from t1; -Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment -t1 1 a 1 a A 5 NULL NULL YES BTREE -drop table t1; -End of 4.1 tests -create table t1(a int); -analyze table t1 extended; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'extended' at line 1 -optimize table t1 extended; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'extended' at line 1 -drop table t1; -End of 5.0 tests diff --git a/mysql-test/r/func_analyse.result b/mysql-test/r/func_analyse.result new file mode 100644 index 00000000000..df8a6c42924 --- /dev/null +++ b/mysql-test/r/func_analyse.result @@ -0,0 +1,66 @@ +create table t1 (a bigint); +lock tables t1 write; +insert into t1 values(0); +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +unlock tables; +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +drop table t1; +create table t1 (a bigint); +insert into t1 values(0); +lock tables t1 write; +delete from t1; +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +unlock tables; +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +drop table t1; +create table t1 (a bigint); +insert into t1 values(0); +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +drop table t1; +create table t1 (a mediumtext, fulltext key key1(a)) charset utf8 collate utf8_general_ci engine myisam; +insert into t1 values ('hello'); +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status Table is already up to date +drop table t1; +CREATE TABLE t1 (a int); +prepare stmt1 from "SELECT * FROM t1 PROCEDURE ANALYSE()"; +execute stmt1; +Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype +execute stmt1; +Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype +deallocate prepare stmt1; +drop table t1; +create temporary table t1(a int, index(a)); +insert into t1 values('1'),('2'),('3'),('4'),('5'); +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +show index from t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 a 1 a A 5 NULL NULL YES BTREE +drop table t1; +End of 4.1 tests +create table t1(a int); +analyze table t1 extended; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'extended' at line 1 +optimize table t1 extended; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'extended' at line 1 +drop table t1; +End of 5.0 tests diff --git a/mysql-test/t/analyze.test b/mysql-test/t/analyze.test deleted file mode 100644 index 0903db1eca4..00000000000 --- a/mysql-test/t/analyze.test +++ /dev/null @@ -1,87 +0,0 @@ -# -# Bug #10901 Analyze Table on new table destroys table -# This is minimal test case to get error -# The problem was that analyze table wrote the shared state to the -# file and this didn't include the inserts while locked. A check was -# needed to ensure that state information was not updated when -# executing analyze table for a locked table. The analyze table had -# to be within locks and check table had to be after unlocking since -# then it brings the wrong state from disk rather than from the -# currently correct internal state. The insert is needed since it -# changes the file state, number of records. The fix is to -# synchronise the state of the shared state and the current state -# before calling mi_state_info_write -# - -create table t1 (a bigint); -lock tables t1 write; -insert into t1 values(0); -analyze table t1; -unlock tables; -check table t1; - -drop table t1; - -create table t1 (a bigint); -insert into t1 values(0); -lock tables t1 write; -delete from t1; -analyze table t1; -unlock tables; -check table t1; - -drop table t1; - -create table t1 (a bigint); -insert into t1 values(0); -analyze table t1; -check table t1; - -drop table t1; - -# Bug #14902 ANALYZE TABLE fails to recognize up-to-date tables -# minimal test case to get an error. -# The problem is happening when analysing table with FT index that -# contains stopwords only. The first execution of analyze table should -# mark index statistics as up to date so that next execution of this -# statement will end up with Table is up to date status. -create table t1 (a mediumtext, fulltext key key1(a)) charset utf8 collate utf8_general_ci engine myisam; -insert into t1 values ('hello'); - -analyze table t1; -analyze table t1; - -drop table t1; - -# -# procedure in PS BUG#13673 -# -CREATE TABLE t1 (a int); -prepare stmt1 from "SELECT * FROM t1 PROCEDURE ANALYSE()"; -execute stmt1; -execute stmt1; -deallocate prepare stmt1; -drop table t1; - -# -# bug#15225 (ANALYZE temporary has no effect) -# -create temporary table t1(a int, index(a)); -insert into t1 values('1'),('2'),('3'),('4'),('5'); -analyze table t1; -show index from t1; -drop table t1; - ---echo End of 4.1 tests - -# -# Bug #30495: optimize table t1,t2,t3 extended errors -# -create table t1(a int); ---error 1064 -analyze table t1 extended; ---error 1064 -optimize table t1 extended; -drop table t1; - ---echo End of 5.0 tests diff --git a/mysql-test/t/func_analyse.test b/mysql-test/t/func_analyse.test new file mode 100644 index 00000000000..0903db1eca4 --- /dev/null +++ b/mysql-test/t/func_analyse.test @@ -0,0 +1,87 @@ +# +# Bug #10901 Analyze Table on new table destroys table +# This is minimal test case to get error +# The problem was that analyze table wrote the shared state to the +# file and this didn't include the inserts while locked. A check was +# needed to ensure that state information was not updated when +# executing analyze table for a locked table. The analyze table had +# to be within locks and check table had to be after unlocking since +# then it brings the wrong state from disk rather than from the +# currently correct internal state. The insert is needed since it +# changes the file state, number of records. The fix is to +# synchronise the state of the shared state and the current state +# before calling mi_state_info_write +# + +create table t1 (a bigint); +lock tables t1 write; +insert into t1 values(0); +analyze table t1; +unlock tables; +check table t1; + +drop table t1; + +create table t1 (a bigint); +insert into t1 values(0); +lock tables t1 write; +delete from t1; +analyze table t1; +unlock tables; +check table t1; + +drop table t1; + +create table t1 (a bigint); +insert into t1 values(0); +analyze table t1; +check table t1; + +drop table t1; + +# Bug #14902 ANALYZE TABLE fails to recognize up-to-date tables +# minimal test case to get an error. +# The problem is happening when analysing table with FT index that +# contains stopwords only. The first execution of analyze table should +# mark index statistics as up to date so that next execution of this +# statement will end up with Table is up to date status. +create table t1 (a mediumtext, fulltext key key1(a)) charset utf8 collate utf8_general_ci engine myisam; +insert into t1 values ('hello'); + +analyze table t1; +analyze table t1; + +drop table t1; + +# +# procedure in PS BUG#13673 +# +CREATE TABLE t1 (a int); +prepare stmt1 from "SELECT * FROM t1 PROCEDURE ANALYSE()"; +execute stmt1; +execute stmt1; +deallocate prepare stmt1; +drop table t1; + +# +# bug#15225 (ANALYZE temporary has no effect) +# +create temporary table t1(a int, index(a)); +insert into t1 values('1'),('2'),('3'),('4'),('5'); +analyze table t1; +show index from t1; +drop table t1; + +--echo End of 4.1 tests + +# +# Bug #30495: optimize table t1,t2,t3 extended errors +# +create table t1(a int); +--error 1064 +analyze table t1 extended; +--error 1064 +optimize table t1 extended; +drop table t1; + +--echo End of 5.0 tests -- cgit v1.2.1 From 071636d6fa25909510e3d222d2ed1d919625f55d Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Mon, 12 Jul 2010 10:38:38 -0300 Subject: Revert and fix confusion between tests analyse and analyze. Following the naming scheme for tests related to functions, rename analyse.test to func_analyse.test (test for the ANALYSE() procedure). Avoids confusion with the ANALYZE statement (tested in analyze.test). --- mysql-test/r/analyse.result | 125 ---------------------------- mysql-test/r/analyze.result | 66 +++++++++++++++ mysql-test/r/func_analyse.result | 173 ++++++++++++++++++++++++++------------- mysql-test/t/analyse.test | 135 ------------------------------ mysql-test/t/analyze.test | 87 ++++++++++++++++++++ mysql-test/t/func_analyse.test | 172 ++++++++++++++++++++++++-------------- 6 files changed, 379 insertions(+), 379 deletions(-) delete mode 100644 mysql-test/r/analyse.result create mode 100644 mysql-test/r/analyze.result delete mode 100644 mysql-test/t/analyse.test create mode 100644 mysql-test/t/analyze.test diff --git a/mysql-test/r/analyse.result b/mysql-test/r/analyse.result deleted file mode 100644 index 1820782d2f8..00000000000 --- a/mysql-test/r/analyse.result +++ /dev/null @@ -1,125 +0,0 @@ -drop table if exists t1,t2; -create table t1 (i int, j int, empty_string char(10), bool char(1), d date); -insert into t1 values (1,2,"","Y","2002-03-03"), (3,4,"","N","2002-03-04"), (5,6,"","Y","2002-03-04"), (7,8,"","N","2002-03-05"); -select count(*) from t1 procedure analyse(); -Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype -count(*) 4 4 1 1 0 0 4.0000 0.0000 ENUM('4') NOT NULL -select * from t1 procedure analyse(); -Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype -test.t1.i 1 7 1 1 0 0 4.0000 2.2361 ENUM('1','3','5','7') NOT NULL -test.t1.j 2 8 1 1 0 0 5.0000 2.2361 ENUM('2','4','6','8') NOT NULL -test.t1.empty_string 0 0 4 0 0.0000 NULL CHAR(0) NOT NULL -test.t1.bool N Y 1 1 0 0 1.0000 NULL ENUM('N','Y') NOT NULL -test.t1.d 2002-03-03 2002-03-05 10 10 0 0 10.0000 NULL ENUM('2002-03-03','2002-03-04','2002-03-05') NOT NULL -select * from t1 procedure analyse(2); -Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype -test.t1.i 1 7 1 1 0 0 4.0000 2.2361 TINYINT(1) UNSIGNED NOT NULL -test.t1.j 2 8 1 1 0 0 5.0000 2.2361 TINYINT(1) UNSIGNED NOT NULL -test.t1.empty_string 0 0 4 0 0.0000 NULL CHAR(0) NOT NULL -test.t1.bool N Y 1 1 0 0 1.0000 NULL ENUM('N','Y') NOT NULL -test.t1.d 2002-03-03 2002-03-05 10 10 0 0 10.0000 NULL ENUM('2002-03-03','2002-03-04','2002-03-05') NOT NULL -create table t2 select * from t1 procedure analyse(); -ERROR HY000: Incorrect usage of PROCEDURE and non-SELECT -drop table t1; -EXPLAIN SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE(); -ERROR HY000: Incorrect usage of PROCEDURE and subquery -create table t1 (v varchar(128)); -insert into t1 values ('abc'),('abc\'def\\hij\"klm\0opq'),('\''),('\"'),('\\'),('a\0'),('b\''),('c\"'),('d\\'),('\'b'),('\"c'),('\\d'),('a\0\0\0b'),('a\'\'\'\'b'),('a\"\"\"\"b'),('a\\\\\\\\b'),('\'\0\\\"'),('\'\''),('\"\"'),('\\\\'),('The\ZEnd'); -select * from t1 procedure analyse(); -Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype -test.t1.v " \\ 1 19 0 0 3.7619 NULL ENUM('"','""','"c','\'\0\\"','\'','\'\'','\'b','a\0\0\0b','a\0','a""""b','a\'\'\'\'b','abc','abc\'def\\hij"klm\0opq','a\\\\\\\\b','b\'','c"','d\\','The\ZEnd','\\','\\d','\\\\') NOT NULL -drop table t1; -create table t1 (df decimal(5,1)); -insert into t1 values(1.1); -insert into t1 values(2.2); -select * from t1 procedure analyse(); -Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype -test.t1.df 1.1 2.2 13 13 0 0 1.65000 0.55000 ENUM('1.1','2.2') NOT NULL -drop table t1; -create table t1 (d double); -insert into t1 values (100000); -select * from t1 procedure analyse (1,1); -Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype -test.t1.d 100000 100000 6 6 0 0 100000 0 MEDIUMINT(6) UNSIGNED NOT NULL -drop table t1; -create table t1 (product varchar(32), country_id int not null, year int, -profit int); -insert into t1 values ( 'Computer', 2,2000, 1200), -( 'TV', 1, 1999, 150), -( 'Calculator', 1, 1999,50), -( 'Computer', 1, 1999,1500), -( 'Computer', 1, 2000,1500), -( 'TV', 1, 2000, 150), -( 'TV', 2, 2000, 100), -( 'TV', 2, 2000, 100), -( 'Calculator', 1, 2000,75), -( 'Calculator', 2, 2000,75), -( 'TV', 1, 1999, 100), -( 'Computer', 1, 1999,1200), -( 'Computer', 2, 2000,1500), -( 'Calculator', 2, 2000,75), -( 'Phone', 3, 2003,10) -; -create table t2 (country_id int primary key, country char(20) not null); -insert into t2 values (1, 'USA'),(2,'India'), (3,'Finland'); -select product, sum(profit),avg(profit) from t1 group by product with rollup procedure analyse(); -Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype -test.t1.product Computer TV 2 8 0 0 4.2500 NULL ENUM('Computer','Phone','TV') NOT NULL -sum(profit) 10 6900 11 11 0 0 1946.2500 2867.6719 ENUM('10','275','600','6900') NOT NULL -avg(profit) 10.0000 1380.0000 16 16 0 0 394.68750000 570.20033144 ENUM('10.0000','68.7500','120.0000','1380.0000') NOT NULL -drop table t1,t2; -create table t1 (f1 double(10,5), f2 char(10), f3 double(10,5)); -insert into t1 values (5.999, "5.9999", 5.99999), (9.555, "9.5555", 9.55555); -select f1 from t1 procedure analyse(1, 1); -Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype -test.t1.f1 5.99900 9.55500 7 7 0 0 7.77700 1.77800 FLOAT(4,3) NOT NULL -select f2 from t1 procedure analyse(1, 1); -Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype -test.t1.f2 5.9999 9.5555 6 6 0 0 6.0000 NULL FLOAT(5,4) UNSIGNED NOT NULL -select f3 from t1 procedure analyse(1, 1); -Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype -test.t1.f3 5.99999 9.55555 7 7 0 0 7.77777 1.77778 FLOAT(6,5) NOT NULL -drop table t1; -CREATE TABLE t1(a INT,b INT,c INT,d INT,e INT,f INT,g INT,h INT,i INT,j INT,k INT); -INSERT INTO t1 VALUES (); -SELECT * FROM (SELECT * FROM t1) d PROCEDURE ANALYSE(); -ERROR HY000: Incorrect usage of PROCEDURE and subquery -DROP TABLE t1; -End of 4.1 tests -# -# Bug #48293: crash with procedure analyse, view with > 10 columns, -# having clause... -# -CREATE TABLE t1(a INT, b INT, c INT, d INT, e INT, -f INT, g INT, h INT, i INT, j INT,k INT); -INSERT INTO t1 VALUES (),(); -CREATE ALGORITHM=TEMPTABLE VIEW v1 AS SELECT * FROM t1; -#should have a derived table -EXPLAIN SELECT * FROM v1; -id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY ALL NULL NULL NULL NULL 2 -2 DERIVED t1 ALL NULL NULL NULL NULL 2 -#should not crash -SELECT * FROM v1 PROCEDURE analyse(); -ERROR HY000: Incorrect usage of PROCEDURE and view -#should not crash -SELECT * FROM t1 a, v1, t1 b PROCEDURE analyse(); -ERROR HY000: Incorrect usage of PROCEDURE and view -#should not crash -SELECT * FROM (SELECT * FROM t1 having a > 1) x PROCEDURE analyse(); -ERROR HY000: Incorrect usage of PROCEDURE and subquery -#should not crash -SELECT * FROM t1 a, (SELECT * FROM t1 having a > 1) x, t1 b PROCEDURE analyse(); -ERROR HY000: Incorrect usage of PROCEDURE and subquery -#should not crash -SELECT 1 FROM t1 group by a having a > 1 order by 1 PROCEDURE analyse(); -ERROR HY000: Can't use ORDER clause with this procedure -DROP VIEW v1; -DROP TABLE t1; -CREATE TABLE t1(a INT); -INSERT INTO t1 VALUES (1),(2); -# should not crash -CREATE TABLE t2 SELECT 1 FROM t1, t1 t3 GROUP BY t3.a PROCEDURE ANALYSE(); -ERROR HY000: Incorrect usage of PROCEDURE and non-SELECT -DROP TABLE t1; -End of 5.0 tests diff --git a/mysql-test/r/analyze.result b/mysql-test/r/analyze.result new file mode 100644 index 00000000000..df8a6c42924 --- /dev/null +++ b/mysql-test/r/analyze.result @@ -0,0 +1,66 @@ +create table t1 (a bigint); +lock tables t1 write; +insert into t1 values(0); +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +unlock tables; +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +drop table t1; +create table t1 (a bigint); +insert into t1 values(0); +lock tables t1 write; +delete from t1; +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +unlock tables; +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +drop table t1; +create table t1 (a bigint); +insert into t1 values(0); +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +drop table t1; +create table t1 (a mediumtext, fulltext key key1(a)) charset utf8 collate utf8_general_ci engine myisam; +insert into t1 values ('hello'); +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status Table is already up to date +drop table t1; +CREATE TABLE t1 (a int); +prepare stmt1 from "SELECT * FROM t1 PROCEDURE ANALYSE()"; +execute stmt1; +Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype +execute stmt1; +Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype +deallocate prepare stmt1; +drop table t1; +create temporary table t1(a int, index(a)); +insert into t1 values('1'),('2'),('3'),('4'),('5'); +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +show index from t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment +t1 1 a 1 a A 5 NULL NULL YES BTREE +drop table t1; +End of 4.1 tests +create table t1(a int); +analyze table t1 extended; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'extended' at line 1 +optimize table t1 extended; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'extended' at line 1 +drop table t1; +End of 5.0 tests diff --git a/mysql-test/r/func_analyse.result b/mysql-test/r/func_analyse.result index df8a6c42924..1820782d2f8 100644 --- a/mysql-test/r/func_analyse.result +++ b/mysql-test/r/func_analyse.result @@ -1,66 +1,125 @@ -create table t1 (a bigint); -lock tables t1 write; -insert into t1 values(0); -analyze table t1; -Table Op Msg_type Msg_text -test.t1 analyze status OK -unlock tables; -check table t1; -Table Op Msg_type Msg_text -test.t1 check status OK +drop table if exists t1,t2; +create table t1 (i int, j int, empty_string char(10), bool char(1), d date); +insert into t1 values (1,2,"","Y","2002-03-03"), (3,4,"","N","2002-03-04"), (5,6,"","Y","2002-03-04"), (7,8,"","N","2002-03-05"); +select count(*) from t1 procedure analyse(); +Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype +count(*) 4 4 1 1 0 0 4.0000 0.0000 ENUM('4') NOT NULL +select * from t1 procedure analyse(); +Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype +test.t1.i 1 7 1 1 0 0 4.0000 2.2361 ENUM('1','3','5','7') NOT NULL +test.t1.j 2 8 1 1 0 0 5.0000 2.2361 ENUM('2','4','6','8') NOT NULL +test.t1.empty_string 0 0 4 0 0.0000 NULL CHAR(0) NOT NULL +test.t1.bool N Y 1 1 0 0 1.0000 NULL ENUM('N','Y') NOT NULL +test.t1.d 2002-03-03 2002-03-05 10 10 0 0 10.0000 NULL ENUM('2002-03-03','2002-03-04','2002-03-05') NOT NULL +select * from t1 procedure analyse(2); +Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype +test.t1.i 1 7 1 1 0 0 4.0000 2.2361 TINYINT(1) UNSIGNED NOT NULL +test.t1.j 2 8 1 1 0 0 5.0000 2.2361 TINYINT(1) UNSIGNED NOT NULL +test.t1.empty_string 0 0 4 0 0.0000 NULL CHAR(0) NOT NULL +test.t1.bool N Y 1 1 0 0 1.0000 NULL ENUM('N','Y') NOT NULL +test.t1.d 2002-03-03 2002-03-05 10 10 0 0 10.0000 NULL ENUM('2002-03-03','2002-03-04','2002-03-05') NOT NULL +create table t2 select * from t1 procedure analyse(); +ERROR HY000: Incorrect usage of PROCEDURE and non-SELECT drop table t1; -create table t1 (a bigint); -insert into t1 values(0); -lock tables t1 write; -delete from t1; -analyze table t1; -Table Op Msg_type Msg_text -test.t1 analyze status OK -unlock tables; -check table t1; -Table Op Msg_type Msg_text -test.t1 check status OK +EXPLAIN SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE(); +ERROR HY000: Incorrect usage of PROCEDURE and subquery +create table t1 (v varchar(128)); +insert into t1 values ('abc'),('abc\'def\\hij\"klm\0opq'),('\''),('\"'),('\\'),('a\0'),('b\''),('c\"'),('d\\'),('\'b'),('\"c'),('\\d'),('a\0\0\0b'),('a\'\'\'\'b'),('a\"\"\"\"b'),('a\\\\\\\\b'),('\'\0\\\"'),('\'\''),('\"\"'),('\\\\'),('The\ZEnd'); +select * from t1 procedure analyse(); +Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype +test.t1.v " \\ 1 19 0 0 3.7619 NULL ENUM('"','""','"c','\'\0\\"','\'','\'\'','\'b','a\0\0\0b','a\0','a""""b','a\'\'\'\'b','abc','abc\'def\\hij"klm\0opq','a\\\\\\\\b','b\'','c"','d\\','The\ZEnd','\\','\\d','\\\\') NOT NULL drop table t1; -create table t1 (a bigint); -insert into t1 values(0); -analyze table t1; -Table Op Msg_type Msg_text -test.t1 analyze status OK -check table t1; -Table Op Msg_type Msg_text -test.t1 check status OK +create table t1 (df decimal(5,1)); +insert into t1 values(1.1); +insert into t1 values(2.2); +select * from t1 procedure analyse(); +Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype +test.t1.df 1.1 2.2 13 13 0 0 1.65000 0.55000 ENUM('1.1','2.2') NOT NULL drop table t1; -create table t1 (a mediumtext, fulltext key key1(a)) charset utf8 collate utf8_general_ci engine myisam; -insert into t1 values ('hello'); -analyze table t1; -Table Op Msg_type Msg_text -test.t1 analyze status OK -analyze table t1; -Table Op Msg_type Msg_text -test.t1 analyze status Table is already up to date +create table t1 (d double); +insert into t1 values (100000); +select * from t1 procedure analyse (1,1); +Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype +test.t1.d 100000 100000 6 6 0 0 100000 0 MEDIUMINT(6) UNSIGNED NOT NULL drop table t1; -CREATE TABLE t1 (a int); -prepare stmt1 from "SELECT * FROM t1 PROCEDURE ANALYSE()"; -execute stmt1; +create table t1 (product varchar(32), country_id int not null, year int, +profit int); +insert into t1 values ( 'Computer', 2,2000, 1200), +( 'TV', 1, 1999, 150), +( 'Calculator', 1, 1999,50), +( 'Computer', 1, 1999,1500), +( 'Computer', 1, 2000,1500), +( 'TV', 1, 2000, 150), +( 'TV', 2, 2000, 100), +( 'TV', 2, 2000, 100), +( 'Calculator', 1, 2000,75), +( 'Calculator', 2, 2000,75), +( 'TV', 1, 1999, 100), +( 'Computer', 1, 1999,1200), +( 'Computer', 2, 2000,1500), +( 'Calculator', 2, 2000,75), +( 'Phone', 3, 2003,10) +; +create table t2 (country_id int primary key, country char(20) not null); +insert into t2 values (1, 'USA'),(2,'India'), (3,'Finland'); +select product, sum(profit),avg(profit) from t1 group by product with rollup procedure analyse(); Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype -execute stmt1; +test.t1.product Computer TV 2 8 0 0 4.2500 NULL ENUM('Computer','Phone','TV') NOT NULL +sum(profit) 10 6900 11 11 0 0 1946.2500 2867.6719 ENUM('10','275','600','6900') NOT NULL +avg(profit) 10.0000 1380.0000 16 16 0 0 394.68750000 570.20033144 ENUM('10.0000','68.7500','120.0000','1380.0000') NOT NULL +drop table t1,t2; +create table t1 (f1 double(10,5), f2 char(10), f3 double(10,5)); +insert into t1 values (5.999, "5.9999", 5.99999), (9.555, "9.5555", 9.55555); +select f1 from t1 procedure analyse(1, 1); Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype -deallocate prepare stmt1; -drop table t1; -create temporary table t1(a int, index(a)); -insert into t1 values('1'),('2'),('3'),('4'),('5'); -analyze table t1; -Table Op Msg_type Msg_text -test.t1 analyze status OK -show index from t1; -Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment -t1 1 a 1 a A 5 NULL NULL YES BTREE +test.t1.f1 5.99900 9.55500 7 7 0 0 7.77700 1.77800 FLOAT(4,3) NOT NULL +select f2 from t1 procedure analyse(1, 1); +Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype +test.t1.f2 5.9999 9.5555 6 6 0 0 6.0000 NULL FLOAT(5,4) UNSIGNED NOT NULL +select f3 from t1 procedure analyse(1, 1); +Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype +test.t1.f3 5.99999 9.55555 7 7 0 0 7.77777 1.77778 FLOAT(6,5) NOT NULL drop table t1; +CREATE TABLE t1(a INT,b INT,c INT,d INT,e INT,f INT,g INT,h INT,i INT,j INT,k INT); +INSERT INTO t1 VALUES (); +SELECT * FROM (SELECT * FROM t1) d PROCEDURE ANALYSE(); +ERROR HY000: Incorrect usage of PROCEDURE and subquery +DROP TABLE t1; End of 4.1 tests -create table t1(a int); -analyze table t1 extended; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'extended' at line 1 -optimize table t1 extended; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'extended' at line 1 -drop table t1; +# +# Bug #48293: crash with procedure analyse, view with > 10 columns, +# having clause... +# +CREATE TABLE t1(a INT, b INT, c INT, d INT, e INT, +f INT, g INT, h INT, i INT, j INT,k INT); +INSERT INTO t1 VALUES (),(); +CREATE ALGORITHM=TEMPTABLE VIEW v1 AS SELECT * FROM t1; +#should have a derived table +EXPLAIN SELECT * FROM v1; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY ALL NULL NULL NULL NULL 2 +2 DERIVED t1 ALL NULL NULL NULL NULL 2 +#should not crash +SELECT * FROM v1 PROCEDURE analyse(); +ERROR HY000: Incorrect usage of PROCEDURE and view +#should not crash +SELECT * FROM t1 a, v1, t1 b PROCEDURE analyse(); +ERROR HY000: Incorrect usage of PROCEDURE and view +#should not crash +SELECT * FROM (SELECT * FROM t1 having a > 1) x PROCEDURE analyse(); +ERROR HY000: Incorrect usage of PROCEDURE and subquery +#should not crash +SELECT * FROM t1 a, (SELECT * FROM t1 having a > 1) x, t1 b PROCEDURE analyse(); +ERROR HY000: Incorrect usage of PROCEDURE and subquery +#should not crash +SELECT 1 FROM t1 group by a having a > 1 order by 1 PROCEDURE analyse(); +ERROR HY000: Can't use ORDER clause with this procedure +DROP VIEW v1; +DROP TABLE t1; +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES (1),(2); +# should not crash +CREATE TABLE t2 SELECT 1 FROM t1, t1 t3 GROUP BY t3.a PROCEDURE ANALYSE(); +ERROR HY000: Incorrect usage of PROCEDURE and non-SELECT +DROP TABLE t1; End of 5.0 tests diff --git a/mysql-test/t/analyse.test b/mysql-test/t/analyse.test deleted file mode 100644 index 05f739bfd69..00000000000 --- a/mysql-test/t/analyse.test +++ /dev/null @@ -1,135 +0,0 @@ -# -# Test of procedure analyse -# - ---disable_warnings -drop table if exists t1,t2; ---enable_warnings -create table t1 (i int, j int, empty_string char(10), bool char(1), d date); -insert into t1 values (1,2,"","Y","2002-03-03"), (3,4,"","N","2002-03-04"), (5,6,"","Y","2002-03-04"), (7,8,"","N","2002-03-05"); -select count(*) from t1 procedure analyse(); -select * from t1 procedure analyse(); -select * from t1 procedure analyse(2); ---error ER_WRONG_USAGE -create table t2 select * from t1 procedure analyse(); -drop table t1; - ---error ER_WRONG_USAGE -EXPLAIN SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE(); - -# -# Bug#2813 - analyse does not quote string values in enums from string -# - -create table t1 (v varchar(128)); -insert into t1 values ('abc'),('abc\'def\\hij\"klm\0opq'),('\''),('\"'),('\\'),('a\0'),('b\''),('c\"'),('d\\'),('\'b'),('\"c'),('\\d'),('a\0\0\0b'),('a\'\'\'\'b'),('a\"\"\"\"b'),('a\\\\\\\\b'),('\'\0\\\"'),('\'\''),('\"\"'),('\\\\'),('The\ZEnd'); -select * from t1 procedure analyse(); -drop table t1; - -#decimal-related test - -create table t1 (df decimal(5,1)); -insert into t1 values(1.1); -insert into t1 values(2.2); -select * from t1 procedure analyse(); -drop table t1; - -# -# Bug#10716 - Procedure Analyse results in wrong values for optimal field type -# - -create table t1 (d double); -insert into t1 values (100000); -select * from t1 procedure analyse (1,1); -drop table t1; - -# -# Bug #14138 ROLLUP and PROCEDURE ANALYSE() hang server -# -create table t1 (product varchar(32), country_id int not null, year int, - profit int); -insert into t1 values ( 'Computer', 2,2000, 1200), - ( 'TV', 1, 1999, 150), - ( 'Calculator', 1, 1999,50), - ( 'Computer', 1, 1999,1500), - ( 'Computer', 1, 2000,1500), - ( 'TV', 1, 2000, 150), - ( 'TV', 2, 2000, 100), - ( 'TV', 2, 2000, 100), - ( 'Calculator', 1, 2000,75), - ( 'Calculator', 2, 2000,75), - ( 'TV', 1, 1999, 100), - ( 'Computer', 1, 1999,1200), - ( 'Computer', 2, 2000,1500), - ( 'Calculator', 2, 2000,75), - ( 'Phone', 3, 2003,10) - ; -create table t2 (country_id int primary key, country char(20) not null); -insert into t2 values (1, 'USA'),(2,'India'), (3,'Finland'); -select product, sum(profit),avg(profit) from t1 group by product with rollup procedure analyse(); -drop table t1,t2; - -# -# Bug #20305 PROCEDURE ANALYSE() returns wrong M for FLOAT(M, D) and DOUBLE(M, D) -# - -create table t1 (f1 double(10,5), f2 char(10), f3 double(10,5)); -insert into t1 values (5.999, "5.9999", 5.99999), (9.555, "9.5555", 9.55555); -select f1 from t1 procedure analyse(1, 1); -select f2 from t1 procedure analyse(1, 1); -select f3 from t1 procedure analyse(1, 1); -drop table t1; - -# -# Bug#46184 Crash, SELECT ... FROM derived table procedure analyze -# -CREATE TABLE t1(a INT,b INT,c INT,d INT,e INT,f INT,g INT,h INT,i INT,j INT,k INT); -INSERT INTO t1 VALUES (); ---error ER_WRONG_USAGE -SELECT * FROM (SELECT * FROM t1) d PROCEDURE ANALYSE(); -DROP TABLE t1; - ---echo End of 4.1 tests - ---echo # ---echo # Bug #48293: crash with procedure analyse, view with > 10 columns, ---echo # having clause... ---echo # - -CREATE TABLE t1(a INT, b INT, c INT, d INT, e INT, - f INT, g INT, h INT, i INT, j INT,k INT); -INSERT INTO t1 VALUES (),(); - -CREATE ALGORITHM=TEMPTABLE VIEW v1 AS SELECT * FROM t1; ---echo #should have a derived table -EXPLAIN SELECT * FROM v1; ---echo #should not crash ---error ER_WRONG_USAGE -SELECT * FROM v1 PROCEDURE analyse(); ---echo #should not crash ---error ER_WRONG_USAGE -SELECT * FROM t1 a, v1, t1 b PROCEDURE analyse(); ---echo #should not crash ---error ER_WRONG_USAGE -SELECT * FROM (SELECT * FROM t1 having a > 1) x PROCEDURE analyse(); ---echo #should not crash ---error ER_WRONG_USAGE -SELECT * FROM t1 a, (SELECT * FROM t1 having a > 1) x, t1 b PROCEDURE analyse(); ---echo #should not crash ---error ER_ORDER_WITH_PROC -SELECT 1 FROM t1 group by a having a > 1 order by 1 PROCEDURE analyse(); - -DROP VIEW v1; -DROP TABLE t1; - -CREATE TABLE t1(a INT); -INSERT INTO t1 VALUES (1),(2); - ---echo # should not crash ---error ER_WRONG_USAGE -CREATE TABLE t2 SELECT 1 FROM t1, t1 t3 GROUP BY t3.a PROCEDURE ANALYSE(); - -DROP TABLE t1; - - ---echo End of 5.0 tests diff --git a/mysql-test/t/analyze.test b/mysql-test/t/analyze.test new file mode 100644 index 00000000000..0903db1eca4 --- /dev/null +++ b/mysql-test/t/analyze.test @@ -0,0 +1,87 @@ +# +# Bug #10901 Analyze Table on new table destroys table +# This is minimal test case to get error +# The problem was that analyze table wrote the shared state to the +# file and this didn't include the inserts while locked. A check was +# needed to ensure that state information was not updated when +# executing analyze table for a locked table. The analyze table had +# to be within locks and check table had to be after unlocking since +# then it brings the wrong state from disk rather than from the +# currently correct internal state. The insert is needed since it +# changes the file state, number of records. The fix is to +# synchronise the state of the shared state and the current state +# before calling mi_state_info_write +# + +create table t1 (a bigint); +lock tables t1 write; +insert into t1 values(0); +analyze table t1; +unlock tables; +check table t1; + +drop table t1; + +create table t1 (a bigint); +insert into t1 values(0); +lock tables t1 write; +delete from t1; +analyze table t1; +unlock tables; +check table t1; + +drop table t1; + +create table t1 (a bigint); +insert into t1 values(0); +analyze table t1; +check table t1; + +drop table t1; + +# Bug #14902 ANALYZE TABLE fails to recognize up-to-date tables +# minimal test case to get an error. +# The problem is happening when analysing table with FT index that +# contains stopwords only. The first execution of analyze table should +# mark index statistics as up to date so that next execution of this +# statement will end up with Table is up to date status. +create table t1 (a mediumtext, fulltext key key1(a)) charset utf8 collate utf8_general_ci engine myisam; +insert into t1 values ('hello'); + +analyze table t1; +analyze table t1; + +drop table t1; + +# +# procedure in PS BUG#13673 +# +CREATE TABLE t1 (a int); +prepare stmt1 from "SELECT * FROM t1 PROCEDURE ANALYSE()"; +execute stmt1; +execute stmt1; +deallocate prepare stmt1; +drop table t1; + +# +# bug#15225 (ANALYZE temporary has no effect) +# +create temporary table t1(a int, index(a)); +insert into t1 values('1'),('2'),('3'),('4'),('5'); +analyze table t1; +show index from t1; +drop table t1; + +--echo End of 4.1 tests + +# +# Bug #30495: optimize table t1,t2,t3 extended errors +# +create table t1(a int); +--error 1064 +analyze table t1 extended; +--error 1064 +optimize table t1 extended; +drop table t1; + +--echo End of 5.0 tests diff --git a/mysql-test/t/func_analyse.test b/mysql-test/t/func_analyse.test index 0903db1eca4..05f739bfd69 100644 --- a/mysql-test/t/func_analyse.test +++ b/mysql-test/t/func_analyse.test @@ -1,87 +1,135 @@ # -# Bug #10901 Analyze Table on new table destroys table -# This is minimal test case to get error -# The problem was that analyze table wrote the shared state to the -# file and this didn't include the inserts while locked. A check was -# needed to ensure that state information was not updated when -# executing analyze table for a locked table. The analyze table had -# to be within locks and check table had to be after unlocking since -# then it brings the wrong state from disk rather than from the -# currently correct internal state. The insert is needed since it -# changes the file state, number of records. The fix is to -# synchronise the state of the shared state and the current state -# before calling mi_state_info_write +# Test of procedure analyse # -create table t1 (a bigint); -lock tables t1 write; -insert into t1 values(0); -analyze table t1; -unlock tables; -check table t1; - +--disable_warnings +drop table if exists t1,t2; +--enable_warnings +create table t1 (i int, j int, empty_string char(10), bool char(1), d date); +insert into t1 values (1,2,"","Y","2002-03-03"), (3,4,"","N","2002-03-04"), (5,6,"","Y","2002-03-04"), (7,8,"","N","2002-03-05"); +select count(*) from t1 procedure analyse(); +select * from t1 procedure analyse(); +select * from t1 procedure analyse(2); +--error ER_WRONG_USAGE +create table t2 select * from t1 procedure analyse(); drop table t1; -create table t1 (a bigint); -insert into t1 values(0); -lock tables t1 write; -delete from t1; -analyze table t1; -unlock tables; -check table t1; +--error ER_WRONG_USAGE +EXPLAIN SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE(); + +# +# Bug#2813 - analyse does not quote string values in enums from string +# +create table t1 (v varchar(128)); +insert into t1 values ('abc'),('abc\'def\\hij\"klm\0opq'),('\''),('\"'),('\\'),('a\0'),('b\''),('c\"'),('d\\'),('\'b'),('\"c'),('\\d'),('a\0\0\0b'),('a\'\'\'\'b'),('a\"\"\"\"b'),('a\\\\\\\\b'),('\'\0\\\"'),('\'\''),('\"\"'),('\\\\'),('The\ZEnd'); +select * from t1 procedure analyse(); drop table t1; -create table t1 (a bigint); -insert into t1 values(0); -analyze table t1; -check table t1; +#decimal-related test +create table t1 (df decimal(5,1)); +insert into t1 values(1.1); +insert into t1 values(2.2); +select * from t1 procedure analyse(); drop table t1; -# Bug #14902 ANALYZE TABLE fails to recognize up-to-date tables -# minimal test case to get an error. -# The problem is happening when analysing table with FT index that -# contains stopwords only. The first execution of analyze table should -# mark index statistics as up to date so that next execution of this -# statement will end up with Table is up to date status. -create table t1 (a mediumtext, fulltext key key1(a)) charset utf8 collate utf8_general_ci engine myisam; -insert into t1 values ('hello'); - -analyze table t1; -analyze table t1; +# +# Bug#10716 - Procedure Analyse results in wrong values for optimal field type +# +create table t1 (d double); +insert into t1 values (100000); +select * from t1 procedure analyse (1,1); drop table t1; # -# procedure in PS BUG#13673 +# Bug #14138 ROLLUP and PROCEDURE ANALYSE() hang server # -CREATE TABLE t1 (a int); -prepare stmt1 from "SELECT * FROM t1 PROCEDURE ANALYSE()"; -execute stmt1; -execute stmt1; -deallocate prepare stmt1; -drop table t1; +create table t1 (product varchar(32), country_id int not null, year int, + profit int); +insert into t1 values ( 'Computer', 2,2000, 1200), + ( 'TV', 1, 1999, 150), + ( 'Calculator', 1, 1999,50), + ( 'Computer', 1, 1999,1500), + ( 'Computer', 1, 2000,1500), + ( 'TV', 1, 2000, 150), + ( 'TV', 2, 2000, 100), + ( 'TV', 2, 2000, 100), + ( 'Calculator', 1, 2000,75), + ( 'Calculator', 2, 2000,75), + ( 'TV', 1, 1999, 100), + ( 'Computer', 1, 1999,1200), + ( 'Computer', 2, 2000,1500), + ( 'Calculator', 2, 2000,75), + ( 'Phone', 3, 2003,10) + ; +create table t2 (country_id int primary key, country char(20) not null); +insert into t2 values (1, 'USA'),(2,'India'), (3,'Finland'); +select product, sum(profit),avg(profit) from t1 group by product with rollup procedure analyse(); +drop table t1,t2; # -# bug#15225 (ANALYZE temporary has no effect) +# Bug #20305 PROCEDURE ANALYSE() returns wrong M for FLOAT(M, D) and DOUBLE(M, D) # -create temporary table t1(a int, index(a)); -insert into t1 values('1'),('2'),('3'),('4'),('5'); -analyze table t1; -show index from t1; -drop table t1; ---echo End of 4.1 tests +create table t1 (f1 double(10,5), f2 char(10), f3 double(10,5)); +insert into t1 values (5.999, "5.9999", 5.99999), (9.555, "9.5555", 9.55555); +select f1 from t1 procedure analyse(1, 1); +select f2 from t1 procedure analyse(1, 1); +select f3 from t1 procedure analyse(1, 1); +drop table t1; # -# Bug #30495: optimize table t1,t2,t3 extended errors +# Bug#46184 Crash, SELECT ... FROM derived table procedure analyze # -create table t1(a int); ---error 1064 -analyze table t1 extended; ---error 1064 -optimize table t1 extended; -drop table t1; +CREATE TABLE t1(a INT,b INT,c INT,d INT,e INT,f INT,g INT,h INT,i INT,j INT,k INT); +INSERT INTO t1 VALUES (); +--error ER_WRONG_USAGE +SELECT * FROM (SELECT * FROM t1) d PROCEDURE ANALYSE(); +DROP TABLE t1; + +--echo End of 4.1 tests + +--echo # +--echo # Bug #48293: crash with procedure analyse, view with > 10 columns, +--echo # having clause... +--echo # + +CREATE TABLE t1(a INT, b INT, c INT, d INT, e INT, + f INT, g INT, h INT, i INT, j INT,k INT); +INSERT INTO t1 VALUES (),(); + +CREATE ALGORITHM=TEMPTABLE VIEW v1 AS SELECT * FROM t1; +--echo #should have a derived table +EXPLAIN SELECT * FROM v1; +--echo #should not crash +--error ER_WRONG_USAGE +SELECT * FROM v1 PROCEDURE analyse(); +--echo #should not crash +--error ER_WRONG_USAGE +SELECT * FROM t1 a, v1, t1 b PROCEDURE analyse(); +--echo #should not crash +--error ER_WRONG_USAGE +SELECT * FROM (SELECT * FROM t1 having a > 1) x PROCEDURE analyse(); +--echo #should not crash +--error ER_WRONG_USAGE +SELECT * FROM t1 a, (SELECT * FROM t1 having a > 1) x, t1 b PROCEDURE analyse(); +--echo #should not crash +--error ER_ORDER_WITH_PROC +SELECT 1 FROM t1 group by a having a > 1 order by 1 PROCEDURE analyse(); + +DROP VIEW v1; +DROP TABLE t1; + +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES (1),(2); + +--echo # should not crash +--error ER_WRONG_USAGE +CREATE TABLE t2 SELECT 1 FROM t1, t1 t3 GROUP BY t3.a PROCEDURE ANALYSE(); + +DROP TABLE t1; + --echo End of 5.0 tests -- cgit v1.2.1