diff --git a/mysql-test/extra/binlog_tests/binlog.test b/mysql-test/extra/binlog_tests/binlog.test index 993b3fbf634..af7320a49f6 100644 --- a/mysql-test/extra/binlog_tests/binlog.test +++ b/mysql-test/extra/binlog_tests/binlog.test @@ -60,24 +60,4 @@ insert into t1 values(null); select * from t1; drop table t1; -# Test of binlogging of INSERT_ID with INSERT DELAYED -create table t1 (a int not null auto_increment, primary key (a)) engine=myisam; -# First, avoid BUG#20627: -set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1; -# Verify that only one INSERT_ID event is binlogged. -insert delayed into t1 values (207); - -# We use sleeps between statements, that's the only way to get a -# repeatable binlog in a normal test run and under Valgrind. -# It may be that the "binlog missing rows" of BUG#20821 shows up -# here. -sleep 2; -insert delayed into t1 values (null); -sleep 2; -insert delayed into t1 values (300); -sleep 2; # time for the delayed queries to reach disk -select * from t1; ---replace_column 2 # 5 # ---replace_regex /table_id: [0-9]+/table_id: #/ -show binlog events from 102; -drop table t1; +-- source extra/binlog_tests/binlog_insert_delayed.test diff --git a/mysql-test/extra/binlog_tests/binlog_insert_delayed.test b/mysql-test/extra/binlog_tests/binlog_insert_delayed.test new file mode 100644 index 00000000000..596bb1d5772 --- /dev/null +++ b/mysql-test/extra/binlog_tests/binlog_insert_delayed.test @@ -0,0 +1,22 @@ +# Test of binlogging of INSERT_ID with INSERT DELAYED +create table t1 (a int not null auto_increment, primary key (a)) engine=myisam; +# First, avoid BUG#20627: +set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1; +# Verify that only one INSERT_ID event is binlogged. +# Note, that because of WL#3368 mixed mode binlog records RBR events for the delayed +insert delayed into t1 values (207); + +# We use sleeps between statements, that's the only way to get a +# repeatable binlog in a normal test run and under Valgrind. +# It may be that the "binlog missing rows" of BUG#20821 shows up +# here. +sleep 2; +insert delayed into t1 values (null); +sleep 2; +insert delayed into t1 values (300); +sleep 2; # time for the delayed queries to reach disk +select * from t1; +--replace_column 2 # 5 # +--replace_regex /table_id: [0-9]+/table_id: #/ +show binlog events from 102; +drop table t1; diff --git a/mysql-test/extra/rpl_tests/rpl_loaddata.test b/mysql-test/extra/rpl_tests/rpl_loaddata.test index 08e89c20973..e58908ec7e9 100644 --- a/mysql-test/extra/rpl_tests/rpl_loaddata.test +++ b/mysql-test/extra/rpl_tests/rpl_loaddata.test @@ -1,5 +1,5 @@ # Requires statement logging --- source include/have_binlog_format_statement.inc +-- source include/have_binlog_format_mixed_or_statement.inc # See if replication of a "LOAD DATA in an autoincrement column" # Honours autoincrement values diff --git a/mysql-test/extra/rpl_tests/rpl_stm_000001.test b/mysql-test/extra/rpl_tests/rpl_stm_000001.test index 443ed27053a..8673ae31305 100644 --- a/mysql-test/extra/rpl_tests/rpl_stm_000001.test +++ b/mysql-test/extra/rpl_tests/rpl_stm_000001.test @@ -1,4 +1,4 @@ --- source include/have_binlog_format_statement.inc +-- source include/have_binlog_format_mixed_or_statement.inc -- source include/master-slave.inc create table t1 (word char(20) not null); diff --git a/mysql-test/extra/rpl_tests/rpl_stm_charset.test b/mysql-test/extra/rpl_tests/rpl_stm_charset.test index d29a82cfd31..10b4310127f 100644 --- a/mysql-test/extra/rpl_tests/rpl_stm_charset.test +++ b/mysql-test/extra/rpl_tests/rpl_stm_charset.test @@ -2,7 +2,7 @@ # This test will fail if the server/client does not support enough charsets. # Requires statement logging --- source include/have_binlog_format_statement.inc +-- source include/have_binlog_format_mixed_or_statement.inc source include/master-slave.inc; --disable_warnings diff --git a/mysql-test/include/have_binlog_format_mixed.inc b/mysql-test/include/have_binlog_format_mixed.inc new file mode 100644 index 00000000000..fc5ca61c5a0 --- /dev/null +++ b/mysql-test/include/have_binlog_format_mixed.inc @@ -0,0 +1,4 @@ +-- require r/have_binlog_format_mixed.require +disable_query_log; +show variables like "binlog_format"; +enable_query_log; diff --git a/mysql-test/include/have_binlog_format_mixed_or_statement.inc b/mysql-test/include/have_binlog_format_mixed_or_statement.inc new file mode 100644 index 00000000000..8ee6f2cc030 --- /dev/null +++ b/mysql-test/include/have_binlog_format_mixed_or_statement.inc @@ -0,0 +1,5 @@ +--require r/have_binlog_format_statement.require +--disable_query_log +--replace_result MIXED STATEMENT +show variables like "binlog_format"; +--enable_query_log diff --git a/mysql-test/r/binlog_statement_insert_delayed.result b/mysql-test/r/binlog_statement_insert_delayed.result new file mode 100644 index 00000000000..bae01f7dc5d --- /dev/null +++ b/mysql-test/r/binlog_statement_insert_delayed.result @@ -0,0 +1,18 @@ +create table t1 (a int not null auto_increment, primary key (a)) engine=myisam; +set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1; +insert delayed into t1 values (207); +insert delayed into t1 values (null); +insert delayed into t1 values (300); +select * from t1; +a +207 +208 +300 +show binlog events from 102; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query 1 # use `test`; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam +master-bin.000001 # Query 1 # use `test`; insert delayed into t1 values (207) +master-bin.000001 # Intvar 1 # INSERT_ID=208 +master-bin.000001 # Query 1 # use `test`; insert delayed into t1 values (null) +master-bin.000001 # Query 1 # use `test`; insert delayed into t1 values (300) +drop table t1; diff --git a/mysql-test/r/binlog_stm_binlog.result b/mysql-test/r/binlog_stm_binlog.result index 4e23db4828f..b175089f585 100644 --- a/mysql-test/r/binlog_stm_binlog.result +++ b/mysql-test/r/binlog_stm_binlog.result @@ -172,8 +172,10 @@ master-bin.000001 # Intvar 1 # INSERT_ID=127 master-bin.000001 # Query 1 # use `test`; insert into t1 values(null) master-bin.000001 # Query 1 # use `test`; drop table t1 master-bin.000001 # Query 1 # use `test`; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam -master-bin.000001 # Query 1 # use `test`; insert delayed into t1 values (207) -master-bin.000001 # Intvar 1 # INSERT_ID=208 -master-bin.000001 # Query 1 # use `test`; insert delayed into t1 values (null) -master-bin.000001 # Query 1 # use `test`; insert delayed into t1 values (300) +master-bin.000001 # Table_map 1 # table_id: # (test.t1) +master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map 1 # table_id: # (test.t1) +master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map 1 # table_id: # (test.t1) +master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F drop table t1; diff --git a/mysql-test/r/have_binlog_format_mixed.require b/mysql-test/r/have_binlog_format_mixed.require new file mode 100644 index 00000000000..4b752cbb314 --- /dev/null +++ b/mysql-test/r/have_binlog_format_mixed.require @@ -0,0 +1,2 @@ +Variable_name Value +binlog_format MIXED diff --git a/mysql-test/r/rpl_rbr_to_sbr.result b/mysql-test/r/rpl_rbr_to_sbr.result index c5a672ee13b..4b2d129c732 100644 --- a/mysql-test/r/rpl_rbr_to_sbr.result +++ b/mysql-test/r/rpl_rbr_to_sbr.result @@ -5,9 +5,6 @@ reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; SET BINLOG_FORMAT=MIXED; -SELECT @@GLOBAL.BINLOG_FORMAT, @@SESSION.BINLOG_FORMAT; -@@GLOBAL.BINLOG_FORMAT @@SESSION.BINLOG_FORMAT -STATEMENT MIXED SET GLOBAL BINLOG_FORMAT=MIXED; SELECT @@GLOBAL.BINLOG_FORMAT, @@SESSION.BINLOG_FORMAT; @@GLOBAL.BINLOG_FORMAT @@SESSION.BINLOG_FORMAT diff --git a/mysql-test/t/archive.test b/mysql-test/t/archive.test index 294e7730e07..0dccd8f111a 100644 --- a/mysql-test/t/archive.test +++ b/mysql-test/t/archive.test @@ -3,7 +3,7 @@ # Taken FROM the select test # -- source include/have_archive.inc --- source include/have_binlog_format_statement.inc +-- source include/have_binlog_format_mixed_or_statement.inc --disable_warnings drop table if exists t1,t2,t3; diff --git a/mysql-test/t/binlog_statement_insert_delayed.test b/mysql-test/t/binlog_statement_insert_delayed.test new file mode 100644 index 00000000000..3b2c547a901 --- /dev/null +++ b/mysql-test/t/binlog_statement_insert_delayed.test @@ -0,0 +1,6 @@ +# This test is to verify replication with INSERT DELAY through +# unrecommended STATEMENT binlog format + +-- source include/not_embedded.inc +-- source include/have_binlog_format_statement.inc +-- source extra/binlog_tests/binlog_insert_delayed.test diff --git a/mysql-test/t/binlog_stm_binlog.test b/mysql-test/t/binlog_stm_binlog.test index f22e7e45aea..280b7a3aef9 100644 --- a/mysql-test/t/binlog_stm_binlog.test +++ b/mysql-test/t/binlog_stm_binlog.test @@ -13,6 +13,6 @@ drop table t1; # For both statement and row based bin logs 9/19/2005 [jbm] -- source include/not_embedded.inc --- source include/have_binlog_format_statement.inc +-- source include/have_binlog_format_mixed.inc -- source extra/binlog_tests/binlog.test diff --git a/mysql-test/t/binlog_stm_blackhole.test b/mysql-test/t/binlog_stm_blackhole.test index 6047d8ca2fc..02ba2be095b 100644 --- a/mysql-test/t/binlog_stm_blackhole.test +++ b/mysql-test/t/binlog_stm_blackhole.test @@ -2,5 +2,5 @@ # For both statement and row based bin logs 9/19/2005 [jbm] -- source include/not_embedded.inc --- source include/have_binlog_format_statement.inc +-- source include/have_binlog_format_mixed_or_statement.inc -- source extra/binlog_tests/blackhole.test diff --git a/mysql-test/t/binlog_stm_ctype_cp932.test b/mysql-test/t/binlog_stm_ctype_cp932.test index 436f95a2453..c0791d81445 100644 --- a/mysql-test/t/binlog_stm_ctype_cp932.test +++ b/mysql-test/t/binlog_stm_ctype_cp932.test @@ -2,5 +2,5 @@ # For both statement and row based bin logs 9/19/2005 [jbm] -- source include/not_embedded.inc --- source include/have_binlog_format_statement.inc +-- source include/have_binlog_format_mixed_or_statement.inc -- source extra/binlog_tests/ctype_cp932.test diff --git a/mysql-test/t/binlog_stm_ctype_ucs.test b/mysql-test/t/binlog_stm_ctype_ucs.test index a32ac3155c7..c8cd7e06398 100644 --- a/mysql-test/t/binlog_stm_ctype_ucs.test +++ b/mysql-test/t/binlog_stm_ctype_ucs.test @@ -1,6 +1,6 @@ # This is a wrapper for binlog.test so that the same test case can be used # For both statement and row based bin logs 9/19/2005 [jbm] --- source include/have_binlog_format_statement.inc +-- source include/have_binlog_format_mixed_or_statement.inc -- source extra/binlog_tests/ctype_ucs_binlog.test diff --git a/mysql-test/t/binlog_stm_drop_tmp_tbl.test b/mysql-test/t/binlog_stm_drop_tmp_tbl.test index e8acd00c779..6017f272d01 100644 --- a/mysql-test/t/binlog_stm_drop_tmp_tbl.test +++ b/mysql-test/t/binlog_stm_drop_tmp_tbl.test @@ -1,5 +1,5 @@ # This is a wrapper for binlog.test so that the same test case can be used # For both statement and row based bin logs 9/19/2005 [jbm] --- source include/have_binlog_format_statement.inc +-- source include/have_binlog_format_mixed_or_statement.inc -- source extra/binlog_tests/drop_temp_table.test diff --git a/mysql-test/t/binlog_stm_innodb_stat.test b/mysql-test/t/binlog_stm_innodb_stat.test index c6017246e6d..a08039c4a41 100644 --- a/mysql-test/t/binlog_stm_innodb_stat.test +++ b/mysql-test/t/binlog_stm_innodb_stat.test @@ -1,5 +1,5 @@ # This is a wrapper for binlog.test so that the same test case can be used # For both statement and row based bin logs 9/19/2005 [jbm] --- source include/have_binlog_format_statement.inc +-- source include/have_binlog_format_mixed_or_statement.inc -- source extra/binlog_tests/innodb_stat.test diff --git a/mysql-test/t/binlog_stm_insert_select.test b/mysql-test/t/binlog_stm_insert_select.test index 06792990a55..3aefa1e6cf7 100644 --- a/mysql-test/t/binlog_stm_insert_select.test +++ b/mysql-test/t/binlog_stm_insert_select.test @@ -1,5 +1,5 @@ # This is a wrapper for binlog.test so that the same test case can be used # For both statement and row based bin logs 9/19/2005 [jbm] --- source include/have_binlog_format_statement.inc +-- source include/have_binlog_format_mixed_or_statement.inc -- source extra/binlog_tests/insert_select-binlog.test diff --git a/mysql-test/t/binlog_stm_mix_innodb_myisam.test b/mysql-test/t/binlog_stm_mix_innodb_myisam.test index 829cf50fe1e..cb6516a3a2f 100644 --- a/mysql-test/t/binlog_stm_mix_innodb_myisam.test +++ b/mysql-test/t/binlog_stm_mix_innodb_myisam.test @@ -1,7 +1,7 @@ # This is a wrapper for binlog.test so that the same test case can be used # For both statement and row based bin logs 9/19/2005 [jbm] --- source include/have_binlog_format_statement.inc +-- source include/have_binlog_format_mixed_or_statement.inc -- source extra/binlog_tests/mix_innodb_myisam_binlog.test # This piece below cannot be put into diff --git a/mysql-test/t/create_select_tmp.test b/mysql-test/t/create_select_tmp.test index 144bccc5871..ba9898b7752 100644 --- a/mysql-test/t/create_select_tmp.test +++ b/mysql-test/t/create_select_tmp.test @@ -6,7 +6,7 @@ # inconsistency between binlog and the internal list of temp tables. # This does not work for RBR yet. ---source include/have_binlog_format_statement.inc +--source include/have_binlog_format_mixed_or_statement.inc -- source include/have_innodb.inc --disable_warnings diff --git a/mysql-test/t/ctype_cp932_binlog_stm.test b/mysql-test/t/ctype_cp932_binlog_stm.test index 7a0ac671417..6b591fbe5f5 100644 --- a/mysql-test/t/ctype_cp932_binlog_stm.test +++ b/mysql-test/t/ctype_cp932_binlog_stm.test @@ -1,7 +1,7 @@ # This is a wrapper for binlog.test so that the same test case can be used # For both statement and row based bin logs 11/07/2005 [jbm] --- source include/have_binlog_format_statement.inc +-- source include/have_binlog_format_mixed_or_statement.inc -- source extra/binlog_tests/ctype_cp932_binlog.test # diff --git a/mysql-test/t/date_formats.test b/mysql-test/t/date_formats.test index 6898cd5802d..c19ebeb2e28 100644 --- a/mysql-test/t/date_formats.test +++ b/mysql-test/t/date_formats.test @@ -6,9 +6,9 @@ drop table if exists t1; --enable_warnings ---replace_result ROW STATEMENT +--replace_result ROW STATEMENT MIXED SHOW GLOBAL VARIABLES LIKE "%_format%"; ---replace_result ROW STATEMENT +--replace_result ROW STATEMENT MIXED SHOW SESSION VARIABLES LIKE "%_format%"; # @@ -36,7 +36,7 @@ set datetime_format= '%H:%i:%s.%f %m-%d-%Y'; set datetime_format= '%h:%i:%s %p %Y-%m-%d'; set datetime_format= '%h:%i:%s.%f %p %Y-%m-%d'; ---replace_result ROW STATEMENT +--replace_result ROW STATEMENT MIXED SHOW SESSION VARIABLES LIKE "%format"; --error 1231 diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test index ceba78bf762..b1ee39479b9 100644 --- a/mysql-test/t/mysqlbinlog.test +++ b/mysql-test/t/mysqlbinlog.test @@ -1,6 +1,6 @@ # We are using .opt file since we need small binlog size # TODO: Need to look at making a row based version once the new row based client is completed. [jbm] --- source include/have_binlog_format_statement.inc +-- source include/have_binlog_format_mixed_or_statement.inc # Embedded server doesn't support binlogging -- source include/not_embedded.inc diff --git a/mysql-test/t/mysqlbinlog2.test b/mysql-test/t/mysqlbinlog2.test index 91da502da02..69cd5d90453 100644 --- a/mysql-test/t/mysqlbinlog2.test +++ b/mysql-test/t/mysqlbinlog2.test @@ -2,7 +2,7 @@ # and a few others. # TODO: Need to look at making row based version once new binlog client is complete. --- source include/have_binlog_format_statement.inc +-- source include/have_binlog_format_mixed_or_statement.inc # Embedded server doesn't support binlogging -- source include/not_embedded.inc diff --git a/mysql-test/t/ndb_multi.test b/mysql-test/t/ndb_multi.test index 36018e6c679..df2cc9c1d8b 100644 --- a/mysql-test/t/ndb_multi.test +++ b/mysql-test/t/ndb_multi.test @@ -1,7 +1,7 @@ -- source include/have_ndb.inc -- source include/have_multi_ndb.inc -- source include/not_embedded.inc --- source include/have_binlog_format_statement.inc +-- source include/have_binlog_format_mixed_or_statement.inc --disable_warnings connection server2; diff --git a/mysql-test/t/rpl000013.test b/mysql-test/t/rpl000013.test index c681e76cf51..69a102e84ce 100644 --- a/mysql-test/t/rpl000013.test +++ b/mysql-test/t/rpl000013.test @@ -7,7 +7,7 @@ # in row-based, it hangs waiting for an offset which is never # reached (the "sync_with_master 1"), logically. ---source include/have_binlog_format_statement.inc +--source include/have_binlog_format_mixed_or_statement.inc source include/master-slave.inc; save_master_pos; connection slave; diff --git a/mysql-test/t/rpl_heap.test b/mysql-test/t/rpl_heap.test index b35983ad4d7..b8972ee9e78 100644 --- a/mysql-test/t/rpl_heap.test +++ b/mysql-test/t/rpl_heap.test @@ -1,5 +1,5 @@ # Requires statement logging --- source include/have_binlog_format_statement.inc +-- source include/have_binlog_format_mixed_or_statement.inc # You must run this test with --manager. diff --git a/mysql-test/t/rpl_loaddata_s.test b/mysql-test/t/rpl_loaddata_s.test index 72a5d1a8ec1..2c94c8ef953 100644 --- a/mysql-test/t/rpl_loaddata_s.test +++ b/mysql-test/t/rpl_loaddata_s.test @@ -2,7 +2,7 @@ # replicated LOAD DATA INFILE correctly when it has binlog_*_db rules. # This is for BUG#1100 (LOAD DATA INFILE was half-logged). --- source include/have_binlog_format_statement.inc +-- source include/have_binlog_format_mixed_or_statement.inc -- source include/master-slave.inc connection slave; diff --git a/mysql-test/t/rpl_mixed_ddl_dml.test b/mysql-test/t/rpl_mixed_ddl_dml.test index 5b9ed6898b8..6a1f81abed3 100644 --- a/mysql-test/t/rpl_mixed_ddl_dml.test +++ b/mysql-test/t/rpl_mixed_ddl_dml.test @@ -1,7 +1,7 @@ # Mixed DDL-DML (CREATE ... SELECT ...) statements can only be # replicated properly in statement-based replication. # Currently statement based due to bug 12345 ---source include/have_binlog_format_statement.inc +--source include/have_binlog_format_mixed_or_statement.inc source include/master-slave.inc; diff --git a/mysql-test/t/rpl_rbr_to_sbr.test b/mysql-test/t/rpl_rbr_to_sbr.test index c10199f8ff5..83a9b08c344 100644 --- a/mysql-test/t/rpl_rbr_to_sbr.test +++ b/mysql-test/t/rpl_rbr_to_sbr.test @@ -1,12 +1,11 @@ -- source include/have_row_based.inc --- source include/have_binlog_format_statement.inc +-- source include/have_binlog_format_mixed_or_statement.inc -- source include/master-slave.inc # Test that the slave temporarily switches to ROW when seeing binrow # events when it is in STATEMENT or MIXED mode SET BINLOG_FORMAT=MIXED; -SELECT @@GLOBAL.BINLOG_FORMAT, @@SESSION.BINLOG_FORMAT; SET GLOBAL BINLOG_FORMAT=MIXED; SELECT @@GLOBAL.BINLOG_FORMAT, @@SESSION.BINLOG_FORMAT; diff --git a/mysql-test/t/rpl_rewrt_db.test b/mysql-test/t/rpl_rewrt_db.test index 8acc05f6ff5..52f04e073dd 100644 --- a/mysql-test/t/rpl_rewrt_db.test +++ b/mysql-test/t/rpl_rewrt_db.test @@ -1,5 +1,5 @@ # TBF - difference in row level logging --- source include/have_binlog_format_statement.inc +-- source include/have_binlog_format_mixed_or_statement.inc -- source include/master-slave.inc --disable_warnings diff --git a/mysql-test/t/rpl_rotate_logs.test b/mysql-test/t/rpl_rotate_logs.test index a5c8a87c74d..2249dff1449 100644 --- a/mysql-test/t/rpl_rotate_logs.test +++ b/mysql-test/t/rpl_rotate_logs.test @@ -13,7 +13,7 @@ # - Test creating a duplicate key error and recover from it # Requires statement logging --- source include/have_binlog_format_statement.inc +-- source include/have_binlog_format_mixed_or_statement.inc connect (master,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK); --disable_warnings diff --git a/mysql-test/t/rpl_stm_EE_err2.test b/mysql-test/t/rpl_stm_EE_err2.test index dbcc66686ec..face651b9a1 100644 --- a/mysql-test/t/rpl_stm_EE_err2.test +++ b/mysql-test/t/rpl_stm_EE_err2.test @@ -3,6 +3,6 @@ # Date: 2006-01-11 # Purpose: Engine Wrapper for rpl_stm_EE_err2.test ############################## --- source include/have_binlog_format_statement.inc +-- source include/have_binlog_format_mixed_or_statement.inc let $engine_type=myisam; -- source extra/rpl_tests/rpl_stm_EE_err2.test diff --git a/mysql-test/t/rpl_stm_flsh_tbls.test b/mysql-test/t/rpl_stm_flsh_tbls.test index 3a6102de279..43a5234ccc7 100644 --- a/mysql-test/t/rpl_stm_flsh_tbls.test +++ b/mysql-test/t/rpl_stm_flsh_tbls.test @@ -1,5 +1,5 @@ # depends on the binlog output ---source include/have_binlog_format_statement.inc +--source include/have_binlog_format_mixed_or_statement.inc let $rename_event_pos= 652; -- source extra/rpl_tests/rpl_flsh_tbls.test diff --git a/mysql-test/t/rpl_stm_log.test b/mysql-test/t/rpl_stm_log.test index d11e1fd8ac1..5a1e0facc83 100644 --- a/mysql-test/t/rpl_stm_log.test +++ b/mysql-test/t/rpl_stm_log.test @@ -1,5 +1,5 @@ # Requires statement logging --- source include/have_binlog_format_statement.inc +-- source include/have_binlog_format_mixed_or_statement.inc let $engine_type=MyISAM; -- source extra/rpl_tests/rpl_log.test diff --git a/mysql-test/t/rpl_stm_max_relay_size.test b/mysql-test/t/rpl_stm_max_relay_size.test index 50008533388..950aa8b322a 100644 --- a/mysql-test/t/rpl_stm_max_relay_size.test +++ b/mysql-test/t/rpl_stm_max_relay_size.test @@ -4,7 +4,7 @@ # Test of manual relay log rotation with FLUSH LOGS. # Requires statement logging --- source include/have_binlog_format_statement.inc +-- source include/have_binlog_format_mixed_or_statement.inc -- source extra/rpl_tests/rpl_max_relay_size.test # End of 4.1 tests diff --git a/mysql-test/t/rpl_stm_multi_query.test b/mysql-test/t/rpl_stm_multi_query.test index 97c322ac780..c39d1fad015 100644 --- a/mysql-test/t/rpl_stm_multi_query.test +++ b/mysql-test/t/rpl_stm_multi_query.test @@ -4,7 +4,7 @@ # one binlog event containing all queries) # Requires statement logging --- source include/have_binlog_format_statement.inc +-- source include/have_binlog_format_mixed_or_statement.inc -- source extra/rpl_tests/rpl_multi_query.test diff --git a/mysql-test/t/rpl_stm_mystery22.test b/mysql-test/t/rpl_stm_mystery22.test index a43f2610350..017593fdfba 100644 --- a/mysql-test/t/rpl_stm_mystery22.test +++ b/mysql-test/t/rpl_stm_mystery22.test @@ -15,7 +15,7 @@ #should proceed in a correct way. ################################# --- source include/have_binlog_format_statement.inc +-- source include/have_binlog_format_mixed_or_statement.inc -- source include/master-slave.inc # first, cause a duplicate key problem on the slave diff --git a/mysql-test/t/rpl_stm_no_op.test b/mysql-test/t/rpl_stm_no_op.test index f82bbd8cd55..66dc89bd712 100644 --- a/mysql-test/t/rpl_stm_no_op.test +++ b/mysql-test/t/rpl_stm_no_op.test @@ -4,7 +4,7 @@ # case. So this test is meaningul only in statement-based (and if it was # enabled in row-based, it would fail as expected). --- source include/have_binlog_format_statement.inc +-- source include/have_binlog_format_mixed_or_statement.inc source include/master-slave.inc; diff --git a/mysql-test/t/rpl_stm_reset_slave.test b/mysql-test/t/rpl_stm_reset_slave.test index 282033bf6d1..6a99d4e1613 100644 --- a/mysql-test/t/rpl_stm_reset_slave.test +++ b/mysql-test/t/rpl_stm_reset_slave.test @@ -1,5 +1,5 @@ # TBF - difference in row level logging --- source include/have_binlog_format_statement.inc +-- source include/have_binlog_format_mixed_or_statement.inc -- source extra/rpl_tests/rpl_reset_slave.test # End of 4.1 tests diff --git a/mysql-test/t/rpl_stm_until.test b/mysql-test/t/rpl_stm_until.test index 9a4e4471fe1..f42965c0eb0 100644 --- a/mysql-test/t/rpl_stm_until.test +++ b/mysql-test/t/rpl_stm_until.test @@ -1,4 +1,4 @@ --- source include/have_binlog_format_statement.inc +-- source include/have_binlog_format_mixed_or_statement.inc -- source include/master-slave.inc # Test is dependent on binlog positions diff --git a/mysql-test/t/rpl_temp_table.test b/mysql-test/t/rpl_temp_table.test index c29fa8e676d..9b73961aeea 100644 --- a/mysql-test/t/rpl_temp_table.test +++ b/mysql-test/t/rpl_temp_table.test @@ -1,7 +1,7 @@ # drop table t1 t2 t3 are included int master-slave.inc # meaningful only in statement-based: --- source include/have_binlog_format_statement.inc +-- source include/have_binlog_format_mixed_or_statement.inc -- source include/master-slave.inc diff --git a/mysql-test/t/rpl_trigger.test b/mysql-test/t/rpl_trigger.test index 591941c19eb..0f87475ff07 100644 --- a/mysql-test/t/rpl_trigger.test +++ b/mysql-test/t/rpl_trigger.test @@ -2,7 +2,7 @@ # Test of triggers with replication # Adding statement include due to Bug 12574 # TODO: Remove statement include once 12574 is patched ---source include/have_binlog_format_statement.inc +--source include/have_binlog_format_mixed_or_statement.inc --source include/master-slave.inc --disable_warnings diff --git a/mysql-test/t/rpl_trunc_temp.test b/mysql-test/t/rpl_trunc_temp.test index 56f858dc9a2..28bcb0c06c3 100644 --- a/mysql-test/t/rpl_trunc_temp.test +++ b/mysql-test/t/rpl_trunc_temp.test @@ -1,5 +1,5 @@ # Requires statement logging --- source include/have_binlog_format_statement.inc +-- source include/have_binlog_format_mixed_or_statement.inc source include/master-slave.inc; diff --git a/mysql-test/t/user_var-binlog.test b/mysql-test/t/user_var-binlog.test index 7f1561b925b..6615e48ca42 100644 --- a/mysql-test/t/user_var-binlog.test +++ b/mysql-test/t/user_var-binlog.test @@ -1,5 +1,5 @@ # Requires statement logging --- source include/have_binlog_format_statement.inc +-- source include/have_binlog_format_mixed_or_statement.inc # TODO: Create row based version once $MYSQL_BINLOG has new RB version # Embedded server does not support binlogging --source include/not_embedded.inc diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 7561943d197..8f02c0565ff 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -3135,7 +3135,11 @@ with --log-bin instead."); global_system_variables.binlog_format= BINLOG_FORMAT_ROW; else #endif +#if defined(HAVE_ROW_BASED_REPLICATION) + global_system_variables.binlog_format= BINLOG_FORMAT_MIXED; +#else global_system_variables.binlog_format= BINLOG_FORMAT_STMT; +#endif } /* Check that we have not let the format to unspecified at this point */ @@ -4936,7 +4940,13 @@ Disable with --skip-bdb (will save memory).", "supports only statement-based binary logging, so only 'statement' is " "a legal value." #endif - , 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, + , 0, 0, 0, GET_STR, REQUIRED_ARG, +#ifdef HAVE_ROW_BASED_REPLICATION + BINLOG_FORMAT_MIXED +#else + BINLOG_FORMAT_STMT +#endif + , 0, 0, 0, 0, 0 }, {"binlog-do-db", OPT_BINLOG_DO_DB, "Tells the master it should log updates for the specified database, and exclude all others not explicitly mentioned.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},