From 5c78f82915e916d9da0839604a7b608a5846f531 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 28 Feb 2008 14:36:14 +0300 Subject: [PATCH 1/4] WL#4091, replace sleeps mysql-test/suite/rpl/r/rpl_flushlog_loop.result: updated result mysql-test/suite/rpl/r/rpl_row_view01.result: updated result mysql-test/suite/rpl/t/rpl_change_master.test: replace sleep mysql-test/suite/rpl/t/rpl_drop_temp.test: replace sleep mysql-test/suite/rpl/t/rpl_flushlog_loop.test: replace sleep mysql-test/suite/rpl/t/rpl_relayspace.test: replace waiting of state to wait_for_slave_param.inc mysql-test/suite/rpl/t/rpl_row_view01.test: replace sleep mysql-test/suite/rpl/t/rpl_trunc_temp.test: replace sleep mysql-test/include/wait_for_binlog_event.inc: New primitive: waiting an event in binlog on master --- mysql-test/include/wait_for_binlog_event.inc | 33 +++++++++++++++++++ .../suite/rpl/r/rpl_flushlog_loop.result | 6 ++-- mysql-test/suite/rpl/r/rpl_row_view01.result | 3 ++ mysql-test/suite/rpl/t/rpl_change_master.test | 4 ++- mysql-test/suite/rpl/t/rpl_drop_temp.test | 14 +++++--- mysql-test/suite/rpl/t/rpl_flushlog_loop.test | 25 ++++++++++++-- mysql-test/suite/rpl/t/rpl_relayspace.test | 21 +++--------- mysql-test/suite/rpl/t/rpl_row_view01.test | 16 ++++++--- mysql-test/suite/rpl/t/rpl_trunc_temp.test | 7 +++- 9 files changed, 96 insertions(+), 33 deletions(-) create mode 100644 mysql-test/include/wait_for_binlog_event.inc diff --git a/mysql-test/include/wait_for_binlog_event.inc b/mysql-test/include/wait_for_binlog_event.inc new file mode 100644 index 00000000000..2a57c191413 --- /dev/null +++ b/mysql-test/include/wait_for_binlog_event.inc @@ -0,0 +1,33 @@ +# include/wait_for_binlog_event.inc +# +# SUMMARY +# +# Waits until SHOW BINLOG EVENTS has returned in last event a specified substring. +# +# USAGE +# +# let $wait_binlog_event= DROP; +# --source include/wait_for_binlog_event.inc + +let $_loop_count= 300; +let $_last_event= ; +let $_event_pos= 1; + +while (`SELECT INSTR("$_last_event","$wait_binlog_event") = 0`) +{ + dec $_loop_count; + if (!$_loop_count) + { + SHOW BINLOG EVENTS; + --die ERROR: failed while waiting for $wait_binlog_event in binlog + } + real_sleep 0.1; + let $_event= query_get_value(SHOW BINLOG EVENTS, Info, $_event_pos); + let $_last_event= $_event; + while (`SELECT "$_event" != "No such row"`) + { + inc $_event_pos; + let $_last_event= $_event; + let $_event= query_get_value(SHOW BINLOG EVENTS, Info, $_event_pos); + } +} diff --git a/mysql-test/suite/rpl/r/rpl_flushlog_loop.result b/mysql-test/suite/rpl/r/rpl_flushlog_loop.result index ca06a5a328c..baa740bf250 100644 --- a/mysql-test/suite/rpl/r/rpl_flushlog_loop.result +++ b/mysql-test/suite/rpl/r/rpl_flushlog_loop.result @@ -23,7 +23,7 @@ start slave; let $result_pattern= '%127.0.0.1%root%slave-bin.000001%slave-bin.000001%Yes%Yes%0%0%None%' ; --source include/wait_slave_status.inc -flush logs; +FLUSH LOGS; SHOW SLAVE STATUS; Slave_IO_State # Master_Host 127.0.0.1 @@ -31,7 +31,7 @@ Master_User root Master_Port SLAVE_PORT Connect_Retry 60 Master_Log_File slave-bin.000001 -Read_Master_Log_Pos 216 +Read_Master_Log_Pos POSITION Relay_Log_File # Relay_Log_Pos # Relay_Master_Log_File slave-bin.000001 @@ -46,7 +46,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 216 +Exec_Master_Log_Pos POSITION Relay_Log_Space # Until_Condition None Until_Log_File diff --git a/mysql-test/suite/rpl/r/rpl_row_view01.result b/mysql-test/suite/rpl/r/rpl_row_view01.result index a4b8d0a05e3..4dfe5826f32 100644 --- a/mysql-test/suite/rpl/r/rpl_row_view01.result +++ b/mysql-test/suite/rpl/r/rpl_row_view01.result @@ -13,6 +13,7 @@ DROP TABLE IF EXISTS mysqltest1.t3; DROP TABLE IF EXISTS mysqltest1.t1; DROP TABLE IF EXISTS mysqltest1.t2; DROP TABLE IF EXISTS mysqltest1.t4; +DROP TABLE IF EXISTS mysqltest1.t10; CREATE TABLE mysqltest1.t1 (a INT, c CHAR(6),PRIMARY KEY(a)); CREATE TABLE mysqltest1.t2 (a INT, c CHAR(6),PRIMARY KEY(a)); CREATE TABLE mysqltest1.t3 (a INT, c CHAR(6), c2 CHAR(6), PRIMARY KEY(a)); @@ -35,6 +36,7 @@ a c c2 1 Thank GOD 2 it is 3 Friday TGIF +CREATE TABLE mysqltest1.t10 (a INT, PRIMARY KEY(a)); SELECT * FROM mysqltest1.v2; qty price value 3 50 150 @@ -98,4 +100,5 @@ DROP TABLE IF EXISTS mysqltest1.t3; DROP TABLE IF EXISTS mysqltest1.t1; DROP TABLE IF EXISTS mysqltest1.t2; DROP TABLE IF EXISTS mysqltest1.t4; +DROP TABLE IF EXISTS mysqltest1.t10; DROP DATABASE mysqltest1; diff --git a/mysql-test/suite/rpl/t/rpl_change_master.test b/mysql-test/suite/rpl/t/rpl_change_master.test index 7e4800c5c77..d0cd40e2e11 100644 --- a/mysql-test/suite/rpl/t/rpl_change_master.test +++ b/mysql-test/suite/rpl/t/rpl_change_master.test @@ -15,8 +15,10 @@ connection master; insert into t1 values(1); insert into t1 values(2); save_master_pos; +let $slave_param= Read_Master_Log_Pos; +let $slave_param_value= query_get_value(SHOW MASTER STATUS, Position, 1); connection slave; ---real_sleep 3 # wait for I/O thread to have read updates +source include/wait_for_slave_param.inc; stop slave; source include/show_slave_status2.inc; change master to master_user='root'; diff --git a/mysql-test/suite/rpl/t/rpl_drop_temp.test b/mysql-test/suite/rpl/t/rpl_drop_temp.test index 305c78d3f06..51c5472beb8 100644 --- a/mysql-test/suite/rpl/t/rpl_drop_temp.test +++ b/mysql-test/suite/rpl/t/rpl_drop_temp.test @@ -6,19 +6,25 @@ # to work around NDB's issue with temp tables ############################################## source include/master-slave.inc; +source include/have_binlog_format_mixed_or_statement.inc; + --disable_warnings create database if not exists mysqltest; --enable_warnings create temporary table mysqltest.t1 (n int)ENGINE=MyISAM; create temporary table mysqltest.t2 (n int)ENGINE=MyISAM; -sync_slave_with_master; + connection master; disconnect master; -connection slave; ---real_sleep 3 # time for DROP to be written -show status like 'Slave_open_temp_tables'; +connection master1; +# Wait until drop of temp tables appears in binlog +let $wait_binlog_event= DROP; +source include/wait_for_binlog_event.inc; + +connection slave; +show status like 'Slave_open_temp_tables'; # Cleanup connection default; drop database mysqltest; diff --git a/mysql-test/suite/rpl/t/rpl_flushlog_loop.test b/mysql-test/suite/rpl/t/rpl_flushlog_loop.test index 750b49f19a9..ab1be9d297b 100644 --- a/mysql-test/suite/rpl/t/rpl_flushlog_loop.test +++ b/mysql-test/suite/rpl/t/rpl_flushlog_loop.test @@ -35,12 +35,31 @@ let $result_pattern= '%127.0.0.1%root%slave-bin.000001%slave-bin.000001%Yes%Yes% # # Flush logs of slave # -flush logs; -sleep 5; +# Create full loop by following way: +# 1. Insert into t1 on master (1st). +# 2. Insert into t1 on slave (2nd) when the event (1st) for t1 replicated. +# 3. Master waits until the event (2nd) for t1 will be replicated. + +--disable_query_log +CREATE TABLE t1 (a INT KEY) ENGINE= MyISAM; +INSERT INTO t1 VALUE(1); +--enable_query_log +FLUSH LOGS; +connection slave; +let $wait_condition= SELECT COUNT(*) = 1 FROM t1; +-- source include/wait_condition.inc +--disable_query_log +INSERT INTO t1 VALUE(2); +--enable_query_log +connection master; +let $wait_condition= SELECT COUNT(*) = 2 FROM t1; +-- source include/wait_condition.inc +--enable_query_log # # Show status of slave # ---replace_result $SLAVE_MYPORT SLAVE_PORT +let $pos= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1); +--replace_result $SLAVE_MYPORT SLAVE_PORT $pos POSITION --replace_column 1 # 8 # 9 # 16 # 23 # 33 # 34 # 35 # --query_vertical SHOW SLAVE STATUS diff --git a/mysql-test/suite/rpl/t/rpl_relayspace.test b/mysql-test/suite/rpl/t/rpl_relayspace.test index d4ef2fe59bd..0fc564cdb46 100644 --- a/mysql-test/suite/rpl/t/rpl_relayspace.test +++ b/mysql-test/suite/rpl/t/rpl_relayspace.test @@ -14,23 +14,10 @@ connection slave; reset slave; start slave io_thread; # Give the I/O thread time to block. -let $run= 1; -let $counter= 300; -while ($run) -{ - let $io_state= query_get_value("SHOW SLAVE STATUS", Slave_IO_State, 1); - if (`SELECT '$io_state' = 'Waiting for the slave SQL thread to free enough relay log space'`){ - let $run= 0; - } - sleep 0.1; - if (!$counter){ - --echo "Failed while waiting for slave IO thread block" - SHOW SLAVE STATUS; - exit; - } - dec $counter; -} -sleep 2; +let $slave_param= Slave_IO_State; +let $slave_param_value= Waiting for the slave SQL thread to free enough relay log space; +source include/wait_for_slave_param.inc; + # A bug caused the I/O thread to refuse stopping. stop slave io_thread; reset slave; diff --git a/mysql-test/suite/rpl/t/rpl_row_view01.test b/mysql-test/suite/rpl/t/rpl_row_view01.test index 634e3c30cc6..77e4b98f780 100644 --- a/mysql-test/suite/rpl/t/rpl_row_view01.test +++ b/mysql-test/suite/rpl/t/rpl_row_view01.test @@ -23,6 +23,7 @@ DROP TABLE IF EXISTS mysqltest1.t3; DROP TABLE IF EXISTS mysqltest1.t1; DROP TABLE IF EXISTS mysqltest1.t2; DROP TABLE IF EXISTS mysqltest1.t4; +DROP TABLE IF EXISTS mysqltest1.t10; # Begin test section 1 CREATE TABLE mysqltest1.t1 (a INT, c CHAR(6),PRIMARY KEY(a)); @@ -43,12 +44,18 @@ CREATE VIEW mysqltest1.v4 AS SELECT * FROM mysqltest1.v3 WHERE a > 1 WITH LOCAL SELECT * FROM mysqltest1.v2; SELECT * FROM mysqltest1.v1; -# Had to add a sleep for use with NDB + + +# Had to add a waiting for use with NDB # engine. Injector thread would have not -# populated biblog and data would not be on +# populated binlog and data would not be on # the slave. -sleep 10; -sync_slave_with_master; + +CREATE TABLE mysqltest1.t10 (a INT, PRIMARY KEY(a)); +let $wait_binlog_event= CREATE TABLE mysqltest1.t10; +-- source include/wait_for_binlog_event.inc +--sync_slave_with_master + SELECT * FROM mysqltest1.v2; SELECT * FROM mysqltest1.v1; connection master; @@ -82,6 +89,7 @@ DROP TABLE IF EXISTS mysqltest1.t3; DROP TABLE IF EXISTS mysqltest1.t1; DROP TABLE IF EXISTS mysqltest1.t2; DROP TABLE IF EXISTS mysqltest1.t4; +DROP TABLE IF EXISTS mysqltest1.t10; DROP DATABASE mysqltest1; sync_slave_with_master; diff --git a/mysql-test/suite/rpl/t/rpl_trunc_temp.test b/mysql-test/suite/rpl/t/rpl_trunc_temp.test index 28bcb0c06c3..93308e3eb3f 100644 --- a/mysql-test/suite/rpl/t/rpl_trunc_temp.test +++ b/mysql-test/suite/rpl/t/rpl_trunc_temp.test @@ -27,7 +27,12 @@ show status like 'Slave_open_temp_tables'; # Disconnect the master, temp table on slave should dissapear disconnect master; ---real_sleep 3 # time for DROP to be read by slave + +connection master1; +# Wait until drop of temp tables appers in binlog +let $wait_binlog_event= DROP; +source include/wait_for_binlog_event.inc; + connection slave; show status like 'Slave_open_temp_tables'; From caf604282f25dbdf8a351b30bfdafe525b3374ba Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 29 Feb 2008 00:50:15 +0300 Subject: [PATCH 2/4] Bug#32663, Bug#33045, Bug#23533, WL#4091 mysql-test/suite/binlog/r/binlog_multi_engine.result: updated result mysql-test/suite/binlog/t/binlog_multi_engine.test: fix for bug#32663 mysql-test/suite/binlog/t/disabled.def: updated mysql-test/suite/rpl/r/rpl_invoked_features.result: updated result mysql-test/suite/rpl/t/disabled.def: updated mysql-test/suite/rpl/t/rpl_invoked_features.test: fix for bug#33045 mysql-test/suite/bugs/r/rpl_bug23533.result: result file mysql-test/suite/bugs/t/rpl_bug23533.test: test case for bug#23533 --- .../suite/binlog/r/binlog_multi_engine.result | 22 ++++------ .../suite/binlog/t/binlog_multi_engine.test | 22 +++++++++- mysql-test/suite/binlog/t/disabled.def | 1 - mysql-test/suite/bugs/r/rpl_bug23533.result | 23 ++++++++++ mysql-test/suite/bugs/t/rpl_bug23533.test | 43 +++++++++++++++++++ .../suite/rpl/r/rpl_invoked_features.result | 16 +++---- mysql-test/suite/rpl/t/disabled.def | 1 + .../suite/rpl/t/rpl_invoked_features.test | 26 +++++++---- 8 files changed, 122 insertions(+), 32 deletions(-) create mode 100644 mysql-test/suite/bugs/r/rpl_bug23533.result create mode 100644 mysql-test/suite/bugs/t/rpl_bug23533.test diff --git a/mysql-test/suite/binlog/r/binlog_multi_engine.result b/mysql-test/suite/binlog/r/binlog_multi_engine.result index 13227c5ecb1..8574a2351a1 100644 --- a/mysql-test/suite/binlog/r/binlog_multi_engine.result +++ b/mysql-test/suite/binlog/r/binlog_multi_engine.result @@ -3,8 +3,8 @@ CREATE TABLE t1b (b INT, c INT) ENGINE=BLACKHOLE; CREATE TABLE t1n (e INT, f INT) ENGINE=NDB; RESET MASTER; SET SESSION BINLOG_FORMAT=STATEMENT; -INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2); 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; *** Please look in binlog_multi_engine.test if you have a diff here **** START TRANSACTION; @@ -17,30 +17,28 @@ TRUNCATE t1b; TRUNCATE t1n; show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2) master-bin.000001 # Query # # use `test`; BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2) master-bin.000001 # Query # # use `test`; COMMIT -master-bin.000001 # Query # # use `test`; BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2) master-bin.000001 # Query # # use `test`; UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c -master-bin.000001 # Query # # use `test`; COMMIT master-bin.000001 # Query # # use `test`; BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2) master-bin.000001 # Query # # use `test`; UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f master-bin.000001 # Query # # use `test`; UPDATE t1n, t1b SET e = 2, b = 3 WHERE f = c master-bin.000001 # Query # # use `test`; COMMIT -master-bin.000001 # Query # # use `test`; TRUNCATE t1m -master-bin.000001 # Query # # use `test`; TRUNCATE t1b master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1n) master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # use `test`; TRUNCATE t1m +master-bin.000001 # Query # # use `test`; TRUNCATE t1b master-bin.000001 # Query # # use `test`; TRUNCATE t1n RESET MASTER; SET SESSION BINLOG_FORMAT=MIXED; -INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2); INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2); +INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2); INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2); UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c; UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f; @@ -52,21 +50,19 @@ TRUNCATE t1b; TRUNCATE t1n; show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2) master-bin.000001 # Query # # use `test`; BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2) master-bin.000001 # Query # # use `test`; COMMIT -master-bin.000001 # Query # # use `test`; BEGIN -master-bin.000001 # Query # # use `test`; UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c -master-bin.000001 # Query # # use `test`; COMMIT -master-bin.000001 # Query # # use `test`; TRUNCATE t1m -master-bin.000001 # Query # # use `test`; TRUNCATE t1b +master-bin.000001 # Query # # use `test`; INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2) master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1n) master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) master-bin.000001 # Write_rows # # table_id: # master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # use `test`; UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c +master-bin.000001 # Query # # use `test`; TRUNCATE t1m +master-bin.000001 # Query # # use `test`; TRUNCATE t1b master-bin.000001 # Query # # use `test`; TRUNCATE t1n RESET MASTER; SET SESSION BINLOG_FORMAT=ROW; diff --git a/mysql-test/suite/binlog/t/binlog_multi_engine.test b/mysql-test/suite/binlog/t/binlog_multi_engine.test index 058aca0f715..bf84eed6ec1 100644 --- a/mysql-test/suite/binlog/t/binlog_multi_engine.test +++ b/mysql-test/suite/binlog/t/binlog_multi_engine.test @@ -15,11 +15,16 @@ RESET MASTER; SET SESSION BINLOG_FORMAT=STATEMENT; -INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2); 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; +# Here and below we need to wait when some event appears in binlog +# to avoid unsrted mixing local events and from NDB +let $wait_binlog_event= t1m, t1b; +source include/wait_for_binlog_event.inc; + echo *** Please look in binlog_multi_engine.test if you have a diff here ****; START TRANSACTION; INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2); @@ -27,20 +32,33 @@ UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f; UPDATE t1n, t1b SET e = 2, b = 3 WHERE f = c; COMMIT; +let $wait_binlog_event= COMMIT; +source include/wait_for_binlog_event.inc; + TRUNCATE t1m; TRUNCATE t1b; TRUNCATE t1n; +let $wait_binlog_event= t1n; +source include/wait_for_binlog_event.inc; + source include/show_binlog_events.inc; RESET MASTER; SET SESSION BINLOG_FORMAT=MIXED; -INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2); INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2); +INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2); + +let $wait_binlog_event= t1m; +source include/wait_for_binlog_event.inc; + INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2); +let $wait_binlog_event= COMMIT; +source include/wait_for_binlog_event.inc; + UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c; error ER_BINLOG_LOGGING_IMPOSSIBLE; UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f; diff --git a/mysql-test/suite/binlog/t/disabled.def b/mysql-test/suite/binlog/t/disabled.def index a6e73fa31d8..888298bbb09 100644 --- a/mysql-test/suite/binlog/t/disabled.def +++ b/mysql-test/suite/binlog/t/disabled.def @@ -9,4 +9,3 @@ # Do not use any TAB characters for whitespace. # ############################################################################## -binlog_multi_engine : Bug#32663 binlog_multi_engine.test fails randomly diff --git a/mysql-test/suite/bugs/r/rpl_bug23533.result b/mysql-test/suite/bugs/r/rpl_bug23533.result new file mode 100644 index 00000000000..1dda75a69b0 --- /dev/null +++ b/mysql-test/suite/bugs/r/rpl_bug23533.result @@ -0,0 +1,23 @@ +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; +DROP TABLE IF EXISTS t1,t2; +SET AUTOCOMMIT=0; +SET GLOBAL max_binlog_cache_size=4096; +SHOW VARIABLES LIKE 'max_binlog_cache_size'; +Variable_name Value +max_binlog_cache_size 4096 +CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT, b TEXT, PRIMARY KEY(a)) ENGINE=InnoDB; +SELECT COUNT(*) FROM t1; +COUNT(*) +1000 +START TRANSACTION; +CREATE TABLE t2 SELECT * FROM t1; +ERROR HY000: Writing one row to the row-based binary log failed +COMMIT; +SHOW TABLES LIKE 't%'; +Tables_in_test (t%) +t1 diff --git a/mysql-test/suite/bugs/t/rpl_bug23533.test b/mysql-test/suite/bugs/t/rpl_bug23533.test new file mode 100644 index 00000000000..397f1102f0e --- /dev/null +++ b/mysql-test/suite/bugs/t/rpl_bug23533.test @@ -0,0 +1,43 @@ +############################################################# +# Author: Serge Kozlov +# Date: 02/26/2008 +# Purpose: testing bug report +# Bug#23533: CREATE SELECT max_binlog_cache_size test +# case needed +############################################################# + +--source include/have_innodb.inc +--source include/have_binlog_format_row.inc +--source include/master-slave.inc + + +--disable_warnings +DROP TABLE IF EXISTS t1,t2; +--enable_warnings + +SET AUTOCOMMIT=0; +SET GLOBAL max_binlog_cache_size=4096; +SHOW VARIABLES LIKE 'max_binlog_cache_size'; + +CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT, b TEXT, PRIMARY KEY(a)) ENGINE=InnoDB; + +--disable_query_log +let $i= 1000; +while ($i) +{ + eval INSERT INTO t1 VALUES($i, REPEAT('x', 4096)); + dec $i; +} +--enable_query_log + +SELECT COUNT(*) FROM t1; + +# Copied data from t1 into t2 large than max_binlog_cache_size +START TRANSACTION; +--error 1534 +CREATE TABLE t2 SELECT * FROM t1; +COMMIT; +SHOW TABLES LIKE 't%'; + + +# 5.1 End of Test diff --git a/mysql-test/suite/rpl/r/rpl_invoked_features.result b/mysql-test/suite/rpl/r/rpl_invoked_features.result index aed1dcdbb47..be9169c785b 100644 --- a/mysql-test/suite/rpl/r/rpl_invoked_features.result +++ b/mysql-test/suite/rpl/r/rpl_invoked_features.result @@ -116,23 +116,23 @@ t12 t13 t2 t3 -SELECT table_name FROM information_schema.views WHERE table_schema='test' ORDER BY table_name; +SELECT table_name FROM information_schema.views WHERE table_schema='test'; table_name v1 v11 -SELECT trigger_name, event_manipulation, event_object_table FROM information_schema.triggers WHERE trigger_schema='test' ORDER BY trigger_name; +SELECT trigger_name, event_manipulation, event_object_table FROM information_schema.triggers WHERE trigger_schema='test'; trigger_name event_manipulation event_object_table t11_tr1 INSERT t11 t11_tr2 UPDATE t11 t1_tr1 INSERT t1 t1_tr2 UPDATE t1 -SELECT routine_type, routine_name FROM information_schema.routines WHERE routine_schema='test' ORDER BY routine_name; +SELECT routine_type, routine_name FROM information_schema.routines WHERE routine_schema='test'; routine_type routine_name FUNCTION f1 FUNCTION f2 PROCEDURE p1 PROCEDURE p11 -SELECT event_name, status FROM information_schema.events WHERE event_schema='test' ORDER BY event_name; +SELECT event_name, status FROM information_schema.events WHERE event_schema='test'; event_name status e1 DISABLED e11 DISABLED @@ -276,23 +276,23 @@ t12 t13 t2 t3 -SELECT table_name FROM information_schema.views WHERE table_schema='test' ORDER BY table_name; +SELECT table_name FROM information_schema.views WHERE table_schema='test'; table_name v1 v11 -SELECT trigger_name, event_manipulation, event_object_table FROM information_schema.triggers WHERE trigger_schema='test' ORDER BY trigger_name; +SELECT trigger_name, event_manipulation, event_object_table FROM information_schema.triggers WHERE trigger_schema='test'; trigger_name event_manipulation event_object_table t11_tr1 INSERT t11 t11_tr2 UPDATE t11 t1_tr1 INSERT t1 t1_tr2 UPDATE t1 -SELECT routine_type, routine_name FROM information_schema.routines WHERE routine_schema='test' ORDER BY routine_name; +SELECT routine_type, routine_name FROM information_schema.routines WHERE routine_schema='test'; routine_type routine_name FUNCTION f1 FUNCTION f2 PROCEDURE p1 PROCEDURE p11 -SELECT event_name, status FROM information_schema.events WHERE event_schema='test' ORDER BY event_name; +SELECT event_name, status FROM information_schema.events WHERE event_schema='test'; event_name status e1 SLAVESIDE_DISABLED e11 SLAVESIDE_DISABLED diff --git a/mysql-test/suite/rpl/t/disabled.def b/mysql-test/suite/rpl/t/disabled.def index 20c3ccf0486..53868e070e4 100644 --- a/mysql-test/suite/rpl/t/disabled.def +++ b/mysql-test/suite/rpl/t/disabled.def @@ -11,6 +11,7 @@ ############################################################################## rpl_ddl : BUG#26418 2007-03-01 mleich Slave out of sync after CREATE/DROP TEMPORARY TABLE + ROLLBACK on master +rpl_flushlog_loop : WL#4091 skozlov: temporary disabled because of failures on some platforms rpl_stm_extraColmaster_ndb : WL#3915 : Statement-based replication not supported in ndb. Enable test when supported. rpl_innodb_bug28430 : Bug #32247 2007-11-27 mats Test reports wrong value of "AUTO_INCREMENT" (on a partitioned InnoDB table) rpl_view : Bug#32654: rpl_view.test fails randomly diff --git a/mysql-test/suite/rpl/t/rpl_invoked_features.test b/mysql-test/suite/rpl/t/rpl_invoked_features.test index 17cdc1e61cf..e73964a6e14 100644 --- a/mysql-test/suite/rpl/t/rpl_invoked_features.test +++ b/mysql-test/suite/rpl/t/rpl_invoked_features.test @@ -201,11 +201,16 @@ SET GLOBAL EVENT_SCHEDULER = off; # Check original objects --echo +--sorted_result SHOW TABLES LIKE 't%'; -SELECT table_name FROM information_schema.views WHERE table_schema='test' ORDER BY table_name; -SELECT trigger_name, event_manipulation, event_object_table FROM information_schema.triggers WHERE trigger_schema='test' ORDER BY trigger_name; -SELECT routine_type, routine_name FROM information_schema.routines WHERE routine_schema='test' ORDER BY routine_name; -SELECT event_name, status FROM information_schema.events WHERE event_schema='test' ORDER BY event_name; +--sorted_result +SELECT table_name FROM information_schema.views WHERE table_schema='test'; +--sorted_result +SELECT trigger_name, event_manipulation, event_object_table FROM information_schema.triggers WHERE trigger_schema='test'; +--sorted_result +SELECT routine_type, routine_name FROM information_schema.routines WHERE routine_schema='test'; +--sorted_result +SELECT event_name, status FROM information_schema.events WHERE event_schema='test'; # Check original data --echo @@ -228,11 +233,16 @@ SELECT a,b FROM v11 ORDER BY a; # Check replicated objects --echo +--sorted_result SHOW TABLES LIKE 't%'; -SELECT table_name FROM information_schema.views WHERE table_schema='test' ORDER BY table_name; -SELECT trigger_name, event_manipulation, event_object_table FROM information_schema.triggers WHERE trigger_schema='test' ORDER BY trigger_name; -SELECT routine_type, routine_name FROM information_schema.routines WHERE routine_schema='test' ORDER BY routine_name; -SELECT event_name, status FROM information_schema.events WHERE event_schema='test' ORDER BY event_name; +--sorted_result +SELECT table_name FROM information_schema.views WHERE table_schema='test'; +--sorted_result +SELECT trigger_name, event_manipulation, event_object_table FROM information_schema.triggers WHERE trigger_schema='test'; +--sorted_result +SELECT routine_type, routine_name FROM information_schema.routines WHERE routine_schema='test'; +--sorted_result +SELECT event_name, status FROM information_schema.events WHERE event_schema='test'; # Check replicated data --echo From ee10d69714fb26c51da2092a3a9fbe2aac9e4f28 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 1 Mar 2008 00:05:23 +0300 Subject: [PATCH 3/4] WL#4091, enable rpl_flushlog_loop.test and fix for rpl_drop_temp.test mysql-test/suite/rpl/t/disabled.def: enable test mysql-test/suite/rpl/t/rpl_drop_temp.test: added sync slave with master mysql-test/suite/rpl/t/rpl_flushlog_loop.test: added sync slave with master --- mysql-test/suite/rpl/t/disabled.def | 1 - mysql-test/suite/rpl/t/rpl_drop_temp.test | 2 +- mysql-test/suite/rpl/t/rpl_flushlog_loop.test | 2 ++ 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mysql-test/suite/rpl/t/disabled.def b/mysql-test/suite/rpl/t/disabled.def index 53868e070e4..20c3ccf0486 100644 --- a/mysql-test/suite/rpl/t/disabled.def +++ b/mysql-test/suite/rpl/t/disabled.def @@ -11,7 +11,6 @@ ############################################################################## rpl_ddl : BUG#26418 2007-03-01 mleich Slave out of sync after CREATE/DROP TEMPORARY TABLE + ROLLBACK on master -rpl_flushlog_loop : WL#4091 skozlov: temporary disabled because of failures on some platforms rpl_stm_extraColmaster_ndb : WL#3915 : Statement-based replication not supported in ndb. Enable test when supported. rpl_innodb_bug28430 : Bug #32247 2007-11-27 mats Test reports wrong value of "AUTO_INCREMENT" (on a partitioned InnoDB table) rpl_view : Bug#32654: rpl_view.test fails randomly diff --git a/mysql-test/suite/rpl/t/rpl_drop_temp.test b/mysql-test/suite/rpl/t/rpl_drop_temp.test index 51c5472beb8..f06b0951469 100644 --- a/mysql-test/suite/rpl/t/rpl_drop_temp.test +++ b/mysql-test/suite/rpl/t/rpl_drop_temp.test @@ -23,7 +23,7 @@ connection master1; let $wait_binlog_event= DROP; source include/wait_for_binlog_event.inc; -connection slave; +sync_slave_with_master; show status like 'Slave_open_temp_tables'; # Cleanup connection default; diff --git a/mysql-test/suite/rpl/t/rpl_flushlog_loop.test b/mysql-test/suite/rpl/t/rpl_flushlog_loop.test index ab1be9d297b..079048bd24d 100644 --- a/mysql-test/suite/rpl/t/rpl_flushlog_loop.test +++ b/mysql-test/suite/rpl/t/rpl_flushlog_loop.test @@ -42,6 +42,8 @@ let $result_pattern= '%127.0.0.1%root%slave-bin.000001%slave-bin.000001%Yes%Yes% --disable_query_log CREATE TABLE t1 (a INT KEY) ENGINE= MyISAM; +sync_slave_with_master; +connection master; INSERT INTO t1 VALUE(1); --enable_query_log FLUSH LOGS; From 6c0d316d16c4afd62916eda22380c231c9fdceaa Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 2 Mar 2008 20:17:39 +0300 Subject: [PATCH 4/4] WL#4091, fix for rpl_flushlog_loop for windows platforms mysql-test/suite/rpl/t/rpl_flushlog_loop.test: added waiting for CREATE TABLE --- mysql-test/suite/rpl/t/rpl_flushlog_loop.test | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mysql-test/suite/rpl/t/rpl_flushlog_loop.test b/mysql-test/suite/rpl/t/rpl_flushlog_loop.test index 079048bd24d..f9f01855aa9 100644 --- a/mysql-test/suite/rpl/t/rpl_flushlog_loop.test +++ b/mysql-test/suite/rpl/t/rpl_flushlog_loop.test @@ -42,6 +42,8 @@ let $result_pattern= '%127.0.0.1%root%slave-bin.000001%slave-bin.000001%Yes%Yes% --disable_query_log CREATE TABLE t1 (a INT KEY) ENGINE= MyISAM; +let $wait_binlog_event= CREATE TABLE t1; +--source include/wait_for_binlog_event.inc sync_slave_with_master; connection master; INSERT INTO t1 VALUE(1);