summaryrefslogtreecommitdiff
path: root/mysql-test/suite/rpl
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/suite/rpl')
-rw-r--r--mysql-test/suite/rpl/r/rpl_auto_increment.result19
-rw-r--r--mysql-test/suite/rpl/r/rpl_checksum.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_deadlock_innodb.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_filter_dbs_dynamic.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_filter_tables_dynamic.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_filter_wild_tables_dynamic.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_flush_logs.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_heartbeat.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_heartbeat_basic.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_hrtime.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_insert_delayed,stmt.rdiff4
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddatalocal.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_log_pos.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_mariadb_slave_capability.result98
-rw-r--r--mysql-test/suite/rpl/r/rpl_mdev382.result368
-rw-r--r--mysql-test/suite/rpl/r/rpl_packet.result11
-rw-r--r--mysql-test/suite/rpl/r/rpl_rewrt_db.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_rotate_logs.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_annotate_do.result1
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_annotate_dont.result1
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_log.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_log_innodb.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_max_relay_size.result7
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_show_relaylog_events.result70
-rw-r--r--mysql-test/suite/rpl/r/rpl_skip_replication.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_sp.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_log.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result7
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_mix_show_relaylog_events.result64
-rw-r--r--mysql-test/suite/rpl/r/rpl_trigger.result10
-rw-r--r--mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test17
-rw-r--r--mysql-test/suite/rpl/t/rpl_flush_logs.test24
-rw-r--r--mysql-test/suite/rpl/t/rpl_mariadb_slave_capability.test104
-rw-r--r--mysql-test/suite/rpl/t/rpl_mdev382.test265
-rw-r--r--mysql-test/suite/rpl/t/rpl_packet-slave.opt2
-rw-r--r--mysql-test/suite/rpl/t/rpl_packet.test15
-rw-r--r--mysql-test/suite/rpl/t/rpl_start_stop_slave.test10
-rw-r--r--mysql-test/suite/rpl/t/rpl_trigger.test7
40 files changed, 1033 insertions, 154 deletions
diff --git a/mysql-test/suite/rpl/r/rpl_auto_increment.result b/mysql-test/suite/rpl/r/rpl_auto_increment.result
index 8b41a01cb6e..41bacd78f52 100644
--- a/mysql-test/suite/rpl/r/rpl_auto_increment.result
+++ b/mysql-test/suite/rpl/r/rpl_auto_increment.result
@@ -125,6 +125,10 @@ insert into t1 values(600),(NULL),(NULL);
ERROR 23000: Duplicate entry '600' for key 'PRIMARY'
set @@insert_id=600;
insert ignore into t1 values(600),(NULL),(NULL),(610),(NULL);
+Warnings:
+Warning 1062 Duplicate entry '600' for key 'PRIMARY'
+Warning 1062 Duplicate entry '600' for key 'PRIMARY'
+Warning 1062 Duplicate entry '600' for key 'PRIMARY'
select * from t1;
a
1
@@ -186,7 +190,7 @@ set auto_increment_offset=4;
insert into t1 values(null);
insert into t1 values(null);
insert into t1 values(null);
-ERROR 23000: Duplicate entry '125' for key 'PRIMARY'
+ERROR 22003: Out of range value for column 'a' at row 1
select a, mod(a-@@auto_increment_offset,@@auto_increment_increment) from t1 order by a;
a mod(a-@@auto_increment_offset,@@auto_increment_increment)
103 0
@@ -196,21 +200,19 @@ create table t2 (a tinyint unsigned not null auto_increment primary key) engine=
set auto_increment_increment=10;
set auto_increment_offset=1;
set insert_id=1000;
+insert into t2 values(10);
insert into t2 values(null);
-Warnings:
-Warning 1264 Out of range value for column 'a' at row 1
+ERROR 22003: Out of range value for column 'a' at row 1
select a, mod(a-@@auto_increment_offset,@@auto_increment_increment) from t2 order by a;
a mod(a-@@auto_increment_offset,@@auto_increment_increment)
-251 0
+10 9
create table t3 like t1;
set auto_increment_increment=1000;
set auto_increment_offset=700;
insert into t3 values(null);
-Warnings:
-Warning 1264 Out of range value for column 'a' at row 1
+ERROR 22003: Out of range value for column 'a' at row 1
select * from t3 order by a;
a
-127
select * from t1 order by a;
a
103
@@ -218,10 +220,9 @@ a
125
select * from t2 order by a;
a
-251
+10
select * from t3 order by a;
a
-127
drop table t1,t2,t3;
set auto_increment_increment=1;
set auto_increment_offset=1;
diff --git a/mysql-test/suite/rpl/r/rpl_checksum.result b/mysql-test/suite/rpl/r/rpl_checksum.result
index ba5cb1b1b2b..fb61f159c80 100644
--- a/mysql-test/suite/rpl/r/rpl_checksum.result
+++ b/mysql-test/suite/rpl/r/rpl_checksum.result
@@ -71,7 +71,7 @@ insert into t1 values (1) /* will not be applied on slave due to simulation */;
set @@global.debug_dbug='d,simulate_slave_unaware_checksum';
start slave;
include/wait_for_slave_io_error.inc [errno=1236]
-Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'Slave can not handle replication events with the checksum that master is configured to log; the first event 'master-bin.000009' at 245, the last event read from 'master-bin.000010' at 245, the last byte read from 'master-bin.000010' at 245.''
+Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'Slave can not handle replication events with the checksum that master is configured to log; the first event 'master-bin.000009' at 326, the last event read from 'master-bin.000010' at 246, the last byte read from 'master-bin.000010' at 246.''
select count(*) as zero from t1;
zero
0
diff --git a/mysql-test/suite/rpl/r/rpl_deadlock_innodb.result b/mysql-test/suite/rpl/r/rpl_deadlock_innodb.result
index 37d209bbcf6..f2128f8d855 100644
--- a/mysql-test/suite/rpl/r/rpl_deadlock_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_deadlock_innodb.result
@@ -76,6 +76,8 @@ include/check_slave_is_running.inc
*** Test lock wait timeout and purged relay logs ***
SET @my_max_relay_log_size= @@global.max_relay_log_size;
SET global max_relay_log_size=0;
+Warnings:
+Warning 1292 Truncated incorrect max_relay_log_size value: '0'
include/stop_slave.inc
DELETE FROM t2;
CHANGE MASTER TO MASTER_LOG_POS=<master_pos_begin>;
diff --git a/mysql-test/suite/rpl/r/rpl_filter_dbs_dynamic.result b/mysql-test/suite/rpl/r/rpl_filter_dbs_dynamic.result
index 321b8d912e6..eaa2ed9a61d 100644
--- a/mysql-test/suite/rpl/r/rpl_filter_dbs_dynamic.result
+++ b/mysql-test/suite/rpl/r/rpl_filter_dbs_dynamic.result
@@ -1,9 +1,9 @@
include/master-slave.inc
[connection master]
SET @@GLOBAL.replicate_do_db="db1";
-ERROR HY000: This operation cannot be performed with a running slave; run STOP SLAVE first
+ERROR HY000: This operation cannot be performed as you have a running slave ''; run STOP SLAVE '' first
SET @@GLOBAL.replicate_ignore_db="db2";
-ERROR HY000: This operation cannot be performed with a running slave; run STOP SLAVE first
+ERROR HY000: This operation cannot be performed as you have a running slave ''; run STOP SLAVE '' first
include/stop_slave.inc
SET @@GLOBAL.replicate_do_db="db1";
SET @@GLOBAL.replicate_ignore_db="db2";
diff --git a/mysql-test/suite/rpl/r/rpl_filter_tables_dynamic.result b/mysql-test/suite/rpl/r/rpl_filter_tables_dynamic.result
index 9eb803d17ea..3d03d36828a 100644
--- a/mysql-test/suite/rpl/r/rpl_filter_tables_dynamic.result
+++ b/mysql-test/suite/rpl/r/rpl_filter_tables_dynamic.result
@@ -1,9 +1,9 @@
include/master-slave.inc
[connection master]
SET @@GLOBAL.replicate_do_table="test.t1,test.t2,test.t3";
-ERROR HY000: This operation cannot be performed with a running slave; run STOP SLAVE first
+ERROR HY000: This operation cannot be performed as you have a running slave ''; run STOP SLAVE '' first
SET @@GLOBAL.replicate_ignore_table="test.t4,test.t5,test.t6";
-ERROR HY000: This operation cannot be performed with a running slave; run STOP SLAVE first
+ERROR HY000: This operation cannot be performed as you have a running slave ''; run STOP SLAVE '' first
include/stop_slave.inc
SET @@GLOBAL.replicate_do_table="test.t1,test.t2,test.t3";
SET @@GLOBAL.replicate_ignore_table="test.t4,test.t5,test.t6";
diff --git a/mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result b/mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result
index fcd03ea74b8..baf0cf81cec 100644
--- a/mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result
+++ b/mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result
@@ -114,22 +114,23 @@ id c
3 3
[on master]
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-CREATE TABLE test.t5 (a INT AUTO_INCREMENT PRIMARY KEY, b INT, c INT);
+CREATE TABLE test.t5 (a INT AUTO_INCREMENT PRIMARY KEY, b DECIMAL(20,20), c INT);
CREATE TABLE test.t1 (a INT);
INSERT INTO test.t1 VALUES(1);
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
-CREATE TABLE test.t_slave (a INT AUTO_INCREMENT PRIMARY KEY, b INT, c INT);
+CREATE TABLE test.t_slave (a INT AUTO_INCREMENT PRIMARY KEY, b DECIMAL(20,20), c INT);
CREATE TRIGGER t1_update AFTER UPDATE ON test.t1 FOR EACH ROW
-INSERT INTO test.t_slave VALUES(NULL, ROUND(RAND() * 1000), @c);
+INSERT INTO test.t_slave VALUES(NULL, RAND(), @c);
SET INSERT_ID=2;
SET @c=2;
SET @@rand_seed1=10000000, @@rand_seed2=1000000;
-INSERT INTO t5 VALUES (NULL, ROUND(RAND() * 1000), @c);
+INSERT INTO t5 VALUES (NULL, RAND(), @c);
SELECT b into @b FROM test.t5;
UPDATE test.t1 SET a=2;
SELECT a AS 'ONE' into @a FROM test.t_slave;
SELECT c AS 'NULL' into @c FROM test.t_slave;
SELECT b into @b FROM test.t_slave;
+include/assert.inc [Random values from master and slave must be different]
drop table test.t5;
drop table test.t1;
drop table test.t_slave;
diff --git a/mysql-test/suite/rpl/r/rpl_filter_wild_tables_dynamic.result b/mysql-test/suite/rpl/r/rpl_filter_wild_tables_dynamic.result
index 6858181234e..19d8e513e6f 100644
--- a/mysql-test/suite/rpl/r/rpl_filter_wild_tables_dynamic.result
+++ b/mysql-test/suite/rpl/r/rpl_filter_wild_tables_dynamic.result
@@ -1,9 +1,9 @@
include/master-slave.inc
[connection master]
SET @@GLOBAL.replicate_wild_do_table="test.a%";
-ERROR HY000: This operation cannot be performed with a running slave; run STOP SLAVE first
+ERROR HY000: This operation cannot be performed as you have a running slave ''; run STOP SLAVE '' first
SET @@GLOBAL.replicate_wild_ignore_table="test.b%";
-ERROR HY000: This operation cannot be performed with a running slave; run STOP SLAVE first
+ERROR HY000: This operation cannot be performed as you have a running slave ''; run STOP SLAVE '' first
include/stop_slave.inc
SET @@GLOBAL.replicate_wild_do_table="test.a%";
SET @@GLOBAL.replicate_wild_ignore_table="test.b%";
diff --git a/mysql-test/suite/rpl/r/rpl_flush_logs.result b/mysql-test/suite/rpl/r/rpl_flush_logs.result
index 4fce91a7234..1f543cd9f43 100644
--- a/mysql-test/suite/rpl/r/rpl_flush_logs.result
+++ b/mysql-test/suite/rpl/r/rpl_flush_logs.result
@@ -8,7 +8,7 @@ flush error logs;
# after execute 'flush error logs' statement.
# Test if support 'flush relay logs' statement.
flush relay logs;
-# Check the 'slave-relay-bin.000003' file is created
+# Check the 'slave-relay-bin.000003' file is not created
# after executed 'flush relay logs' statement.
# Make sure binary logs was not be flushed
# after execute 'flush relay logs' statement.
@@ -30,21 +30,21 @@ flush engine logs;
flush binary logs;
# Check the 'master-bin.000002' file is created
# after executed 'flush binary logs' statement.
-# Make sure the 'slave-relay-bin.000006' file does not exist
+# Make sure the 'slave-relay-bin.000005' file does not exist
# exist before execute 'flush error logs, relay logs' statement.
# Test if support to combine all kinds of logs into one statement.
flush error logs, relay logs;
# Make sure binary logs was not be flushed
# after execute 'flush error logs, relay logs' statement.
-# Check the 'slave-relay-bin.000006' file is created after
+# Check the 'slave-relay-bin.000004' file is created after
# execute 'flush error logs, relay logs' statement.
-# Make sure the 'slave-relay-bin.000007' and 'slave-relay-bin.000008'
+# Make sure the 'slave-relay-bin.000005' and 'slave-relay-bin.000006'
# files do not exist before execute 'flush error logs, relay logs'
# statement.
# Test if 'flush logs' statement works fine and flush all the logs.
flush logs;
# Check 'master-bin.000003' is created
# after execute 'flush logs' statement.
-# Check the 'slave-relay-bin.000007' and 'slave-relay-bin.000008'
+# Check the 'slave-relay-bin.000005' and 'slave-relay-bin.000006'
# files are created after execute 'flush logs' statement.
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_heartbeat.result b/mysql-test/suite/rpl/r/rpl_heartbeat.result
index d4bdb77ef0b..b0f36558d10 100644
--- a/mysql-test/suite/rpl/r/rpl_heartbeat.result
+++ b/mysql-test/suite/rpl/r/rpl_heartbeat.result
@@ -41,8 +41,6 @@ show status like 'Slave_heartbeat_period';;
Variable_name Slave_heartbeat_period
Value 4.000
set @@global.slave_net_timeout= 3 /* must be a warning */;
-Warnings:
-Warning 1704 The requested value for the heartbeat period exceeds the value of `slave_net_timeout' seconds. A sensible value for the period should be less than the timeout.
reset slave;
drop table if exists t1;
set @@global.slave_net_timeout= 10;
diff --git a/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result b/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result
index cc9d1f99f7c..0c274165e1e 100644
--- a/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result
+++ b/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result
@@ -33,8 +33,6 @@ RESET SLAVE;
*** Warning if updated slave_net_timeout < slave_heartbeat_timeout ***
SET @@global.slave_net_timeout=FLOOR(SLAVE_HEARTBEAT_TIMEOUT)-1;
-Warnings:
-Warning 1704 The requested value for the heartbeat period exceeds the value of `slave_net_timeout' seconds. A sensible value for the period should be less than the timeout.
SET @@global.slave_net_timeout=@restore_slave_net_timeout;
RESET SLAVE;
diff --git a/mysql-test/suite/rpl/r/rpl_hrtime.result b/mysql-test/suite/rpl/r/rpl_hrtime.result
index e4a825591bf..fbe4ba28409 100644
--- a/mysql-test/suite/rpl/r/rpl_hrtime.result
+++ b/mysql-test/suite/rpl/r/rpl_hrtime.result
@@ -30,7 +30,7 @@ include/rpl_end.inc
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-use test/*!*/;
+use `test`/*!*/;
SET TIMESTAMP=1293832861/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
diff --git a/mysql-test/suite/rpl/r/rpl_insert_delayed,stmt.rdiff b/mysql-test/suite/rpl/r/rpl_insert_delayed,stmt.rdiff
index 0c16e9d9bd7..801044d8fcd 100644
--- a/mysql-test/suite/rpl/r/rpl_insert_delayed,stmt.rdiff
+++ b/mysql-test/suite/rpl/r/rpl_insert_delayed,stmt.rdiff
@@ -1,5 +1,5 @@
---- suite/rpl/r/rpl_insert_delayed.result 2012-02-06 21:37:21.000000000 +0100
-+++ suite/rpl/r/rpl_insert_delayed,stmt.reject 2012-02-06 23:12:55.000000000 +0100
+--- suite/rpl/r/rpl_insert_delayed.result 2012-09-18 01:37:45.317521958 +0300
++++ suite/rpl/r/rpl_insert_delayed,stmt.reject 2012-09-18 01:36:16.637514667 +0300
@@ -15,17 +15,17 @@
insert delayed into t1 values(10, "my name");
flush table t1;
diff --git a/mysql-test/suite/rpl/r/rpl_loaddatalocal.result b/mysql-test/suite/rpl/r/rpl_loaddatalocal.result
index 257d5f580e8..16fd3f19c4a 100644
--- a/mysql-test/suite/rpl/r/rpl_loaddatalocal.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddatalocal.result
@@ -14,6 +14,8 @@ select * into outfile 'MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' from t1;
drop table t1;
create table t1(a int primary key);
load data local infile 'MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' into table t1;
+Warnings:
+Warning 1062 Duplicate entry '2' for key 'PRIMARY'
SELECT * FROM t1 ORDER BY a;
a
1
diff --git a/mysql-test/suite/rpl/r/rpl_log_pos.result b/mysql-test/suite/rpl/r/rpl_log_pos.result
index 8910f7c8f74..610d18a88c6 100644
--- a/mysql-test/suite/rpl/r/rpl_log_pos.result
+++ b/mysql-test/suite/rpl/r/rpl_log_pos.result
@@ -11,7 +11,7 @@ include/stop_slave.inc
change master to master_log_pos=MASTER_LOG_POS;
start slave;
include/wait_for_slave_io_error.inc [errno=1236]
-Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master; the first event 'master-bin.000001' at XXX, the last event read from 'master-bin.000001' at XXX, the last byte read from 'master-bin.000001' at XXX.''
+Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'binlog truncated in the middle of event; consider out of disk space on master; the first event 'master-bin.000001' at XXX, the last event read from 'master-bin.000001' at XXX, the last byte read from 'master-bin.000001' at XXX.''
include/stop_slave_sql.inc
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
diff --git a/mysql-test/suite/rpl/r/rpl_mariadb_slave_capability.result b/mysql-test/suite/rpl/r/rpl_mariadb_slave_capability.result
new file mode 100644
index 00000000000..0073c71507d
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_mariadb_slave_capability.result
@@ -0,0 +1,98 @@
+include/master-slave.inc
+[connection master]
+set @old_master_binlog_checksum= @@global.binlog_checksum;
+set @old_slave_dbug= @@global.debug_dbug;
+CREATE TABLE t1 (a INT PRIMARY KEY);
+INSERT INTO t1 VALUES (0);
+# Test slave with no capability gets dummy event, which is ignored.
+include/stop_slave.inc
+SET @@global.debug_dbug='+d,simulate_slave_capability_none';
+include/start_slave.inc
+ALTER TABLE t1 ORDER BY a;
+SET SESSION binlog_annotate_row_events = ON;
+DELETE FROM t1;
+INSERT INTO t1 /* A comment just to make the annotate event sufficiently long that the dummy event will need to get padded with spaces so that we can test that this works */ VALUES(1);
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Annotate_rows # # DELETE FROM t1
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Annotate_rows # # INSERT INTO t1 /* A comment just to make the annotate event sufficiently long that the dummy event will need to get padded with spaces so that we can test that this works */ VALUES(1)
+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
+SELECT * FROM t1;
+a
+1
+include/show_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-relay-bin.000003 # Query # # BEGIN
+slave-relay-bin.000003 # User var # # @`!dummyvar`=NULL
+slave-relay-bin.000003 # Table_map # # table_id: # (test.t1)
+slave-relay-bin.000003 # Delete_rows # # table_id: # flags: STMT_END_F
+slave-relay-bin.000003 # Query # # COMMIT
+slave-relay-bin.000003 # Query # # BEGIN
+slave-relay-bin.000003 # Query # # # Dummy event replacing event type 160 that slave cannot handle.
+slave-relay-bin.000003 # Table_map # # table_id: # (test.t1)
+slave-relay-bin.000003 # Write_rows # # table_id: # flags: STMT_END_F
+slave-relay-bin.000003 # Query # # COMMIT
+set @@global.debug_dbug= @old_slave_dbug;
+# Test dummy event is checksummed correctly.
+set @@global.binlog_checksum = CRC32;
+TRUNCATE t1;
+INSERT INTO t1 VALUES(2);
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000002 # Query # # BEGIN
+master-bin.000002 # Annotate_rows # # INSERT INTO t1 VALUES(2)
+master-bin.000002 # Table_map # # table_id: # (test.t1)
+master-bin.000002 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000002 # Query # # COMMIT
+SELECT * FROM t1;
+a
+2
+include/show_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-relay-bin.000005 # Query # # BEGIN
+slave-relay-bin.000005 # Query # # # Dummy ev
+slave-relay-bin.000005 # Table_map # # table_id: # (test.t1)
+slave-relay-bin.000005 # Write_rows # # table_id: # flags: STMT_END_F
+slave-relay-bin.000005 # Query # # COMMIT
+# Test that slave which cannot tolerate holes in binlog stream but
+# knows the event does not get dummy event
+include/stop_slave.inc
+SET @@global.debug_dbug='+d,simulate_slave_capability_old_53';
+include/start_slave.inc
+ALTER TABLE t1 ORDER BY a;
+UPDATE t1 SET a = 3;
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000002 # Query # # BEGIN
+master-bin.000002 # Annotate_rows # # UPDATE t1 SET a = 3
+master-bin.000002 # Table_map # # table_id: # (test.t1)
+master-bin.000002 # Update_rows # # table_id: # flags: STMT_END_F
+master-bin.000002 # Query # # COMMIT
+SELECT * FROM t1;
+a
+3
+include/show_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-relay-bin.000006 # Query # # BEGIN
+slave-relay-bin.000006 # Annotate_rows # # UPDATE t1 SET a = 3
+slave-relay-bin.000006 # Table_map # # table_id: # (test.t1)
+slave-relay-bin.000006 # Update_rows # # table_id: # flags: STMT_END_F
+slave-relay-bin.000006 # Query # # COMMIT
+select @@global.log_slave_updates;
+@@global.log_slave_updates
+1
+select @@global.replicate_annotate_row_events;
+@@global.replicate_annotate_row_events
+0
+set @@global.debug_dbug= @old_slave_dbug;
+Clean up.
+set @@global.binlog_checksum = @old_master_binlog_checksum;
+DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_mdev382.result b/mysql-test/suite/rpl/r/rpl_mdev382.result
new file mode 100644
index 00000000000..13bf7bf0a3e
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_mdev382.result
@@ -0,0 +1,368 @@
+include/master-slave.inc
+[connection master]
+create table t1 (a int primary key) engine=innodb;
+create table t2 (a int primary key) engine=myisam;
+begin;
+insert into t1 values (1);
+SET sql_mode = 'ANSI_QUOTES';
+savepoint `a``; create database couldbebadthingshere; savepoint ``dummy`;
+insert into t1 values (2);
+insert into t2 values (1);
+SET sql_mode = '';
+rollback to savepoint `a``; create database couldbebadthingshere; savepoint ``dummy`;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+insert into t1 values (3);
+commit;
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Binlog_checkpoint 1 # master-bin.000001
+master-bin.000001 # Query 1 # use `test`; create table t1 (a int primary key) engine=innodb
+master-bin.000001 # Query 1 # use `test`; create table t2 (a int primary key) engine=myisam
+master-bin.000001 # Query 1 # BEGIN
+master-bin.000001 # Query 1 # use `test`; insert into t2 values (1)
+master-bin.000001 # Query 1 # COMMIT
+master-bin.000001 # Query 1 # BEGIN
+master-bin.000001 # Query 1 # use `test`; insert into t1 values (1)
+master-bin.000001 # Query 1 # SAVEPOINT "a`; create database couldbebadthingshere; savepoint `dummy"
+master-bin.000001 # Query 1 # use `test`; insert into t1 values (2)
+master-bin.000001 # Query 1 # ROLLBACK TO `a``; create database couldbebadthingshere; savepoint ``dummy`
+master-bin.000001 # Query 1 # use `test`; insert into t1 values (3)
+master-bin.000001 # Xid 1 # COMMIT /* XID */
+BEGIN;
+insert into t1 values(10);
+set sql_mode = 'ANSI_QUOTES';
+set sql_quote_show_create = 1;
+savepoint a;
+insert into t1 values(11);
+savepoint "a""a";
+insert into t1 values(12);
+set sql_quote_show_create = 0;
+savepoint b;
+insert into t1 values(13);
+savepoint "b""b";
+insert into t1 values(14);
+set sql_mode = '';
+set sql_quote_show_create = 1;
+savepoint c;
+insert into t1 values(15);
+savepoint `c``c`;
+insert into t1 values(16);
+set sql_quote_show_create = 0;
+savepoint d;
+insert into t1 values(17);
+savepoint `d``d`;
+insert into t1 values(18);
+COMMIT;
+set sql_quote_show_create = 1;
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query 1 # BEGIN
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(10)
+master-bin.000001 # Query 1 # SAVEPOINT "a"
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(11)
+master-bin.000001 # Query 1 # SAVEPOINT "a""a"
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(12)
+master-bin.000001 # Query 1 # SAVEPOINT b
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(13)
+master-bin.000001 # Query 1 # SAVEPOINT "b""b"
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(14)
+master-bin.000001 # Query 1 # SAVEPOINT `c`
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(15)
+master-bin.000001 # Query 1 # SAVEPOINT `c``c`
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(16)
+master-bin.000001 # Query 1 # SAVEPOINT d
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(17)
+master-bin.000001 # Query 1 # SAVEPOINT `d``d`
+master-bin.000001 # Query 1 # use `test`; insert into t1 values(18)
+master-bin.000001 # Xid 1 # COMMIT /* XID */
+*** Test correct USE statement in SHOW BINLOG EVENTS ***
+set sql_mode = 'ANSI_QUOTES';
+CREATE DATABASE "db1`; select 'oops!'";
+use "db1`; select 'oops!'";
+CREATE TABLE t1 (a INT PRIMARY KEY) engine=MyISAM;
+INSERT INTO t1 VALUES (1);
+set sql_mode = '';
+INSERT INTO t1 VALUES (2);
+set sql_mode = 'ANSI_QUOTES';
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query 1 # CREATE DATABASE "db1`; select 'oops!'"
+master-bin.000001 # Query 1 # use "db1`; select 'oops!'"; CREATE TABLE t1 (a INT PRIMARY KEY) engine=MyISAM
+master-bin.000001 # Query 1 # BEGIN
+master-bin.000001 # Query 1 # use "db1`; select 'oops!'"; INSERT INTO t1 VALUES (1)
+master-bin.000001 # Query 1 # COMMIT
+master-bin.000001 # Query 1 # BEGIN
+master-bin.000001 # Query 1 # use "db1`; select 'oops!'"; INSERT INTO t1 VALUES (2)
+master-bin.000001 # Query 1 # COMMIT
+set sql_mode = '';
+set sql_quote_show_create = 0;
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query 1 # CREATE DATABASE "db1`; select 'oops!'"
+master-bin.000001 # Query 1 # use `db1``; select 'oops!'`; CREATE TABLE t1 (a INT PRIMARY KEY) engine=MyISAM
+master-bin.000001 # Query 1 # BEGIN
+master-bin.000001 # Query 1 # use `db1``; select 'oops!'`; INSERT INTO t1 VALUES (1)
+master-bin.000001 # Query 1 # COMMIT
+master-bin.000001 # Query 1 # BEGIN
+master-bin.000001 # Query 1 # use `db1``; select 'oops!'`; INSERT INTO t1 VALUES (2)
+master-bin.000001 # Query 1 # COMMIT
+set sql_quote_show_create = 1;
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query 1 # CREATE DATABASE "db1`; select 'oops!'"
+master-bin.000001 # Query 1 # use `db1``; select 'oops!'`; CREATE TABLE t1 (a INT PRIMARY KEY) engine=MyISAM
+master-bin.000001 # Query 1 # BEGIN
+master-bin.000001 # Query 1 # use `db1``; select 'oops!'`; INSERT INTO t1 VALUES (1)
+master-bin.000001 # Query 1 # COMMIT
+master-bin.000001 # Query 1 # BEGIN
+master-bin.000001 # Query 1 # use `db1``; select 'oops!'`; INSERT INTO t1 VALUES (2)
+master-bin.000001 # Query 1 # COMMIT
+DROP TABLE t1;
+use test;
+***Test LOAD DATA INFILE with various identifiers that need correct quoting ***
+use `db1``; select 'oops!'`;
+set timestamp=1000000000;
+CREATE TABLE `t``1` (`a``1` VARCHAR(4) PRIMARY KEY, `b``2` VARCHAR(3),
+`c``3` VARCHAR(7));
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/f''le.txt' INTO TABLE `t``1`
+ FIELDS TERMINATED BY ',' ESCAPED BY '\\' ENCLOSED BY ''''
+ LINES TERMINATED BY '\n'
+ (`a``1`, @`b```) SET `b``2` = @`b```, `c``3` = concat('|', "b""a'z", "!");
+SELECT * FROM `t``1`;
+a`1 b`2 c`3
+fo\o bar |b"a'z!
+truncate `t``1`;
+use test;
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/f''le.txt'
+ INTO TABLE `db1``; select 'oops!'`.`t``1`
+ FIELDS TERMINATED BY ',' ESCAPED BY '\\' ENCLOSED BY ''''
+ LINES TERMINATED BY '\n'
+ (`a``1`, `b``2`) SET `c``3` = concat('|', "b""a'z", "!");
+SELECT * FROM `db1``; select 'oops!'`.`t``1`;
+a`1 b`2 c`3
+fo\o bar |b"a'z!
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query 1 # use `db1``; select 'oops!'`; CREATE TABLE `t``1` (`a``1` VARCHAR(4) PRIMARY KEY, `b``2` VARCHAR(3),
+`c``3` VARCHAR(7))
+master-bin.000001 # Query 1 # BEGIN
+master-bin.000001 # Begin_load_query 1 # ;file_id=#;block_len=14
+master-bin.000001 # Execute_load_query 1 # use `db1``; select 'oops!'`; LOAD DATA INFILE '/usr/home/serg/Abk/mysql/10.0-monty/mysql-test/var/tmp/f\'le.txt' INTO TABLE `t``1` FIELDS TERMINATED BY ',' ENCLOSED BY '\'' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a``1`, @`b```) SET `b``2`= @`b```, `c``3`= concat('|', "b""a'z", "!") ;file_id=#
+master-bin.000001 # Query 1 # COMMIT
+master-bin.000001 # Query 1 # use `db1``; select 'oops!'`; truncate `t``1`
+master-bin.000001 # Query 1 # BEGIN
+master-bin.000001 # Begin_load_query 1 # ;file_id=#;block_len=14
+master-bin.000001 # Execute_load_query 1 # use `test`; LOAD DATA INFILE '/usr/home/serg/Abk/mysql/10.0-monty/mysql-test/var/tmp/f\'le.txt' INTO TABLE `db1``; select 'oops!'`.`t``1` FIELDS TERMINATED BY ',' ENCLOSED BY '\'' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a``1`, `b``2`) SET `c``3`= concat('|', "b""a'z", "!") ;file_id=#
+master-bin.000001 # Query 1 # COMMIT
+/*!40019 SET @@session.max_insert_delayed_threads=0*/;
+/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
+DELIMITER /*!*/;
+ROLLBACK/*!*/;
+use `db1``; select 'oops!'`/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+SET @@session.pseudo_thread_id=999999999/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.sql_mode=0/*!*/;
+SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
+/*!\C latin1 *//*!*/;
+SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
+SET @@session.lc_time_names=0/*!*/;
+SET @@session.collation_database=DEFAULT/*!*/;
+CREATE TABLE `t``1` (`a``1` VARCHAR(4) PRIMARY KEY, `b``2` VARCHAR(3),
+`c``3` VARCHAR(7))
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+BEGIN
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+LOAD DATA LOCAL INFILE '<name>' INTO TABLE `t``1` FIELDS TERMINATED BY ',' ENCLOSED BY '\'' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a``1`, @`b```) SET `b``2`= @`b```, `c``3`= concat('|', "b""a'z", "!")
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+truncate `t``1`
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+BEGIN
+/*!*/;
+use `test`/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+LOAD DATA LOCAL INFILE '<name>' INTO TABLE `db1``; select 'oops!'`.`t``1` FIELDS TERMINATED BY ',' ENCLOSED BY '\'' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a``1`, `b``2`) SET `c``3`= concat('|', "b""a'z", "!")
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+DELIMITER ;
+# End of log file
+ROLLBACK /* added by mysqlbinlog */;
+/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
+SELECT * FROM `db1``; select 'oops!'`.`t``1`;
+a`1 b`2 c`3
+fo\o bar |b"a'z!
+DROP TABLE `db1``; select 'oops!'`.`t``1`;
+drop table t1,t2;
+*** Test truncation of long SET expression in LOAD DATA ***
+CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(1000));
+LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/file.txt' INTO TABLE t1
+FIELDS TERMINATED BY ','
+ (a, @b) SET b = CONCAT(@b, '| 123456789A123456789B123456789C123456789D123456789E123456789F123456789G123456789H123456789I123456789J123456789K123456789L123456789M123456789N123456789O123456789P123456789Q123456789R123456789123456789T123456789U123456789V123456789W123456789X123456789Y123456789Z123456789|', @b);
+SELECT * FROM t1 ORDER BY a;
+a b
+1 X| 123456789A123456789B123456789C123456789D123456789E123456789F123456789G123456789H123456789I123456789J123456789K123456789L123456789M123456789N123456789O123456789P123456789Q123456789R123456789123456789T123456789U123456789V123456789W123456789X123456789Y123456789Z123456789|X
+2 A| 123456789A123456789B123456789C123456789D123456789E123456789F123456789G123456789H123456789I123456789J123456789K123456789L123456789M123456789N123456789O123456789P123456789Q123456789R123456789123456789T123456789U123456789V123456789W123456789X123456789Y123456789Z123456789|A
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query 1 # BEGIN
+master-bin.000001 # Begin_load_query 1 # ;file_id=#;block_len=8
+master-bin.000001 # Execute_load_query 1 # use `test`; LOAD DATA INFILE '/usr/home/serg/Abk/mysql/10.0-monty/mysql-test/var/tmp/file.txt' INTO TABLE `t1` FIELDS TERMINATED BY ',' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`, @`b`) SET `b`= CONCAT(@b, '| 123456789A123456789B123456789C123456789D123456789E123456789F123456789G123456789H123456789I123456789J123456789K123456789L123456789M123456789N123456789O123456789P123456789Q123456789R123456789123456789T123456789U123456789V123456789W123456789X123456789Y123456789Z123456789|', @b) ;file_id=#
+master-bin.000001 # Query 1 # COMMIT
+SELECT * FROM t1 ORDER BY a;
+a b
+1 X| 123456789A123456789B123456789C123456789D123456789E123456789F123456789G123456789H123456789I123456789J123456789K123456789L123456789M123456789N123456789O123456789P123456789Q123456789R123456789123456789T123456789U123456789V123456789W123456789X123456789Y123456789Z123456789|X
+2 A| 123456789A123456789B123456789C123456789D123456789E123456789F123456789G123456789H123456789I123456789J123456789K123456789L123456789M123456789N123456789O123456789P123456789Q123456789R123456789123456789T123456789U123456789V123456789W123456789X123456789Y123456789Z123456789|A
+DROP TABLE t1;
+*** Test user variables whose names require correct quoting ***
+use `db1``; select 'oops!'`;
+CREATE TABLE t1 (a1 BIGINT PRIMARY KEY, a2 BIGINT, a3 BIGINT, a4 BIGINT UNSIGNED, b DOUBLE, c DECIMAL(65,10), d VARCHAR(100));
+INSERT INTO t1 VALUES (-9223372036854775808,42,9223372036854775807,18446744073709551615,-1234560123456789e110, -1234501234567890123456789012345678901234567890123456789.0123456789, REPEAT("x", 100));
+SELECT @`a``1`:=a1, @`a``2`:=a2, @`a``3`:=a3, @`a``4`:=a4, @`b```:=b, @```c`:=c, @```d```:=d FROM t1;
+@`a``1`:=a1 @`a``2`:=a2 @`a``3`:=a3 @`a``4`:=a4 @`b```:=b @```c`:=c @```d```:=d
+-9223372036854775808 42 9223372036854775807 18446744073709551615 -1.234560123456789e125 -1234501234567890123456789012345678901234567890123456789.0123456789 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+INSERT INTO t1 VALUES (@`a``1`+1, @`a``2`*100, @`a``3`-1, @`a``4`-1, @`b```/2, @```c`, substr(@```d```, 2, 98));
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query 1 # use `db1``; select 'oops!'`; CREATE TABLE t1 (a1 BIGINT PRIMARY KEY, a2 BIGINT, a3 BIGINT, a4 BIGINT UNSIGNED, b DOUBLE, c DECIMAL(65,10), d VARCHAR(100))
+master-bin.000001 # Query 1 # BEGIN
+master-bin.000001 # Query 1 # use `db1``; select 'oops!'`; INSERT INTO t1 VALUES (-9223372036854775808,42,9223372036854775807,18446744073709551615,-1234560123456789e110, -1234501234567890123456789012345678901234567890123456789.0123456789, REPEAT("x", 100))
+master-bin.000001 # Query 1 # COMMIT
+master-bin.000001 # Query 1 # BEGIN
+master-bin.000001 # User var 1 # @`a``1`=-9223372036854775808
+master-bin.000001 # User var 1 # @`a``2`=42
+master-bin.000001 # User var 1 # @`a``3`=9223372036854775807
+master-bin.000001 # User var 1 # @`a``4`=18446744073709551615
+master-bin.000001 # User var 1 # @`b```=-1.234560123456789e125
+master-bin.000001 # User var 1 # @```c`=-1234501234567890123456789012345678901234567890123456789.0123456789
+master-bin.000001 # User var 1 # @```d```=_latin1 0x78787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878 COLLATE latin1_swedish_ci
+master-bin.000001 # Query 1 # use `db1``; select 'oops!'`; INSERT INTO t1 VALUES (@`a``1`+1, @`a``2`*100, @`a``3`-1, @`a``4`-1, @`b```/2, @```c`, substr(@```d```, 2, 98))
+master-bin.000001 # Query 1 # COMMIT
+/*!40019 SET @@session.max_insert_delayed_threads=0*/;
+/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
+DELIMITER /*!*/;
+ROLLBACK/*!*/;
+use `db1``; select 'oops!'`/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+SET @@session.pseudo_thread_id=999999999/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.sql_mode=0/*!*/;
+SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
+/*!\C latin1 *//*!*/;
+SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
+SET @@session.lc_time_names=0/*!*/;
+SET @@session.collation_database=DEFAULT/*!*/;
+CREATE TABLE t1 (a1 BIGINT PRIMARY KEY, a2 BIGINT, a3 BIGINT, a4 BIGINT UNSIGNED, b DOUBLE, c DECIMAL(65,10), d VARCHAR(100))
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+BEGIN
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+INSERT INTO t1 VALUES (-9223372036854775808,42,9223372036854775807,18446744073709551615,-1234560123456789e110, -1234501234567890123456789012345678901234567890123456789.0123456789, REPEAT("x", 100))
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+BEGIN
+/*!*/;
+SET @`a``1`:=-9223372036854775808/*!*/;
+SET @`a``2`:=42/*!*/;
+SET @`a``3`:=9223372036854775807/*!*/;
+SET @`a``4`:=18446744073709551615/*!*/;
+SET @`b```:=-1.2345601234568e+125/*!*/;
+SET @```c`:=-1234501234567890123456789012345678901234567890123456789.0123456789/*!*/;
+SET @```d```:=_latin1 0x78787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878 COLLATE `latin1_swedish_ci`/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+INSERT INTO t1 VALUES (@`a``1`+1, @`a``2`*100, @`a``3`-1, @`a``4`-1, @`b```/2, @```c`, substr(@```d```, 2, 98))
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+DELIMITER ;
+# End of log file
+ROLLBACK /* added by mysqlbinlog */;
+/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
+SELECT * FROM `db1``; select 'oops!'`.t1 ORDER BY a1;
+a1 a2 a3 a4 b c d
+-9223372036854775808 42 9223372036854775807 18446744073709551615 -1.234560123456789e125 -1234501234567890123456789012345678901234567890123456789.0123456789 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+-9223372036854775807 4200 9223372036854775806 18446744073709551614 -6.172800617283945e124 -1234501234567890123456789012345678901234567890123456789.0123456789 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+DROP TABLE t1;
+*** Test correct quoting in foreign key error message ***
+use `db1``; select 'oops!'`;
+CREATE TABLE `t``1` ( `a``` INT PRIMARY KEY) ENGINE=innodb;
+CREATE TABLE `t``2` ( `b``` INT PRIMARY KEY, `c``` INT NOT NULL,
+FOREIGN KEY fk (`c```) REFERENCES `t``1`(`a```)) ENGINE=innodb;
+TRUNCATE `t``1`;
+ERROR 42000: Cannot truncate a table referenced in a foreign key constraint (`db1``; select 'oops!'`.`t``2`, CONSTRAINT `INNODB_FOREIGN_KEY_NAME` FOREIGN KEY (`c```) REFERENCES `db1``; select 'oops!'`.`t``1` (`a```))
+DROP TABLE `t``2`;
+DROP TABLE `t``1`;
+*** Test correct quoting of DELETE FROM statement binlogged for HEAP table that is emptied due to server restart
+include/stop_slave.inc
+CREATE TABLE `db1``; select 'oops!'`.`t``1` (`a``` INT PRIMARY KEY) ENGINE=heap;
+INSERT INTO `db1``; select 'oops!'`.`t``1` VALUES (1), (2), (5);
+SELECT * FROM `db1``; select 'oops!'`.`t``1` ORDER BY 1;
+a`
+1
+2
+5
+set timestamp=1000000000;
+# The table should be empty on the master.
+SELECT * FROM `db1``; select 'oops!'`.`t``1`;
+a`
+# The DELETE statement should be correctly quoted
+show binlog events in 'master-bin.000002' from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000002 # Query 1 # DELETE FROM `db1``; select 'oops!'`.`t``1`
+include/start_slave.inc
+# The table should be empty on the slave also.
+SELECT * FROM `db1``; select 'oops!'`.`t``1`;
+a`
+DROP TABLE `db1``; select 'oops!'`.`t``1`;
+use test;
+DROP DATABASE `db1``; select 'oops!'`;
+*** Test correct quoting of mysqlbinlog --rewrite-db option ***
+CREATE TABLE t1 (a INT PRIMARY KEY);
+INSERT INTO t1 VALUES(1);
+show binlog events in 'master-bin.000002' from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000002 # Query 1 # BEGIN
+master-bin.000002 # Query 1 # use `test`; INSERT INTO t1 VALUES(1)
+master-bin.000002 # Query 1 # COMMIT
+/*!40019 SET @@session.max_insert_delayed_threads=0*/;
+/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
+DELIMITER /*!*/;
+ROLLBACK/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+SET @@session.pseudo_thread_id=999999999/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.sql_mode=0/*!*/;
+SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
+/*!\C latin1 *//*!*/;
+SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
+SET @@session.lc_time_names=0/*!*/;
+SET @@session.collation_database=DEFAULT/*!*/;
+BEGIN
+/*!*/;
+use `ts``et`/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+INSERT INTO t1 VALUES(1)
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+DELIMITER ;
+# End of log file
+ROLLBACK /* added by mysqlbinlog */;
+/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
+DROP TABLE t1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_packet.result b/mysql-test/suite/rpl/r/rpl_packet.result
index 4d5ffae2d63..65fd2800e7d 100644
--- a/mysql-test/suite/rpl/r/rpl_packet.result
+++ b/mysql-test/suite/rpl/r/rpl_packet.result
@@ -1,7 +1,7 @@
include/master-slave.inc
[connection master]
-call mtr.add_suppression("Slave I/O: Got a packet bigger than 'max_allowed_packet' bytes, Error_code: 1153");
-call mtr.add_suppression("Slave I/O: Got fatal error 1236 from master when reading data from binary log:");
+call mtr.add_suppression("Slave I/O: Got a packet bigger than 'slave_max_allowed_packet' bytes, Error_code: 1153");
+call mtr.add_suppression("Log entry on master is longer than slave_max_allowed_packet");
drop database if exists DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
create database DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
SET @@global.max_allowed_packet=1024;
@@ -30,14 +30,14 @@ include/start_slave.inc
CREATE TABLE `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2048');
include/wait_for_slave_io_error.inc [errno=1153]
-Last_IO_Error = 'Got a packet bigger than 'max_allowed_packet' bytes'
+Last_IO_Error = 'Got a packet bigger than 'slave_max_allowed_packet' bytes'
include/stop_slave_sql.inc
include/rpl_reset.inc
DROP TABLE t1;
CREATE TABLE t1 (f1 int PRIMARY KEY, f2 LONGTEXT, f3 LONGTEXT) ENGINE=MyISAM;
INSERT INTO t1(f1, f2, f3) VALUES(1, REPEAT('a', @@global.max_allowed_packet), REPEAT('b', @@global.max_allowed_packet));
-include/wait_for_slave_io_error.inc [errno=1236]
-Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master; the first event '.' at XXX, the last event read from 'master-bin.000001' at XXX, the last byte read from 'master-bin.000001' at XXX.''
+include/wait_for_slave_io_error.inc [errno=1153]
+Last_IO_Error = 'Got a packet bigger than 'slave_max_allowed_packet' bytes'
STOP SLAVE;
RESET SLAVE;
RESET MASTER;
@@ -52,6 +52,7 @@ SET @@global.max_allowed_packet= 1024;
Warnings:
Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length'
SET @@global.net_buffer_length= 1024;
+SET @@global.slave_max_allowed_packet= 1073741824;
DROP TABLE t1;
RESET SLAVE;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_rewrt_db.result b/mysql-test/suite/rpl/r/rpl_rewrt_db.result
index 562aac11879..32299cb27c4 100644
--- a/mysql-test/suite/rpl/r/rpl_rewrt_db.result
+++ b/mysql-test/suite/rpl/r/rpl_rewrt_db.result
@@ -25,8 +25,8 @@ Warnings:
Warning 1265 Data truncated for column 'a' at row 1
Warning 1265 Data truncated for column 'c' at row 1
Warning 1265 Data truncated for column 'd' at row 1
-Warning 1264 Out of range value for column 'a' at row 2
-Warning 1264 Out of range value for column 'b' at row 2
+Warning 1265 Data truncated for column 'a' at row 2
+Warning 1265 Data truncated for column 'b' at row 2
Warning 1265 Data truncated for column 'd' at row 2
load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES;
select * from rewrite.t1;
@@ -40,7 +40,7 @@ load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated
Warnings:
Warning 1265 Data truncated for column 'c' at row 1
Warning 1265 Data truncated for column 'd' at row 1
-Warning 1264 Out of range value for column 'b' at row 2
+Warning 1265 Data truncated for column 'b' at row 2
Warning 1265 Data truncated for column 'd' at row 2
select * from rewrite.t1;
a b c d
diff --git a/mysql-test/suite/rpl/r/rpl_rotate_logs.result b/mysql-test/suite/rpl/r/rpl_rotate_logs.result
index f10e30c698d..783c02b961c 100644
--- a/mysql-test/suite/rpl/r/rpl_rotate_logs.result
+++ b/mysql-test/suite/rpl/r/rpl_rotate_logs.result
@@ -2,9 +2,9 @@ CALL mtr.add_suppression("Unsafe statement written to the binary log using state
start slave;
Got one of the listed errors
start slave;
-ERROR HY000: Could not initialize master info structure; more error messages can be found in the MariaDB error log
+ERROR HY000: Could not initialize master info structure for ''; more error messages can be found in the MariaDB error log
change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root';
-ERROR HY000: Could not initialize master info structure; more error messages can be found in the MariaDB error log
+ERROR HY000: Could not initialize master info structure for ''; more error messages can be found in the MariaDB error log
reset slave;
change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root';
reset master;
diff --git a/mysql-test/suite/rpl/r/rpl_row_annotate_do.result b/mysql-test/suite/rpl/r/rpl_row_annotate_do.result
index a7dc2a569a1..cb1aab28603 100644
--- a/mysql-test/suite/rpl/r/rpl_row_annotate_do.result
+++ b/mysql-test/suite/rpl/r/rpl_row_annotate_do.result
@@ -55,6 +55,7 @@ a b
FLUSH LOGS;
show binlog events in 'slave-bin.000001' from <start_pos>;
Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000001 # Binlog_checkpoint 2 # slave-bin.000001
slave-bin.000001 # Query 1 # DROP DATABASE IF EXISTS test1
slave-bin.000001 # Query 1 # CREATE DATABASE test1
slave-bin.000001 # Query 1 # use `test1`; CREATE TABLE t1(a int primary key, b int)
diff --git a/mysql-test/suite/rpl/r/rpl_row_annotate_dont.result b/mysql-test/suite/rpl/r/rpl_row_annotate_dont.result
index 2a3b5b1870e..b7648fd8592 100644
--- a/mysql-test/suite/rpl/r/rpl_row_annotate_dont.result
+++ b/mysql-test/suite/rpl/r/rpl_row_annotate_dont.result
@@ -47,6 +47,7 @@ a b
FLUSH LOGS;
show binlog events in 'slave-bin.000001' from <start_pos>;
Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000001 # Binlog_checkpoint 2 # slave-bin.000001
slave-bin.000001 # Query 1 # DROP DATABASE IF EXISTS test1
slave-bin.000001 # Query 1 # CREATE DATABASE test1
slave-bin.000001 # Query 1 # use `test1`; CREATE TABLE t1(a int primary key, b int)
diff --git a/mysql-test/suite/rpl/r/rpl_row_log.result b/mysql-test/suite/rpl/r/rpl_row_log.result
index b2b1417defd..856679e49f6 100644
--- a/mysql-test/suite/rpl/r/rpl_row_log.result
+++ b/mysql-test/suite/rpl/r/rpl_row_log.result
@@ -205,6 +205,7 @@ master-bin.000001 # Query # # COMMIT
master-bin.000001 # Rotate # # master-bin.000002;pos=POS
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000002 # Binlog_checkpoint # # master-bin.000002
master-bin.000002 # Query # # use `test`; create table t3 (a int)ENGINE=MyISAM
master-bin.000002 # Query # # use `test`; create table t2 (n int)ENGINE=MyISAM
master-bin.000002 # Query # # BEGIN
@@ -236,6 +237,7 @@ slave-bin.000001 # Query # # use `test`; create table t3 (a int)ENGINE=MyISAM
slave-bin.000001 # Rotate # # slave-bin.000002;pos=POS
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000002 # Binlog_checkpoint # # slave-bin.000002
slave-bin.000002 # Query # # use `test`; create table t2 (n int)ENGINE=MyISAM
slave-bin.000002 # Query # # BEGIN
slave-bin.000002 # Table_map # # table_id: # (test.t2)
diff --git a/mysql-test/suite/rpl/r/rpl_row_log_innodb.result b/mysql-test/suite/rpl/r/rpl_row_log_innodb.result
index 333836605d8..404d3e424e6 100644
--- a/mysql-test/suite/rpl/r/rpl_row_log_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_row_log_innodb.result
@@ -205,6 +205,7 @@ master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Rotate # # master-bin.000002;pos=POS
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000002 # Binlog_checkpoint # # master-bin.000002
master-bin.000002 # Query # # use `test`; create table t3 (a int)ENGINE=InnoDB
master-bin.000002 # Query # # use `test`; create table t2 (n int)ENGINE=InnoDB
master-bin.000002 # Query # # BEGIN
@@ -236,6 +237,7 @@ slave-bin.000001 # Query # # use `test`; create table t3 (a int)ENGINE=InnoDB
slave-bin.000001 # Rotate # # slave-bin.000002;pos=POS
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000002 # Binlog_checkpoint # # slave-bin.000002
slave-bin.000002 # Query # # use `test`; create table t2 (n int)ENGINE=InnoDB
slave-bin.000002 # Query # # BEGIN
slave-bin.000002 # Table_map # # table_id: # (test.t2)
diff --git a/mysql-test/suite/rpl/r/rpl_row_max_relay_size.result b/mysql-test/suite/rpl/r/rpl_row_max_relay_size.result
index 379cea4d3fc..88d68bb50ee 100644
--- a/mysql-test/suite/rpl/r/rpl_row_max_relay_size.result
+++ b/mysql-test/suite/rpl/r/rpl_row_max_relay_size.result
@@ -10,7 +10,7 @@ reset slave;
#
# Test 1
#
-set @my_max_binlog_size= @@global.max_binlog_size;
+set @my_max_binlog_size= @@global.max_binlog_size, @my_max_relay_log_size=@@global.max_relay_log_size;
set global max_binlog_size=8192;
set global max_relay_log_size=8192-1;
Warnings:
@@ -36,8 +36,10 @@ include/check_slave_is_running.inc
stop slave;
reset slave;
set global max_relay_log_size=0;
+Warnings:
+Warning 1292 Truncated incorrect max_relay_log_size value: '0'
select @@global.max_relay_log_size;
-@@global.max_relay_log_size 0
+@@global.max_relay_log_size 4096
start slave;
include/check_slave_is_running.inc
#
@@ -65,6 +67,7 @@ show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000002 # <Binlog_Do_DB> <Binlog_Ignore_DB>
set global max_binlog_size= @my_max_binlog_size;
+set global max_relay_log_size= @my_max_relay_log_size;
#
# End of 4.1 tests
#
diff --git a/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result b/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result
index 9e3577e1d5c..1a4d5c7574d 100644
--- a/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result
+++ b/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result
@@ -154,7 +154,7 @@ c1 c3 c4 c5
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-use test/*!*/;
+use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@@ -176,7 +176,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-use test/*!*/;
+use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@@ -287,7 +287,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-use test/*!*/;
+use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@@ -318,7 +318,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-use test/*!*/;
+use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
diff --git a/mysql-test/suite/rpl/r/rpl_row_show_relaylog_events.result b/mysql-test/suite/rpl/r/rpl_row_show_relaylog_events.result
index 88812786948..e186fabfff3 100644
--- a/mysql-test/suite/rpl/r/rpl_row_show_relaylog_events.result
+++ b/mysql-test/suite/rpl/r/rpl_row_show_relaylog_events.result
@@ -92,48 +92,52 @@ slave-bin.000001 # Query # # COMMIT
******** [slave] SHOW RELAYLOG EVENTS IN <FILE> ********
include/show_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
-slave-relay-bin.000003 # Rotate # # master-bin.000001;pos=POS
-slave-relay-bin.000003 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
-slave-relay-bin.000003 # Query # # use `test`; CREATE TABLE t1 (a INT)
-slave-relay-bin.000003 # Query # # BEGIN
-slave-relay-bin.000003 # Table_map # # table_id: # (test.t1)
-slave-relay-bin.000003 # Write_rows # # table_id: # flags: STMT_END_F
-slave-relay-bin.000003 # Query # # COMMIT
-slave-relay-bin.000003 # Query # # BEGIN
-slave-relay-bin.000003 # Table_map # # table_id: # (test.t1)
-slave-relay-bin.000003 # Write_rows # # table_id: # flags: STMT_END_F
-slave-relay-bin.000003 # Query # # COMMIT
-slave-relay-bin.000003 # Query # # BEGIN
-slave-relay-bin.000003 # Table_map # # table_id: # (test.t1)
-slave-relay-bin.000003 # Write_rows # # table_id: # flags: STMT_END_F
-slave-relay-bin.000003 # Query # # COMMIT
+slave-relay-bin.000002 # Rotate # # master-bin.000001;pos=POS
+slave-relay-bin.000002 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
+slave-relay-bin.000002 # Binlog_checkpoint # # master-bin.000001
+slave-relay-bin.000002 # Query # # use `test`; CREATE TABLE t1 (a INT)
+slave-relay-bin.000002 # Query # # BEGIN
+slave-relay-bin.000002 # Table_map # # table_id: # (test.t1)
+slave-relay-bin.000002 # Write_rows # # table_id: # flags: STMT_END_F
+slave-relay-bin.000002 # Query # # COMMIT
+slave-relay-bin.000002 # Query # # BEGIN
+slave-relay-bin.000002 # Table_map # # table_id: # (test.t1)
+slave-relay-bin.000002 # Write_rows # # table_id: # flags: STMT_END_F
+slave-relay-bin.000002 # Query # # COMMIT
+slave-relay-bin.000002 # Query # # BEGIN
+slave-relay-bin.000002 # Table_map # # table_id: # (test.t1)
+slave-relay-bin.000002 # Write_rows # # table_id: # flags: STMT_END_F
+slave-relay-bin.000002 # Query # # COMMIT
******** [slave] SHOW RELAYLOG EVENTS IN <FILE> LIMIT 1 ********
include/show_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
-slave-relay-bin.000003 # Rotate # # master-bin.000001;pos=POS
+slave-relay-bin.000002 # Rotate # # master-bin.000001;pos=POS
******** [slave] SHOW RELAYLOG EVENTS IN <FILE> LIMIT 1,3 ********
include/show_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
-slave-relay-bin.000003 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
-slave-relay-bin.000003 # Query # # use `test`; CREATE TABLE t1 (a INT)
-slave-relay-bin.000003 # Query # # BEGIN
+slave-relay-bin.000002 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
+slave-relay-bin.000002 # Binlog_checkpoint # # master-bin.000001
+slave-relay-bin.000002 # Query # # use `test`; CREATE TABLE t1 (a INT)
******** [slave] SHOW RELAYLOG EVENTS ********
include/show_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
-slave-relay-bin.000002 # Rotate # # slave-relay-bin.000003;pos=POS
+slave-relay-bin.000001 # Rotate # # slave-relay-bin.000002;pos=POS
FLUSH LOGS;
FLUSH LOGS;
DROP TABLE t1;
******** [master] SHOW BINLOG EVENTS IN <FILE> ********
include/show_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000002 # Binlog_checkpoint # # master-bin.000002
master-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
******** [master] SHOW BINLOG EVENTS IN <FILE> LIMIT 1 ********
include/show_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
+master-bin.000002 # Binlog_checkpoint # # master-bin.000002
******** [master] SHOW BINLOG EVENTS IN <FILE> LIMIT 1,3 ********
include/show_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
******** [master] SHOW BINLOG EVENTS ********
include/show_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
@@ -154,13 +158,16 @@ master-bin.000001 # Rotate # # master-bin.000002;pos=POS
******** [slave] SHOW BINLOG EVENTS IN <FILE> ********
include/show_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000002 # Binlog_checkpoint # # slave-bin.000002
slave-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
******** [slave] SHOW BINLOG EVENTS IN <FILE> LIMIT 1 ********
include/show_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
-slave-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
+slave-bin.000002 # Binlog_checkpoint # # slave-bin.000002
******** [slave] SHOW BINLOG EVENTS IN <FILE> LIMIT 1,3 ********
include/show_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
******** [slave] SHOW BINLOG EVENTS ********
include/show_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
@@ -181,21 +188,24 @@ slave-bin.000001 # Rotate # # slave-bin.000002;pos=POS
******** [slave] SHOW RELAYLOG EVENTS IN <FILE> ********
include/show_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
-slave-relay-bin.000006 # Rotate # # master-bin.000002;pos=POS
-slave-relay-bin.000006 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
-slave-relay-bin.000006 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
+slave-relay-bin.000005 # Rotate # # master-bin.000002;pos=POS
+slave-relay-bin.000005 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
+slave-relay-bin.000005 # Binlog_checkpoint # # master-bin.000001
+slave-relay-bin.000005 # Binlog_checkpoint # # master-bin.000002
+slave-relay-bin.000005 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
******** [slave] SHOW RELAYLOG EVENTS IN <FILE> LIMIT 1 ********
include/show_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
-slave-relay-bin.000006 # Rotate # # master-bin.000002;pos=POS
+slave-relay-bin.000005 # Rotate # # master-bin.000002;pos=POS
******** [slave] SHOW RELAYLOG EVENTS IN <FILE> LIMIT 1,3 ********
include/show_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
-slave-relay-bin.000006 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
-slave-relay-bin.000006 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
+slave-relay-bin.000005 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
+slave-relay-bin.000005 # Binlog_checkpoint # # master-bin.000001
+slave-relay-bin.000005 # Binlog_checkpoint # # master-bin.000002
******** [slave] SHOW RELAYLOG EVENTS ********
include/show_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
-slave-relay-bin.000005 # Rotate # # master-bin.000002;pos=POS
-slave-relay-bin.000005 # Rotate # # slave-relay-bin.000006;pos=POS
+slave-relay-bin.000004 # Rotate # # master-bin.000002;pos=POS
+slave-relay-bin.000004 # Rotate # # slave-relay-bin.000005;pos=POS
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_skip_replication.result b/mysql-test/suite/rpl/r/rpl_skip_replication.result
index c19f9009021..92b5fa5f629 100644
--- a/mysql-test/suite/rpl/r/rpl_skip_replication.result
+++ b/mysql-test/suite/rpl/r/rpl_skip_replication.result
@@ -10,7 +10,7 @@ SELECT @@global.replicate_events_marked_for_skip;
@@global.replicate_events_marked_for_skip
replicate
SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_SLAVE;
-ERROR HY000: This operation cannot be performed with a running slave; run STOP SLAVE first
+ERROR HY000: This operation cannot be performed as you have a running slave ''; run STOP SLAVE '' first
SELECT @@global.replicate_events_marked_for_skip;
@@global.replicate_events_marked_for_skip
replicate
diff --git a/mysql-test/suite/rpl/r/rpl_sp.result b/mysql-test/suite/rpl/r/rpl_sp.result
index 331c1e91bd9..c2d3f5ce212 100644
--- a/mysql-test/suite/rpl/r/rpl_sp.result
+++ b/mysql-test/suite/rpl/r/rpl_sp.result
@@ -670,7 +670,7 @@ drop database if exists mysqltest1
SET TIMESTAMP=t/*!*/;
create database mysqltest1
/*!*/;
-use mysqltest1/*!*/;
+use `mysqltest1`/*!*/;
SET TIMESTAMP=t/*!*/;
create table t1 (a varchar(100))
/*!*/;
@@ -1015,7 +1015,7 @@ drop database mysqltest1
SET TIMESTAMP=t/*!*/;
drop user "zedjzlcsjhd"@127.0.0.1
/*!*/;
-use test/*!*/;
+use `test`/*!*/;
SET TIMESTAMP=t/*!*/;
drop function if exists f1
/*!*/;
@@ -1112,7 +1112,7 @@ create database mysqltest
SET TIMESTAMP=t/*!*/;
create database mysqltest2
/*!*/;
-use mysqltest2/*!*/;
+use `mysqltest2`/*!*/;
SET TIMESTAMP=t/*!*/;
create table t ( t integer )
/*!*/;
@@ -1139,7 +1139,7 @@ end
SET TIMESTAMP=t/*!*/;
BEGIN
/*!*/;
-use mysqltest/*!*/;
+use `mysqltest`/*!*/;
SET TIMESTAMP=t/*!*/;
SELECT `mysqltest2`.`f1`()
/*!*/;
@@ -1152,14 +1152,14 @@ drop database mysqltest
SET TIMESTAMP=t/*!*/;
drop database mysqltest2
/*!*/;
-use test/*!*/;
+use `test`/*!*/;
SET TIMESTAMP=t/*!*/;
CREATE DEFINER=`root`@`localhost` PROCEDURE `mysqltestbug36570_p1`()
begin
select 1;
end
/*!*/;
-use mysql/*!*/;
+use `mysql`/*!*/;
SET TIMESTAMP=t/*!*/;
CREATE DEFINER=`root`@`localhost` PROCEDURE `test`.` mysqltestbug36570_p2`( a int)
`label`:
diff --git a/mysql-test/suite/rpl/r/rpl_stm_log.result b/mysql-test/suite/rpl/r/rpl_stm_log.result
index 6dc199f9295..35b1438bade 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_log.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_log.result
@@ -205,6 +205,7 @@ master-bin.000001 # Query # # COMMIT
master-bin.000001 # Rotate # # master-bin.000002;pos=POS
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000002 # Binlog_checkpoint # # master-bin.000002
master-bin.000002 # Query # # use `test`; create table t3 (a int)ENGINE=MyISAM
master-bin.000002 # Query # # use `test`; create table t2 (n int)ENGINE=MyISAM
master-bin.000002 # Query # # BEGIN
@@ -235,6 +236,7 @@ slave-bin.000001 # Query # # use `test`; create table t3 (a int)ENGINE=MyISAM
slave-bin.000001 # Rotate # # slave-bin.000002;pos=POS
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000002 # Binlog_checkpoint # # slave-bin.000002
slave-bin.000002 # Query # # use `test`; create table t2 (n int)ENGINE=MyISAM
slave-bin.000002 # Query # # BEGIN
slave-bin.000002 # Query # # use `test`; insert into t2 values (1)
diff --git a/mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result b/mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result
index 379cea4d3fc..88d68bb50ee 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result
@@ -10,7 +10,7 @@ reset slave;
#
# Test 1
#
-set @my_max_binlog_size= @@global.max_binlog_size;
+set @my_max_binlog_size= @@global.max_binlog_size, @my_max_relay_log_size=@@global.max_relay_log_size;
set global max_binlog_size=8192;
set global max_relay_log_size=8192-1;
Warnings:
@@ -36,8 +36,10 @@ include/check_slave_is_running.inc
stop slave;
reset slave;
set global max_relay_log_size=0;
+Warnings:
+Warning 1292 Truncated incorrect max_relay_log_size value: '0'
select @@global.max_relay_log_size;
-@@global.max_relay_log_size 0
+@@global.max_relay_log_size 4096
start slave;
include/check_slave_is_running.inc
#
@@ -65,6 +67,7 @@ show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000002 # <Binlog_Do_DB> <Binlog_Ignore_DB>
set global max_binlog_size= @my_max_binlog_size;
+set global max_relay_log_size= @my_max_relay_log_size;
#
# End of 4.1 tests
#
diff --git a/mysql-test/suite/rpl/r/rpl_stm_mix_show_relaylog_events.result b/mysql-test/suite/rpl/r/rpl_stm_mix_show_relaylog_events.result
index 7a4a324e580..a722f91e2e7 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_mix_show_relaylog_events.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_mix_show_relaylog_events.result
@@ -80,45 +80,49 @@ slave-bin.000001 # Query # # COMMIT
******** [slave] SHOW RELAYLOG EVENTS IN <FILE> ********
include/show_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
-slave-relay-bin.000003 # Rotate # # master-bin.000001;pos=POS
-slave-relay-bin.000003 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
-slave-relay-bin.000003 # Query # # use `test`; CREATE TABLE t1 (a INT)
-slave-relay-bin.000003 # Query # # BEGIN
-slave-relay-bin.000003 # Query # # use `test`; INSERT INTO t1 VALUES (1)
-slave-relay-bin.000003 # Query # # COMMIT
-slave-relay-bin.000003 # Query # # BEGIN
-slave-relay-bin.000003 # Query # # use `test`; INSERT INTO t1 VALUES (2)
-slave-relay-bin.000003 # Query # # COMMIT
-slave-relay-bin.000003 # Query # # BEGIN
-slave-relay-bin.000003 # Query # # use `test`; INSERT INTO t1 VALUES (3)
-slave-relay-bin.000003 # Query # # COMMIT
+slave-relay-bin.000002 # Rotate # # master-bin.000001;pos=POS
+slave-relay-bin.000002 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
+slave-relay-bin.000002 # Binlog_checkpoint # # master-bin.000001
+slave-relay-bin.000002 # Query # # use `test`; CREATE TABLE t1 (a INT)
+slave-relay-bin.000002 # Query # # BEGIN
+slave-relay-bin.000002 # Query # # use `test`; INSERT INTO t1 VALUES (1)
+slave-relay-bin.000002 # Query # # COMMIT
+slave-relay-bin.000002 # Query # # BEGIN
+slave-relay-bin.000002 # Query # # use `test`; INSERT INTO t1 VALUES (2)
+slave-relay-bin.000002 # Query # # COMMIT
+slave-relay-bin.000002 # Query # # BEGIN
+slave-relay-bin.000002 # Query # # use `test`; INSERT INTO t1 VALUES (3)
+slave-relay-bin.000002 # Query # # COMMIT
******** [slave] SHOW RELAYLOG EVENTS IN <FILE> LIMIT 1 ********
include/show_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
-slave-relay-bin.000003 # Rotate # # master-bin.000001;pos=POS
+slave-relay-bin.000002 # Rotate # # master-bin.000001;pos=POS
******** [slave] SHOW RELAYLOG EVENTS IN <FILE> LIMIT 1,3 ********
include/show_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
-slave-relay-bin.000003 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
-slave-relay-bin.000003 # Query # # use `test`; CREATE TABLE t1 (a INT)
-slave-relay-bin.000003 # Query # # BEGIN
+slave-relay-bin.000002 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
+slave-relay-bin.000002 # Binlog_checkpoint # # master-bin.000001
+slave-relay-bin.000002 # Query # # use `test`; CREATE TABLE t1 (a INT)
******** [slave] SHOW RELAYLOG EVENTS ********
include/show_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
-slave-relay-bin.000002 # Rotate # # slave-relay-bin.000003;pos=POS
+slave-relay-bin.000001 # Rotate # # slave-relay-bin.000002;pos=POS
FLUSH LOGS;
FLUSH LOGS;
DROP TABLE t1;
******** [master] SHOW BINLOG EVENTS IN <FILE> ********
include/show_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000002 # Binlog_checkpoint # # master-bin.000002
master-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
******** [master] SHOW BINLOG EVENTS IN <FILE> LIMIT 1 ********
include/show_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
+master-bin.000002 # Binlog_checkpoint # # master-bin.000002
******** [master] SHOW BINLOG EVENTS IN <FILE> LIMIT 1,3 ********
include/show_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
******** [master] SHOW BINLOG EVENTS ********
include/show_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
@@ -136,13 +140,16 @@ master-bin.000001 # Rotate # # master-bin.000002;pos=POS
******** [slave] SHOW BINLOG EVENTS IN <FILE> ********
include/show_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000002 # Binlog_checkpoint # # slave-bin.000002
slave-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
******** [slave] SHOW BINLOG EVENTS IN <FILE> LIMIT 1 ********
include/show_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
-slave-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
+slave-bin.000002 # Binlog_checkpoint # # slave-bin.000002
******** [slave] SHOW BINLOG EVENTS IN <FILE> LIMIT 1,3 ********
include/show_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+slave-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
******** [slave] SHOW BINLOG EVENTS ********
include/show_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
@@ -160,21 +167,24 @@ slave-bin.000001 # Rotate # # slave-bin.000002;pos=POS
******** [slave] SHOW RELAYLOG EVENTS IN <FILE> ********
include/show_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
-slave-relay-bin.000006 # Rotate # # master-bin.000002;pos=POS
-slave-relay-bin.000006 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
-slave-relay-bin.000006 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
+slave-relay-bin.000005 # Rotate # # master-bin.000002;pos=POS
+slave-relay-bin.000005 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
+slave-relay-bin.000005 # Binlog_checkpoint # # master-bin.000001
+slave-relay-bin.000005 # Binlog_checkpoint # # master-bin.000002
+slave-relay-bin.000005 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
******** [slave] SHOW RELAYLOG EVENTS IN <FILE> LIMIT 1 ********
include/show_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
-slave-relay-bin.000006 # Rotate # # master-bin.000002;pos=POS
+slave-relay-bin.000005 # Rotate # # master-bin.000002;pos=POS
******** [slave] SHOW RELAYLOG EVENTS IN <FILE> LIMIT 1,3 ********
include/show_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
-slave-relay-bin.000006 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
-slave-relay-bin.000006 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
+slave-relay-bin.000005 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
+slave-relay-bin.000005 # Binlog_checkpoint # # master-bin.000001
+slave-relay-bin.000005 # Binlog_checkpoint # # master-bin.000002
******** [slave] SHOW RELAYLOG EVENTS ********
include/show_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
-slave-relay-bin.000005 # Rotate # # master-bin.000002;pos=POS
-slave-relay-bin.000005 # Rotate # # slave-relay-bin.000006;pos=POS
+slave-relay-bin.000004 # Rotate # # master-bin.000002;pos=POS
+slave-relay-bin.000004 # Rotate # # slave-relay-bin.000005;pos=POS
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_trigger.result b/mysql-test/suite/rpl/r/rpl_trigger.result
index 784cd1bcdff..ac6d9155f4b 100644
--- a/mysql-test/suite/rpl/r/rpl_trigger.result
+++ b/mysql-test/suite/rpl/r/rpl_trigger.result
@@ -4,7 +4,7 @@ DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
DROP TABLE IF EXISTS t3;
create table t1 (a int auto_increment, primary key (a), b int, rand_value double not null);
-create table t2 (a int auto_increment, primary key (a), b int);
+create table t2 (a int auto_increment, primary key (a), b int) engine=innodb;
create table t3 (a int auto_increment, primary key (a), name varchar(64) not null, old_a int, old_b int, rand_value double not null);
create trigger t1 before insert on t1 for each row
begin
@@ -29,7 +29,7 @@ a b
1 2
3 0
4 0
-5 0
+6 0
500 0
select a,name, old_a, old_b, truncate(rand_value,4) from t3;
a name old_a old_b truncate(rand_value,4)
@@ -39,7 +39,7 @@ a name old_a old_b truncate(rand_value,4)
103 t2 1 2 0.9164
104 t2 3 0 0.8826
105 t2 4 0 0.6635
-106 t2 5 0 0.6699
+106 t2 6 0 0.6699
107 t2 500 0 0.3593
--- On slave --
@@ -52,7 +52,7 @@ a b
1 2
3 0
4 0
-5 0
+6 0
500 0
select a,name, old_a, old_b, truncate(rand_value,4) from t3;
a name old_a old_b truncate(rand_value,4)
@@ -62,7 +62,7 @@ a name old_a old_b truncate(rand_value,4)
103 t2 1 2 0.9164
104 t2 3 0 0.8826
105 t2 4 0 0.6635
-106 t2 5 0 0.6699
+106 t2 6 0 0.6699
107 t2 500 0 0.3593
drop table t1,t2,t3;
select get_lock("bug12480",2);
diff --git a/mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test b/mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test
index b62a6e96437..3572dd53ea7 100644
--- a/mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test
+++ b/mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test
@@ -215,21 +215,23 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
# be filtered as well.
#
connection master;
-CREATE TABLE test.t5 (a INT AUTO_INCREMENT PRIMARY KEY, b INT, c INT); # ignored on slave
+# Although RAND() is from 0 to 1.0, DECIMAL(M,D), requires that M must be >= D.
+CREATE TABLE test.t5 (a INT AUTO_INCREMENT PRIMARY KEY, b DECIMAL(20,20), c INT); # ignored on slave
CREATE TABLE test.t1 (a INT); # accepted on slave
INSERT INTO test.t1 VALUES(1);
--sync_slave_with_master
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
-CREATE TABLE test.t_slave (a INT AUTO_INCREMENT PRIMARY KEY, b INT, c INT);
+# Although RAND() is from 0 to 1.0, DECIMAL(M,D), requires that M must be >= D.
+CREATE TABLE test.t_slave (a INT AUTO_INCREMENT PRIMARY KEY, b DECIMAL(20,20), c INT);
CREATE TRIGGER t1_update AFTER UPDATE ON test.t1 FOR EACH ROW
- INSERT INTO test.t_slave VALUES(NULL, ROUND(RAND() * 1000), @c);
+ INSERT INTO test.t_slave VALUES(NULL, RAND(), @c);
connection master;
SET INSERT_ID=2;
SET @c=2;
SET @@rand_seed1=10000000, @@rand_seed2=1000000;
-INSERT INTO t5 VALUES (NULL, ROUND(RAND() * 1000), @c); # to be ignored
+INSERT INTO t5 VALUES (NULL, RAND(), @c); # to be ignored
SELECT b into @b FROM test.t5;
--let $b_master=`select @b`
UPDATE test.t1 SET a=2; # to run trigger on slave
@@ -253,10 +255,9 @@ if (`SELECT @a != 2 and @c != NULL`)
SELECT b into @b FROM test.t_slave;
--let $b_slave=`select @b`
-if (`SELECT $b_slave = $b_master`)
-{
- --echo Might be pure coincidence of two randoms from master and slave table. Don not panic yet.
-}
+--let $assert_text= Random values from master and slave must be different
+--let $assert_cond= $b_master != $b_slave
+--source include/assert.inc
# cleanup BUG#11754117
connection master;
diff --git a/mysql-test/suite/rpl/t/rpl_flush_logs.test b/mysql-test/suite/rpl/t/rpl_flush_logs.test
index 6e9de634157..1d19576d47c 100644
--- a/mysql-test/suite/rpl/t/rpl_flush_logs.test
+++ b/mysql-test/suite/rpl/t/rpl_flush_logs.test
@@ -31,8 +31,9 @@ connection master;
flush relay logs;
sync_slave_with_master;
---echo # Check the 'slave-relay-bin.000003' file is created
+--echo # Check the 'slave-relay-bin.000003' file is not created
--echo # after executed 'flush relay logs' statement.
+--error 1
file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000003;
connection master;
@@ -89,10 +90,10 @@ file_exists $MYSQLTEST_VARDIR/mysqld.1/data/master-bin.000001;
# Test 'flush error logs, relay logs' statement
sync_slave_with_master;
---echo # Make sure the 'slave-relay-bin.000006' file does not exist
+--echo # Make sure the 'slave-relay-bin.000005' file does not exist
--echo # exist before execute 'flush error logs, relay logs' statement.
--error 1
-file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000006;
+file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000005;
connection master;
@@ -107,19 +108,18 @@ file_exists $MYSQLTEST_VARDIR/tmp/master_log.err;
file_exists $MYSQLTEST_VARDIR/mysqld.1/data/master-bin.000003;
sync_slave_with_master;
---echo # Check the 'slave-relay-bin.000006' file is created after
+--echo # Check the 'slave-relay-bin.000004' file is created after
--echo # execute 'flush error logs, relay logs' statement.
-file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000006;
-
+file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000004;
# Test 'flush logs' statement
---echo # Make sure the 'slave-relay-bin.000007' and 'slave-relay-bin.000008'
+--echo # Make sure the 'slave-relay-bin.000005' and 'slave-relay-bin.000006'
--echo # files do not exist before execute 'flush error logs, relay logs'
--echo # statement.
--error 1
-file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000007;
+file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000005;
--error 1
-file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000008;
+file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000006;
connection master;
@@ -133,9 +133,9 @@ file_exists $MYSQLTEST_VARDIR/tmp/master_log.err;
file_exists $MYSQLTEST_VARDIR/mysqld.1/data/master-bin.000003;
sync_slave_with_master;
---echo # Check the 'slave-relay-bin.000007' and 'slave-relay-bin.000008'
+--echo # Check the 'slave-relay-bin.000005' and 'slave-relay-bin.000006'
--echo # files are created after execute 'flush logs' statement.
-file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000007;
-file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000008;
+file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000005;
+file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000006;
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_mariadb_slave_capability.test b/mysql-test/suite/rpl/t/rpl_mariadb_slave_capability.test
new file mode 100644
index 00000000000..251136a2fe1
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_mariadb_slave_capability.test
@@ -0,0 +1,104 @@
+--source include/master-slave.inc
+--source include/have_debug.inc
+--source include/have_binlog_format_row.inc
+
+connection master;
+
+set @old_master_binlog_checksum= @@global.binlog_checksum;
+set @old_slave_dbug= @@global.debug_dbug;
+CREATE TABLE t1 (a INT PRIMARY KEY);
+INSERT INTO t1 VALUES (0);
+
+sync_slave_with_master;
+connection slave;
+
+--echo # Test slave with no capability gets dummy event, which is ignored.
+--source include/stop_slave.inc
+SET @@global.debug_dbug='+d,simulate_slave_capability_none';
+--source include/start_slave.inc
+connection master;
+# Add a dummy event just to have something to sync_slave_with_master on.
+# Otherwise we occasionally get different $relaylog_start, depending on
+# whether Format_description_log_event was written to relay log or not
+# at the time of SHOW SLAVE STATUS.
+ALTER TABLE t1 ORDER BY a;
+sync_slave_with_master;
+connection slave;
+let $relaylog_start= query_get_value(SHOW SLAVE STATUS, Relay_Log_Pos, 1);
+
+connection master;
+SET SESSION binlog_annotate_row_events = ON;
+let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
+let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
+# A short event, to test when we need to use user_var_event for dummy event.
+DELETE FROM t1;
+INSERT INTO t1 /* A comment just to make the annotate event sufficiently long that the dummy event will need to get padded with spaces so that we can test that this works */ VALUES(1);
+let $binlog_limit= 0, 10;
+--source include/show_binlog_events.inc
+sync_slave_with_master;
+connection slave;
+
+SELECT * FROM t1;
+let $binlog_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1);
+let $binlog_start= $relaylog_start;
+let $binlog_limit=0,10;
+--source include/show_relaylog_events.inc
+set @@global.debug_dbug= @old_slave_dbug;
+
+--echo # Test dummy event is checksummed correctly.
+
+connection master;
+set @@global.binlog_checksum = CRC32;
+TRUNCATE t1;
+let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
+let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
+INSERT INTO t1 VALUES(2);
+let $binlog_limit= 0, 5;
+--source include/show_binlog_events.inc
+sync_slave_with_master;
+connection slave;
+
+SELECT * FROM t1;
+let $binlog_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1);
+let $binlog_start= 0;
+let $binlog_limit=5,5;
+--source include/show_relaylog_events.inc
+
+--echo # Test that slave which cannot tolerate holes in binlog stream but
+--echo # knows the event does not get dummy event
+
+--source include/stop_slave.inc
+SET @@global.debug_dbug='+d,simulate_slave_capability_old_53';
+--source include/start_slave.inc
+connection master;
+ALTER TABLE t1 ORDER BY a;
+sync_slave_with_master;
+connection slave;
+let $relaylog_start= query_get_value(SHOW SLAVE STATUS, Relay_Log_Pos, 1);
+
+connection master;
+let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1);
+let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
+UPDATE t1 SET a = 3;
+let $binlog_limit= 0, 5;
+--source include/show_binlog_events.inc
+sync_slave_with_master;
+connection slave;
+
+SELECT * FROM t1;
+let $binlog_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1);
+let $binlog_start= $relaylog_start;
+let $binlog_limit=0,5;
+--source include/show_relaylog_events.inc
+
+select @@global.log_slave_updates;
+select @@global.replicate_annotate_row_events;
+
+set @@global.debug_dbug= @old_slave_dbug;
+
+--echo Clean up.
+connection master;
+set @@global.binlog_checksum = @old_master_binlog_checksum;
+DROP TABLE t1;
+sync_slave_with_master;
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_mdev382.test b/mysql-test/suite/rpl/t/rpl_mdev382.test
new file mode 100644
index 00000000000..5df382f6f06
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_mdev382.test
@@ -0,0 +1,265 @@
+--source include/have_innodb.inc
+--source include/have_binlog_format_statement.inc
+--source include/master-slave.inc
+
+# MDEV-382: multiple SQL injections in replication code.
+
+# Test previous SQL injection attack against binlog for SAVEPOINT statement.
+# The test would cause syntax error on slave due to improper quoting of
+# the savepoint name.
+connection master;
+create table t1 (a int primary key) engine=innodb;
+create table t2 (a int primary key) engine=myisam;
+
+begin;
+insert into t1 values (1);
+SET sql_mode = 'ANSI_QUOTES';
+savepoint `a``; create database couldbebadthingshere; savepoint ``dummy`;
+insert into t1 values (2);
+insert into t2 values (1);
+SET sql_mode = '';
+rollback to savepoint `a``; create database couldbebadthingshere; savepoint ``dummy`;
+insert into t1 values (3);
+commit;
+
+--source include/show_binlog_events2.inc
+
+# This failed due to syntax error in query when the bug was not fixed.
+sync_slave_with_master;
+connection slave;
+
+# Test some more combinations of ANSI_QUOTES and sql_quote_show_create
+connection master;
+let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
+BEGIN;
+insert into t1 values(10);
+set sql_mode = 'ANSI_QUOTES';
+set sql_quote_show_create = 1;
+savepoint a;
+insert into t1 values(11);
+savepoint "a""a";
+insert into t1 values(12);
+set sql_quote_show_create = 0;
+savepoint b;
+insert into t1 values(13);
+savepoint "b""b";
+insert into t1 values(14);
+set sql_mode = '';
+set sql_quote_show_create = 1;
+savepoint c;
+insert into t1 values(15);
+savepoint `c``c`;
+insert into t1 values(16);
+set sql_quote_show_create = 0;
+savepoint d;
+insert into t1 values(17);
+savepoint `d``d`;
+insert into t1 values(18);
+COMMIT;
+set sql_quote_show_create = 1;
+
+--source include/show_binlog_events2.inc
+
+--echo *** Test correct USE statement in SHOW BINLOG EVENTS ***
+connection master;
+let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
+set sql_mode = 'ANSI_QUOTES';
+CREATE DATABASE "db1`; select 'oops!'";
+use "db1`; select 'oops!'";
+CREATE TABLE t1 (a INT PRIMARY KEY) engine=MyISAM;
+INSERT INTO t1 VALUES (1);
+set sql_mode = '';
+INSERT INTO t1 VALUES (2);
+set sql_mode = 'ANSI_QUOTES';
+--source include/show_binlog_events2.inc
+set sql_mode = '';
+set sql_quote_show_create = 0;
+--source include/show_binlog_events2.inc
+set sql_quote_show_create = 1;
+--source include/show_binlog_events2.inc
+DROP TABLE t1;
+
+use test;
+
+--echo ***Test LOAD DATA INFILE with various identifiers that need correct quoting ***
+
+--let $load_file= $MYSQLTEST_VARDIR/tmp/f'le.txt
+--write_file $load_file
+'fo\\o','bar'
+EOF
+
+use `db1``; select 'oops!'`;
+let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
+set timestamp=1000000000;
+CREATE TABLE `t``1` (`a``1` VARCHAR(4) PRIMARY KEY, `b``2` VARCHAR(3),
+ `c``3` VARCHAR(7));
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/f''le.txt' INTO TABLE `t``1`
+ FIELDS TERMINATED BY ',' ESCAPED BY '\\\\' ENCLOSED BY ''''
+ LINES TERMINATED BY '\\n'
+ (`a``1`, @`b```) SET `b``2` = @`b```, `c``3` = concat('|', "b""a'z", "!");
+
+SELECT * FROM `t``1`;
+# Also test when code prefixes table name with database.
+truncate `t``1`;
+use test;
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/f''le.txt'
+ INTO TABLE `db1``; select 'oops!'`.`t``1`
+ FIELDS TERMINATED BY ',' ESCAPED BY '\\\\' ENCLOSED BY ''''
+ LINES TERMINATED BY '\\n'
+ (`a``1`, `b``2`) SET `c``3` = concat('|', "b""a'z", "!");
+SELECT * FROM `db1``; select 'oops!'`.`t``1`;
+let $pos2= query_get_value(SHOW MASTER STATUS, Position, 1);
+
+--source include/show_binlog_events2.inc
+let $MYSQLD_DATADIR= `select @@datadir`;
+--replace_regex /LOCAL INFILE '.*SQL_LOAD.*' INTO/LOCAL INFILE '<name>' INTO/
+--exec $MYSQL_BINLOG --short-form --start-position=$binlog_start --stop-position=$pos2 $MYSQLD_DATADIR/master-bin.000001
+
+sync_slave_with_master;
+connection slave;
+SELECT * FROM `db1``; select 'oops!'`.`t``1`;
+connection master;
+
+DROP TABLE `db1``; select 'oops!'`.`t``1`;
+--remove_file $load_file
+
+connection master;
+drop table t1,t2;
+
+
+--echo *** Test truncation of long SET expression in LOAD DATA ***
+CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(1000));
+--let $load_file= $MYSQLTEST_VARDIR/tmp/file.txt
+--write_file $load_file
+1,X
+2,A
+EOF
+
+let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
+# The bug was that the SET expression was truncated to 256 bytes, so test with
+# an expression longer than that.
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval LOAD DATA INFILE '$load_file' INTO TABLE t1
+ FIELDS TERMINATED BY ','
+ (a, @b) SET b = CONCAT(@b, '| 123456789A123456789B123456789C123456789D123456789E123456789F123456789G123456789H123456789I123456789J123456789K123456789L123456789M123456789N123456789O123456789P123456789Q123456789R123456789123456789T123456789U123456789V123456789W123456789X123456789Y123456789Z123456789|', @b);
+
+SELECT * FROM t1 ORDER BY a;
+--source include/show_binlog_events2.inc
+
+sync_slave_with_master;
+connection slave;
+SELECT * FROM t1 ORDER BY a;
+
+connection master;
+--remove_file $load_file
+DROP TABLE t1;
+
+
+--echo *** Test user variables whose names require correct quoting ***
+use `db1``; select 'oops!'`;
+let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
+CREATE TABLE t1 (a1 BIGINT PRIMARY KEY, a2 BIGINT, a3 BIGINT, a4 BIGINT UNSIGNED, b DOUBLE, c DECIMAL(65,10), d VARCHAR(100));
+INSERT INTO t1 VALUES (-9223372036854775808,42,9223372036854775807,18446744073709551615,-1234560123456789e110, -1234501234567890123456789012345678901234567890123456789.0123456789, REPEAT("x", 100));
+SELECT @`a``1`:=a1, @`a``2`:=a2, @`a``3`:=a3, @`a``4`:=a4, @`b```:=b, @```c`:=c, @```d```:=d FROM t1;
+INSERT INTO t1 VALUES (@`a``1`+1, @`a``2`*100, @`a``3`-1, @`a``4`-1, @`b```/2, @```c`, substr(@```d```, 2, 98));
+let $pos2= query_get_value(SHOW MASTER STATUS, Position, 1);
+
+--source include/show_binlog_events2.inc
+
+--exec $MYSQL_BINLOG --short-form --start-position=$binlog_start --stop-position=$pos2 $MYSQLD_DATADIR/master-bin.000001
+
+sync_slave_with_master;
+connection slave;
+SELECT * FROM `db1``; select 'oops!'`.t1 ORDER BY a1;
+
+connection master;
+DROP TABLE t1;
+
+--echo *** Test correct quoting in foreign key error message ***
+use `db1``; select 'oops!'`;
+CREATE TABLE `t``1` ( `a``` INT PRIMARY KEY) ENGINE=innodb;
+CREATE TABLE `t``2` ( `b``` INT PRIMARY KEY, `c``` INT NOT NULL,
+ FOREIGN KEY fk (`c```) REFERENCES `t``1`(`a```)) ENGINE=innodb;
+--replace_regex /t@[0-9]+_ibfk_[0-9]+/INNODB_FOREIGN_KEY_NAME/
+--error ER_TRUNCATE_ILLEGAL_FK
+TRUNCATE `t``1`;
+DROP TABLE `t``2`;
+DROP TABLE `t``1`;
+
+
+--echo *** Test correct quoting of DELETE FROM statement binlogged for HEAP table that is emptied due to server restart
+
+# Let's keep the slave stopped during master restart, to avoid any potential
+# races between slave reconnect and master restart.
+connection slave;
+--source include/stop_slave.inc
+
+connection master;
+CREATE TABLE `db1``; select 'oops!'`.`t``1` (`a``` INT PRIMARY KEY) ENGINE=heap;
+INSERT INTO `db1``; select 'oops!'`.`t``1` VALUES (1), (2), (5);
+SELECT * FROM `db1``; select 'oops!'`.`t``1` ORDER BY 1;
+
+# Restart the master mysqld.
+# This will cause an implicit truncation of the memory-based table, which will
+# cause logging of an explicit DELETE FROM to binlog.
+--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+wait-rpl_mdev382.test
+EOF
+
+--shutdown_server 30
+
+--remove_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+restart-rpl_mdev382.test
+EOF
+
+connection default;
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+# rpl_end.inc needs to use the connection server_1
+connection server_1;
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+connection master;
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+set timestamp=1000000000;
+
+--echo # The table should be empty on the master.
+let $binlog_file= master-bin.000002;
+let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
+SELECT * FROM `db1``; select 'oops!'`.`t``1`;
+
+--echo # The DELETE statement should be correctly quoted
+--source include/show_binlog_events2.inc
+
+connection slave;
+--source include/start_slave.inc
+
+connection master;
+sync_slave_with_master;
+connection slave;
+--echo # The table should be empty on the slave also.
+SELECT * FROM `db1``; select 'oops!'`.`t``1`;
+
+connection master;
+DROP TABLE `db1``; select 'oops!'`.`t``1`;
+sync_slave_with_master;
+
+
+connection master;
+use test;
+DROP DATABASE `db1``; select 'oops!'`;
+
+--echo *** Test correct quoting of mysqlbinlog --rewrite-db option ***
+CREATE TABLE t1 (a INT PRIMARY KEY);
+let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
+INSERT INTO t1 VALUES(1);
+--source include/show_binlog_events2.inc
+let $pos2= query_get_value(SHOW MASTER STATUS, Position, 1);
+--exec $MYSQL_BINLOG --short-form --start-position=$binlog_start --stop-position=$pos2 --rewrite-db='test->ts`et' $MYSQLD_DATADIR/master-bin.000002
+DROP TABLE t1;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_packet-slave.opt b/mysql-test/suite/rpl/t/rpl_packet-slave.opt
index 412bc079caa..1aed7d07572 100644
--- a/mysql-test/suite/rpl/t/rpl_packet-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_packet-slave.opt
@@ -1 +1 @@
---max_allowed_packet=1024 --net_buffer_length=1024
+--max_allowed_packet=1024 --net_buffer_length=1024 --slave_max_allowed_packet=1024
diff --git a/mysql-test/suite/rpl/t/rpl_packet.test b/mysql-test/suite/rpl/t/rpl_packet.test
index 4f296fed68e..c49d9490bd9 100644
--- a/mysql-test/suite/rpl/t/rpl_packet.test
+++ b/mysql-test/suite/rpl/t/rpl_packet.test
@@ -11,9 +11,8 @@
# max-out size db name
source include/master-slave.inc;
source include/have_binlog_format_row.inc;
-call mtr.add_suppression("Slave I/O: Got a packet bigger than 'max_allowed_packet' bytes, Error_code: 1153");
-call mtr.add_suppression("Slave I/O: Got fatal error 1236 from master when reading data from binary log:");
-
+call mtr.add_suppression("Slave I/O: Got a packet bigger than 'slave_max_allowed_packet' bytes, Error_code: 1153");
+call mtr.add_suppression("Log entry on master is longer than slave_max_allowed_packet");
let $db= DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
disable_warnings;
eval drop database if exists $db;
@@ -23,6 +22,7 @@ eval create database $db;
connection master;
let $old_max_allowed_packet= `SELECT @@global.max_allowed_packet`;
let $old_net_buffer_length= `SELECT @@global.net_buffer_length`;
+let $old_slave_max_allowed_packet= `SELECT @@global.slave_max_allowed_packet`;
SET @@global.max_allowed_packet=1024;
SET @@global.net_buffer_length=1024;
@@ -123,11 +123,9 @@ INSERT INTO t1(f1, f2, f3) VALUES(1, REPEAT('a', @@global.max_allowed_packet), R
connection slave;
# The slave I/O thread must stop after receiving
-# 1236=ER_MASTER_FATAL_ERROR_READING_BINLOG error message from master.
---let $slave_io_errno= 1236
-
-# Mask line numbers
---let $slave_io_error_replace= / at [0-9]*/ at XXX/
+# 1153 = ER_NET_PACKET_TOO_LARGE
+--let $slave_io_errno= 1153
+--let $show_slave_io_error= 1
--source include/wait_for_slave_io_error.inc
# Remove the bad binlog and clear error status on slave.
@@ -167,6 +165,7 @@ connection master;
DROP TABLE t1;
eval SET @@global.max_allowed_packet= $old_max_allowed_packet;
eval SET @@global.net_buffer_length= $old_net_buffer_length;
+eval SET @@global.slave_max_allowed_packet= $old_slave_max_allowed_packet;
# slave is stopped
connection slave;
DROP TABLE t1;
diff --git a/mysql-test/suite/rpl/t/rpl_start_stop_slave.test b/mysql-test/suite/rpl/t/rpl_start_stop_slave.test
index c9c8f043668..ab388f3eebc 100644
--- a/mysql-test/suite/rpl/t/rpl_start_stop_slave.test
+++ b/mysql-test/suite/rpl/t/rpl_start_stop_slave.test
@@ -21,6 +21,16 @@
connection slave;
--let $connection_id=`SELECT id FROM information_schema.processlist where state LIKE 'Waiting for master to send event'`
+if(!$connection_id)
+{
+ # Something went wrong (timing)
+ # Show process list so that we can debug. In this case we will abort with
+ # wrong result
+ -- echo "Could not find connect id. Dumping process list for debugging"
+ SELECT * FROM information_schema.processlist;
+ exit;
+}
+
set @time_before_kill := (select CURRENT_TIMESTAMP);
--echo [Time before the query]
diff --git a/mysql-test/suite/rpl/t/rpl_trigger.test b/mysql-test/suite/rpl/t/rpl_trigger.test
index e2974a21bf7..723fa3e44e2 100644
--- a/mysql-test/suite/rpl/t/rpl_trigger.test
+++ b/mysql-test/suite/rpl/t/rpl_trigger.test
@@ -3,13 +3,10 @@
# Adding statement include due to Bug 12574
# TODO: Remove statement include once 12574 is patched
--source include/have_binlog_format_mixed_or_statement.inc
---source include/master-slave.inc
---source include/have_innodb.inc
-connection slave;
--source include/have_innodb.inc
+--source include/master-slave.inc
connection master;
-
disable_query_log;
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
enable_query_log;
@@ -26,7 +23,7 @@ DROP TABLE IF EXISTS t3;
#
create table t1 (a int auto_increment, primary key (a), b int, rand_value double not null);
-create table t2 (a int auto_increment, primary key (a), b int);
+create table t2 (a int auto_increment, primary key (a), b int) engine=innodb;
create table t3 (a int auto_increment, primary key (a), name varchar(64) not null, old_a int, old_b int, rand_value double not null);
delimiter |;