diff options
25 files changed, 94 insertions, 108 deletions
diff --git a/mysql-test/include/master-slave.inc b/mysql-test/include/master-slave.inc index ea09f4e842b..6b5a508a949 100644 --- a/mysql-test/include/master-slave.inc +++ b/mysql-test/include/master-slave.inc @@ -1,3 +1,6 @@ +# Replication tests need binlog +source include/have_binlog.inc; + connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,); connect (master1,127.0.0.1,root,,test,$MASTER_MYPORT,); connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT,); diff --git a/mysql-test/lib/mtr_cases.pl b/mysql-test/lib/mtr_cases.pl index 1d157ea3401..6650a7b9b90 100644 --- a/mysql-test/lib/mtr_cases.pl +++ b/mysql-test/lib/mtr_cases.pl @@ -596,6 +596,22 @@ sub collect_one_test_case($$$$$$$) { } } + if ( $tinfo->{'need_binlog'} ) + { + if (grep(/^--skip-log-bin/, @::opt_extra_mysqld_opt) ) + { + $tinfo->{'skip'}= 1; + $tinfo->{'comment'}= "Test need binlog"; + return; + } + } + else + { + # Test does not need binlog, add --skip-binlog to + # the options used when starting it + push(@{$tinfo->{'master_opt'}}, "--skip-log-bin"); + } + } } @@ -608,6 +624,7 @@ our @tags= ["include/have_binlog_format_row.inc", "binlog_format", "row"], ["include/have_binlog_format_statement.inc", "binlog_format", "stmt"], ["include/have_binlog_format_mixed.inc", "binlog_format", "mixed"], + ["include/have_binlog.inc", "need_binlog", 1], ["include/big_test.inc", "big_test", 1], ["include/have_debug.inc", "need_debug", 1], ["include/have_ndb.inc", "ndb_test", 1], diff --git a/mysql-test/r/ctype_cp932_notembedded.result b/mysql-test/r/ctype_cp932_notembedded.result deleted file mode 100644 index 241fa0d1db7..00000000000 --- a/mysql-test/r/ctype_cp932_notembedded.result +++ /dev/null @@ -1,16 +0,0 @@ -drop table if exists t1; -set names cp932; -set character_set_database = cp932; -RESET MASTER; -CREATE TABLE t1(f1 blob); -PREPARE stmt1 FROM 'INSERT INTO t1 VALUES(?)'; -SET @var1= x'8300'; -EXECUTE stmt1 USING @var1; -SHOW BINLOG EVENTS FROM 98; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 98 Query 1 188 use `test`; CREATE TABLE t1(f1 blob) -master-bin.000001 188 Query 1 283 use `test`; INSERT INTO t1 VALUES(0x8300) -SELECT HEX(f1) FROM t1; -HEX(f1) -8300 -DROP table t1; diff --git a/mysql-test/r/sp_trans.result b/mysql-test/r/sp_trans.result index c74909e7e8f..564e31c9e32 100644 --- a/mysql-test/r/sp_trans.result +++ b/mysql-test/r/sp_trans.result @@ -530,23 +530,3 @@ count(*) drop table t3, t4| drop procedure bug14210| set @@session.max_heap_table_size=default| -CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM| -CREATE TABLE t2 (a int NOT NULL auto_increment, b int, PRIMARY KEY (a)) ENGINE=InnoDB| -insert into t2 values (1,1)| -create function bug23333() -RETURNS int(11) -DETERMINISTIC -begin -insert into t1 values (null); -select count(*) from t1 into @a; -return @a; -end| -reset master| -insert into t2 values (bug23333(),1)| -ERROR 23000: Duplicate entry '1' for key 1 -show binlog events from 98 /* with fixes for #23333 will show there is the query */| -Log_name Pos Event_type Server_id End_log_pos Info -select count(*),@a from t1 /* must be 1,1 */| -count(*) @a -1 1 -drop table t1, t2| diff --git a/mysql-test/r/sp_trans_log.result b/mysql-test/r/sp_trans_log.result new file mode 100644 index 00000000000..96e6f76b23c --- /dev/null +++ b/mysql-test/r/sp_trans_log.result @@ -0,0 +1,20 @@ +CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM| +CREATE TABLE t2 (a int NOT NULL auto_increment, b int, PRIMARY KEY (a)) ENGINE=InnoDB| +insert into t2 values (1,1)| +create function bug23333() +RETURNS int(11) +DETERMINISTIC +begin +insert into t1 values (null); +select count(*) from t1 into @a; +return @a; +end| +reset master| +insert into t2 values (bug23333(),1)| +ERROR 23000: Duplicate entry '1' for key 1 +show binlog events from 98 /* with fixes for #23333 will show there is the query */| +Log_name Pos Event_type Server_id End_log_pos Info +select count(*),@a from t1 /* must be 1,1 */| +count(*) @a +1 1 +drop table t1, t2| diff --git a/mysql-test/t/binlog.test b/mysql-test/t/binlog.test index 1063940d378..49369470d42 100644 --- a/mysql-test/t/binlog.test +++ b/mysql-test/t/binlog.test @@ -4,6 +4,7 @@ -- source include/not_embedded.inc -- source include/have_bdb.inc -- source include/have_innodb.inc +-- source include/have_log_bin.inc --disable_warnings drop table if exists t1, t2; diff --git a/mysql-test/t/blackhole.test b/mysql-test/t/blackhole.test index 4bafad2d777..af319d37dd0 100644 --- a/mysql-test/t/blackhole.test +++ b/mysql-test/t/blackhole.test @@ -4,6 +4,7 @@ # -- source include/not_embedded.inc -- source include/have_blackhole.inc +-- source include/have_log_bin.inc --disable_warnings drop table if exists t1,t2; diff --git a/mysql-test/t/ctype_cp932_binlog.test b/mysql-test/t/ctype_cp932_binlog.test index 443036910d0..7db8f311800 100644 --- a/mysql-test/t/ctype_cp932_binlog.test +++ b/mysql-test/t/ctype_cp932_binlog.test @@ -1,5 +1,6 @@ -- source include/not_embedded.inc -- source include/have_cp932.inc +-- source include/have_log_bin.inc --character_set cp932 --disable_warnings diff --git a/mysql-test/t/ctype_cp932_notembedded.test b/mysql-test/t/ctype_cp932_notembedded.test deleted file mode 100644 index 52e7acc3f01..00000000000 --- a/mysql-test/t/ctype_cp932_notembedded.test +++ /dev/null @@ -1,32 +0,0 @@ --- source include/not_embedded.inc --- source include/have_cp932.inc - ---character_set cp932 ---disable_warnings -drop table if exists t1; ---enable_warnings - -set names cp932; -set character_set_database = cp932; - -# Test prepared statement with 0x8300 sequence in parameter while -# running with cp932 client character set. -RESET MASTER; -CREATE TABLE t1(f1 blob); -PREPARE stmt1 FROM 'INSERT INTO t1 VALUES(?)'; -SET @var1= x'8300'; -# TODO: Note that this doesn't actually test the code which was added for -# bug#11338 because this syntax for prepared statements causes the PS to -# be replicated differently than if we executed the PS from C or Java. -# Using this syntax, variable names are inserted into the binlog instead -# of values. The real goal of this test is to check the code that was -# added to Item_param::query_val_str() in order to do hex encoding of -# PS parameters when the client character set is cp932; -# Bug#11338 has an example java program which can be used to verify this -# code (and I have used it to test the fix) until there is some way to -# exercise this code from mysql-test-run. -EXECUTE stmt1 USING @var1; -SHOW BINLOG EVENTS FROM 98; -SELECT HEX(f1) FROM t1; -DROP table t1; -# end test for bug#11338 diff --git a/mysql-test/t/ctype_ucs_binlog.test b/mysql-test/t/ctype_ucs_binlog.test index 2467d34386c..92d4458a9c2 100644 --- a/mysql-test/t/ctype_ucs_binlog.test +++ b/mysql-test/t/ctype_ucs_binlog.test @@ -1,5 +1,6 @@ --source include/not_embedded.inc --source include/have_ucs2.inc +--source include/have_log_bin.inc # # Check correct binlogging of UCS2 user variables (BUG#3875) diff --git a/mysql-test/t/drop_temp_table.test b/mysql-test/t/drop_temp_table.test index bc06de4096c..86bdc0eeecc 100644 --- a/mysql-test/t/drop_temp_table.test +++ b/mysql-test/t/drop_temp_table.test @@ -1,5 +1,5 @@ -# Embedded server doesn't support binlog --- source include/not_embedded.inc +--source include/have_log_bin.inc + --disable_warnings drop database if exists `drop-temp+table-test`; diff --git a/mysql-test/t/flush_block_commit_notembedded.test b/mysql-test/t/flush_block_commit_notembedded.test index 4650a5a15a8..e3b59e0fc45 100644 --- a/mysql-test/t/flush_block_commit_notembedded.test +++ b/mysql-test/t/flush_block_commit_notembedded.test @@ -4,7 +4,7 @@ # This is intended to mimick how mysqldump and innobackup work. # And it requires InnoDB --- source include/not_embedded.inc +-- source include/have_log_bin.inc -- source include/have_innodb.inc connect (con1,localhost,root,,); diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index f7fa7366101..b7f264578f2 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -12,6 +12,7 @@ ####################################################################### -- source include/have_innodb.inc +-- source include/have_log_bin.inc # # Small basic test with ignore diff --git a/mysql-test/t/insert_select-binlog.test b/mysql-test/t/insert_select-binlog.test index d4041f86ab5..4bff09577a7 100644 --- a/mysql-test/t/insert_select-binlog.test +++ b/mysql-test/t/insert_select-binlog.test @@ -1,5 +1,6 @@ # Embedded server doesn't support binlog -- source include/not_embedded.inc +-- source include/have_log_bin.inc # Check if a partly-completed INSERT SELECT in a MyISAM table goes into the # binlog diff --git a/mysql-test/t/mix_innodb_myisam_binlog.test b/mysql-test/t/mix_innodb_myisam_binlog.test index 8bced9f069c..893c93153dd 100644 --- a/mysql-test/t/mix_innodb_myisam_binlog.test +++ b/mysql-test/t/mix_innodb_myisam_binlog.test @@ -5,9 +5,7 @@ # did some tests manually on a slave; tables are replicated fine and # Exec_Master_Log_Pos advances as expected. -# Embedded server doesn't support binlogging --- source include/not_embedded.inc - +-- source include/have_log_bin.inc -- source include/have_innodb.inc --disable_warnings diff --git a/mysql-test/t/mysqlbinlog-cp932.test b/mysql-test/t/mysqlbinlog-cp932.test index 1487606a6c2..ca938be7d76 100644 --- a/mysql-test/t/mysqlbinlog-cp932.test +++ b/mysql-test/t/mysqlbinlog-cp932.test @@ -1,6 +1,7 @@ # disabled in embedded until tools running is fixed with embedded --source include/not_embedded.inc -- source include/have_cp932.inc +-- source include/have_log_bin.inc # Bug#16217 (mysql client did not know how not switch its internal charset) flush logs; diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test index a7b3f413f23..ba161ddbb89 100644 --- a/mysql-test/t/mysqlbinlog.test +++ b/mysql-test/t/mysqlbinlog.test @@ -1,7 +1,6 @@ # We are using .opt file since we need small binlog size -# Embedded server doesn't support binlogging --- source include/not_embedded.inc +-- source include/have_log_bin.inc # we need this for getting fixed timestamps inside of this test set timestamp=1000000000; diff --git a/mysql-test/t/mysqlbinlog2.test b/mysql-test/t/mysqlbinlog2.test index 14b213cd9cc..c6869d67da1 100644 --- a/mysql-test/t/mysqlbinlog2.test +++ b/mysql-test/t/mysqlbinlog2.test @@ -1,8 +1,7 @@ # Test for the new options --start-datetime, stop-datetime, # and a few others. -# Embedded server doesn't support binlogging --- source include/not_embedded.inc +-- source include/have_log_bin.inc --disable_warnings drop table if exists t1; diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 4c4690520c6..d2a6d7014ec 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -1,5 +1,6 @@ # Embedded server doesn't support external clients --source include/not_embedded.inc +--source include/have_log_bin.inc --disable_warnings DROP TABLE IF EXISTS t1, `"t"1`, t1aa, t2, t2aa, t3; diff --git a/mysql-test/t/rpl000015.test b/mysql-test/t/rpl000015.test index d05e4df66b1..e103d40943f 100644 --- a/mysql-test/t/rpl000015.test +++ b/mysql-test/t/rpl000015.test @@ -1,3 +1,5 @@ +-- source include/have_log_bin.inc + connect (master,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK); connect (slave,localhost,root,,test,$SLAVE_MYPORT,$SLAVE_MYSOCK); connection master; diff --git a/mysql-test/t/rpl000017.test b/mysql-test/t/rpl000017.test index c1d36d53501..4488cbad230 100644 --- a/mysql-test/t/rpl000017.test +++ b/mysql-test/t/rpl000017.test @@ -1,3 +1,5 @@ +-- source include/have_log_bin.inc + connect (master,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK); connect (slave,localhost,root,,test,$SLAVE_MYPORT,$SLAVE_MYSOCK); connection master; diff --git a/mysql-test/t/rpl_rotate_logs.test b/mysql-test/t/rpl_rotate_logs.test index 01f556c3c8f..69614b45693 100644 --- a/mysql-test/t/rpl_rotate_logs.test +++ b/mysql-test/t/rpl_rotate_logs.test @@ -1,6 +1,8 @@ # This test uses chmod, can't be run with root permissions -- source include/not_as_root.inc +-- source include/have_log_bin.inc + # # Test is run with max_binlog_size=2048 to force automatic rotation of the # binary log diff --git a/mysql-test/t/sp_trans.test b/mysql-test/t/sp_trans.test index 8eccaafcf0e..1ea32316f1e 100644 --- a/mysql-test/t/sp_trans.test +++ b/mysql-test/t/sp_trans.test @@ -554,34 +554,6 @@ set @@session.max_heap_table_size=default| # -# Bug #13270 INSERT,UPDATE,etc that calls func with side-effect does not binlog -# Bug #23333 stored function + non-transac table + transac table = -# breaks stmt-based binlog -# Bug #27395 OPTION_STATUS_NO_TRANS_UPDATE is not preserved at the end of SF() -# -CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM| -CREATE TABLE t2 (a int NOT NULL auto_increment, b int, PRIMARY KEY (a)) ENGINE=InnoDB| - -insert into t2 values (1,1)| - -create function bug23333() -RETURNS int(11) -DETERMINISTIC -begin - insert into t1 values (null); - select count(*) from t1 into @a; - return @a; -end| - -reset master| ---error ER_DUP_ENTRY -insert into t2 values (bug23333(),1)| ---replace_column 2 # 5 # 6 # -show binlog events from 98 /* with fixes for #23333 will show there is the query */| -select count(*),@a from t1 /* must be 1,1 */| -drop table t1, t2| - -# # BUG#NNNN: New bug synopsis # #--disable_warnings diff --git a/mysql-test/t/sp_trans_log.test b/mysql-test/t/sp_trans_log.test new file mode 100644 index 00000000000..3e440b3ccc1 --- /dev/null +++ b/mysql-test/t/sp_trans_log.test @@ -0,0 +1,33 @@ +-- source include/have_innodb.inc +-- source include/have_log_bin.inc + +delimiter |; + +# +# Bug #13270 INSERT,UPDATE,etc that calls func with side-effect does not binlog +# Bug #23333 stored function + non-transac table + transac table = +# breaks stmt-based binlog +# Bug #27395 OPTION_STATUS_NO_TRANS_UPDATE is not preserved at the end of SF() +# +CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM| +CREATE TABLE t2 (a int NOT NULL auto_increment, b int, PRIMARY KEY (a)) ENGINE=InnoDB| + +insert into t2 values (1,1)| + +create function bug23333() +RETURNS int(11) +DETERMINISTIC +begin + insert into t1 values (null); + select count(*) from t1 into @a; + return @a; +end| + +reset master| +--error ER_DUP_ENTRY +insert into t2 values (bug23333(),1)| +--replace_column 2 # 5 # 6 # +show binlog events from 98 /* with fixes for #23333 will show there is the query */| +select count(*),@a from t1 /* must be 1,1 */| +drop table t1, t2| + diff --git a/mysql-test/t/user_var-binlog.test b/mysql-test/t/user_var-binlog.test index 12a5e616fa2..57bf9df2fb0 100644 --- a/mysql-test/t/user_var-binlog.test +++ b/mysql-test/t/user_var-binlog.test @@ -1,5 +1,4 @@ -# Embedded server does not support binlogging ---source include/not_embedded.inc +-- source include/have_log_bin.inc # Check that user variables are binlogged correctly (BUG#3875) create table t1 (a varchar(50)); |