Bug#28369 rpl test cases fail with binlog disabled

 - Turn on binlog only for tests that need it
 - Skip those tests if --skip-binlog is used
parent c7ee7b33
# Replication tests need binlog
source include/have_binlog.inc;
connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,); connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,);
connect (master1,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,); connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT,);
......
...@@ -596,6 +596,22 @@ sub collect_one_test_case($$$$$$$) { ...@@ -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= ...@@ -608,6 +624,7 @@ our @tags=
["include/have_binlog_format_row.inc", "binlog_format", "row"], ["include/have_binlog_format_row.inc", "binlog_format", "row"],
["include/have_binlog_format_statement.inc", "binlog_format", "stmt"], ["include/have_binlog_format_statement.inc", "binlog_format", "stmt"],
["include/have_binlog_format_mixed.inc", "binlog_format", "mixed"], ["include/have_binlog_format_mixed.inc", "binlog_format", "mixed"],
["include/have_binlog.inc", "need_binlog", 1],
["include/big_test.inc", "big_test", 1], ["include/big_test.inc", "big_test", 1],
["include/have_debug.inc", "need_debug", 1], ["include/have_debug.inc", "need_debug", 1],
["include/have_ndb.inc", "ndb_test", 1], ["include/have_ndb.inc", "ndb_test", 1],
......
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;
...@@ -530,23 +530,3 @@ count(*) ...@@ -530,23 +530,3 @@ count(*)
drop table t3, t4| drop table t3, t4|
drop procedure bug14210| drop procedure bug14210|
set @@session.max_heap_table_size=default| 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|
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|
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
-- source include/not_embedded.inc -- source include/not_embedded.inc
-- source include/have_bdb.inc -- source include/have_bdb.inc
-- source include/have_innodb.inc -- source include/have_innodb.inc
-- source include/have_log_bin.inc
--disable_warnings --disable_warnings
drop table if exists t1, t2; drop table if exists t1, t2;
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
# #
-- source include/not_embedded.inc -- source include/not_embedded.inc
-- source include/have_blackhole.inc -- source include/have_blackhole.inc
-- source include/have_log_bin.inc
--disable_warnings --disable_warnings
drop table if exists t1,t2; drop table if exists t1,t2;
......
-- source include/not_embedded.inc -- source include/not_embedded.inc
-- source include/have_cp932.inc -- source include/have_cp932.inc
-- source include/have_log_bin.inc
--character_set cp932 --character_set cp932
--disable_warnings --disable_warnings
......
-- 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
--source include/not_embedded.inc --source include/not_embedded.inc
--source include/have_ucs2.inc --source include/have_ucs2.inc
--source include/have_log_bin.inc
# #
# Check correct binlogging of UCS2 user variables (BUG#3875) # Check correct binlogging of UCS2 user variables (BUG#3875)
......
# Embedded server doesn't support binlog --source include/have_log_bin.inc
-- source include/not_embedded.inc
--disable_warnings --disable_warnings
drop database if exists `drop-temp+table-test`; drop database if exists `drop-temp+table-test`;
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
# This is intended to mimick how mysqldump and innobackup work. # This is intended to mimick how mysqldump and innobackup work.
# And it requires InnoDB # And it requires InnoDB
-- source include/not_embedded.inc -- source include/have_log_bin.inc
-- source include/have_innodb.inc -- source include/have_innodb.inc
connect (con1,localhost,root,,); connect (con1,localhost,root,,);
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
####################################################################### #######################################################################
-- source include/have_innodb.inc -- source include/have_innodb.inc
-- source include/have_log_bin.inc
# #
# Small basic test with ignore # Small basic test with ignore
......
# Embedded server doesn't support binlog # Embedded server doesn't support binlog
-- source include/not_embedded.inc -- 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 # Check if a partly-completed INSERT SELECT in a MyISAM table goes into the
# binlog # binlog
......
...@@ -5,9 +5,7 @@ ...@@ -5,9 +5,7 @@
# did some tests manually on a slave; tables are replicated fine and # did some tests manually on a slave; tables are replicated fine and
# Exec_Master_Log_Pos advances as expected. # Exec_Master_Log_Pos advances as expected.
# Embedded server doesn't support binlogging -- source include/have_log_bin.inc
-- source include/not_embedded.inc
-- source include/have_innodb.inc -- source include/have_innodb.inc
--disable_warnings --disable_warnings
......
# disabled in embedded until tools running is fixed with embedded # disabled in embedded until tools running is fixed with embedded
--source include/not_embedded.inc --source include/not_embedded.inc
-- source include/have_cp932.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) # Bug#16217 (mysql client did not know how not switch its internal charset)
flush logs; flush logs;
......
# We are using .opt file since we need small binlog size # We are using .opt file since we need small binlog size
# Embedded server doesn't support binlogging -- source include/have_log_bin.inc
-- source include/not_embedded.inc
# we need this for getting fixed timestamps inside of this test # we need this for getting fixed timestamps inside of this test
set timestamp=1000000000; set timestamp=1000000000;
......
# Test for the new options --start-datetime, stop-datetime, # Test for the new options --start-datetime, stop-datetime,
# and a few others. # and a few others.
# Embedded server doesn't support binlogging -- source include/have_log_bin.inc
-- source include/not_embedded.inc
--disable_warnings --disable_warnings
drop table if exists t1; drop table if exists t1;
......
# Embedded server doesn't support external clients # Embedded server doesn't support external clients
--source include/not_embedded.inc --source include/not_embedded.inc
--source include/have_log_bin.inc
--disable_warnings --disable_warnings
DROP TABLE IF EXISTS t1, `"t"1`, t1aa, t2, t2aa, t3; DROP TABLE IF EXISTS t1, `"t"1`, t1aa, t2, t2aa, t3;
......
-- source include/have_log_bin.inc
connect (master,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK); connect (master,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
connect (slave,localhost,root,,test,$SLAVE_MYPORT,$SLAVE_MYSOCK); connect (slave,localhost,root,,test,$SLAVE_MYPORT,$SLAVE_MYSOCK);
connection master; connection master;
......
-- source include/have_log_bin.inc
connect (master,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK); connect (master,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
connect (slave,localhost,root,,test,$SLAVE_MYPORT,$SLAVE_MYSOCK); connect (slave,localhost,root,,test,$SLAVE_MYPORT,$SLAVE_MYSOCK);
connection master; connection master;
......
# This test uses chmod, can't be run with root permissions # This test uses chmod, can't be run with root permissions
-- source include/not_as_root.inc -- 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 # Test is run with max_binlog_size=2048 to force automatic rotation of the
# binary log # binary log
......
...@@ -553,34 +553,6 @@ drop procedure bug14210| ...@@ -553,34 +553,6 @@ drop procedure bug14210|
set @@session.max_heap_table_size=default| 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 # BUG#NNNN: New bug synopsis
# #
......
-- 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|
# Embedded server does not support binlogging -- source include/have_log_bin.inc
--source include/not_embedded.inc
# Check that user variables are binlogged correctly (BUG#3875) # Check that user variables are binlogged correctly (BUG#3875)
create table t1 (a varchar(50)); create table t1 (a varchar(50));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment