Commit 611f9160 authored by Elena Stepanova's avatar Elena Stepanova

MDEV-9038 Binlog encryption tests

- created binlog_encryption test suite and added it to the default list
- moved some tests from rpl, binlog and multisource suites to extra
  so that they could be re-used in different suites
- made minor changes in include files
parent 9199d727
#
# This include file is used by more than one test suite
# (currently rpl and binlog_encryption).
# Please check all dependent tests after modifying it
#
# Usage:
#
# --let $use_remote_mysqlbinlog= 1 # optional
# --let $binlog_start_pos= <binlog position> # optional
# --let $binlog_file= <binlog filename> # optional
#
# --source extra/binlog_tests/binlog_incident.inc
#
# The script uses MYSQLBINLOG to verify certain results.
# By default, it uses binary logs directly. If it is undesirable,
# this behavior can be overridden by setting $use_remote_binlog
# as shown above.
#
# All values will be unset after every execution of the script,
# so if they are needed, they should be set explicitly before each call.
#
# The purpose of this test is to provide a reference for how the
# incident log event is represented in the output from the mysqlbinlog
# program.
source include/have_log_bin.inc;
source include/have_debug.inc;
source include/binlog_start_pos.inc;
let $MYSQLD_DATADIR= `select @@datadir`;
RESET MASTER;
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2),(3);
SELECT * FROM t1;
# This will generate an incident log event and store it in the binary
# log before the replace statement.
REPLACE INTO t1 VALUES (4);
DROP TABLE t1;
FLUSH LOGS;
if ($binlog_start_pos)
{
--let $startpos= --start-position=$binlog_start_pos
--let $binlog_start_pos=
}
--let $filename= master-bin.000001
if ($binlog_file)
{
--let $filename= $binlog_file
--let $binlog_file=
}
--let $mysqlbinlog_args= $MYSQLD_DATADIR/$filename
if ($use_remote_mysqlbinlog)
{
--let $mysqlbinlog_args= --read-from-remote-server --protocol=tcp --host=127.0.0.1 --port=$MASTER_MYPORT -uroot $filename
--let $use_remote_mysqlbinlog= 0
}
exec $MYSQL_BINLOG $startpos $mysqlbinlog_args >$MYSQLTEST_VARDIR/tmp/binlog_incident-bug44442.sql;
--disable_query_log
eval SELECT cont LIKE '%RELOAD DATABASE; # Shall generate syntax error%' AS `Contain RELOAD DATABASE` FROM (SELECT load_file('$MYSQLTEST_VARDIR/tmp/binlog_incident-bug44442.sql') AS cont) AS tbl;
--enable_query_log
remove_file $MYSQLTEST_VARDIR/tmp/binlog_incident-bug44442.sql;
#
# This include file is used by more than one test suite
# (currently binlog and binlog_encryption).
# Please check all dependent tests after modifying it
#
#
# testing of purging of binary log files bug#18199/Bug#18453
#
source include/have_log_bin.inc;
source include/not_embedded.inc;
# Don't test this under valgrind, memory leaks will occur
--source include/not_valgrind.inc
source include/have_debug.inc;
# Avoid CrashReporter popup on Mac
--source include/not_crashrep.inc
call mtr.add_suppression('Attempting backtrace');
call mtr.add_suppression('MSYQL_BIN_LOG::purge_logs failed to process registered files that would be purged.');
call mtr.add_suppression('MSYQL_BIN_LOG::open failed to sync the index file');
call mtr.add_suppression('Turning logging off for the whole duration of the MySQL server process.');
call mtr.add_suppression('Could not open .*');
call mtr.add_suppression('MSYQL_BIN_LOG::purge_logs failed to clean registers before purging logs.');
flush tables;
let $old=`select @@debug`;
RESET MASTER;
let $MYSQLD_DATADIR= `select @@datadir`;
let $INDEX=$MYSQLD_DATADIR/master-bin.index;
#
# testing purge binary logs TO
#
flush logs;
flush logs;
flush logs;
source include/show_binary_logs.inc;
remove_file $MYSQLD_DATADIR/master-bin.000001;
flush tables;
# there must be a warning with file names
replace_regex /\.[\\\/]master/master/;
--source include/wait_for_binlog_checkpoint.inc
purge binary logs TO 'master-bin.000004';
--echo *** must show a list starting from the 'TO' argument of PURGE ***
source include/show_binary_logs.inc;
#
# testing purge binary logs BEFORE
#
reset master;
flush logs;
flush logs;
flush logs;
remove_file $MYSQLD_DATADIR/master-bin.000001;
--echo *** must be a warning master-bin.000001 was not found ***
let $date=`select NOW() + INTERVAL 1 MINUTE`;
--disable_query_log
replace_regex /\.[\\\/]master/master/;
--source include/wait_for_binlog_checkpoint.inc
eval purge binary logs BEFORE '$date';
--enable_query_log
--echo *** must show one record, of the active binlog, left in the index file after PURGE ***
source include/show_binary_logs.inc;
#
# testing a fatal error
# Turning a binlog file into a directory must be a portable setup
#
reset master;
flush logs;
flush logs;
flush logs;
remove_file $MYSQLD_DATADIR/master-bin.000001;
mkdir $MYSQLD_DATADIR/master-bin.000001;
--source include/wait_for_binlog_checkpoint.inc
--error ER_BINLOG_PURGE_FATAL_ERR
purge binary logs TO 'master-bin.000002';
replace_regex /\.[\\\/]master/master/;
show warnings;
rmdir $MYSQLD_DATADIR/master-bin.000001;
--disable_warnings
reset master;
--enable_warnings
--echo # crash_purge_before_update_index
flush logs;
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
SET SESSION debug_dbug="+d,crash_purge_before_update_index";
--source include/wait_for_binlog_checkpoint.inc
--error 2013
purge binary logs TO 'master-bin.000002';
--enable_reconnect
--source include/wait_until_connected_again.inc
file_exists $MYSQLD_DATADIR/master-bin.000001;
file_exists $MYSQLD_DATADIR/master-bin.000002;
file_exists $MYSQLD_DATADIR/master-bin.000003;
--chmod 0644 $INDEX
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-- eval SET @index=LOAD_FILE('$index')
-- replace_regex /\.[\\\/]master/master/
SELECT @index;
--echo # crash_purge_non_critical_after_update_index
flush logs;
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
SET SESSION debug_dbug="+d,crash_purge_non_critical_after_update_index";
--source include/wait_for_binlog_checkpoint.inc
--error 2013
purge binary logs TO 'master-bin.000004';
--enable_reconnect
--source include/wait_until_connected_again.inc
--error 1
file_exists $MYSQLD_DATADIR/master-bin.000001;
--error 1
file_exists $MYSQLD_DATADIR/master-bin.000002;
--error 1
file_exists $MYSQLD_DATADIR/master-bin.000003;
--chmod 0644 $INDEX
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-- eval SET @index=LOAD_FILE('$index')
-- replace_regex /\.[\\\/]master/master/
SELECT @index;
--echo # crash_purge_critical_after_update_index
flush logs;
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
SET SESSION debug_dbug="+d,crash_purge_critical_after_update_index";
--source include/wait_for_binlog_checkpoint.inc
--error 2013
purge binary logs TO 'master-bin.000006';
--enable_reconnect
--source include/wait_until_connected_again.inc
--error 1
file_exists $MYSQLD_DATADIR/master-bin.000004;
--error 1
file_exists $MYSQLD_DATADIR/master-bin.000005;
file_exists $MYSQLD_DATADIR/master-bin.000006;
file_exists $MYSQLD_DATADIR/master-bin.000007;
--error 1
file_exists $MYSQLD_DATADIR/master-bin.000008;
--chmod 0644 $INDEX
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-- eval SET @index=LOAD_FILE('$index')
-- replace_regex /\.[\\\/]master/master/
SELECT @index;
--echo # crash_create_non_critical_before_update_index
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
SET SESSION debug_dbug="+d,crash_create_non_critical_before_update_index";
--error 2013
flush logs;
--enable_reconnect
--source include/wait_until_connected_again.inc
file_exists $MYSQLD_DATADIR/master-bin.000008;
--error 1
file_exists $MYSQLD_DATADIR/master-bin.000009;
--chmod 0644 $INDEX
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-- eval SET @index=LOAD_FILE('$index')
-- replace_regex /\.[\\\/]master/master/
SELECT @index;
--echo # crash_create_critical_before_update_index
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
SET SESSION debug_dbug="+d,crash_create_critical_before_update_index";
--error 2013
flush logs;
--enable_reconnect
--source include/wait_until_connected_again.inc
file_exists $MYSQLD_DATADIR/master-bin.000009;
--error 1
file_exists $MYSQLD_DATADIR/master-bin.000010;
--error 1
file_exists $MYSQLD_DATADIR/master-bin.000011;
--chmod 0644 $INDEX
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-- eval SET @index=LOAD_FILE('$index')
-- replace_regex /\.[\\\/]master/master/
SELECT @index;
--echo # crash_create_after_update_index
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
SET SESSION debug_dbug="+d,crash_create_after_update_index";
--error 2013
flush logs;
--enable_reconnect
--source include/wait_until_connected_again.inc
file_exists $MYSQLD_DATADIR/master-bin.000010;
file_exists $MYSQLD_DATADIR/master-bin.000011;
--chmod 0644 $INDEX
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-- eval SET @index=LOAD_FILE('$index')
-- replace_regex /\.[\\\/]master/master/
SELECT @index;
--echo #
--echo # This should put the server in unsafe state and stop
--echo # accepting any command. If we inject a fault at this
--echo # point and continue the execution the server crashes.
--echo #
--chmod 0644 $INDEX
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-- eval SET @index=LOAD_FILE('$index')
-- replace_regex /\.[\\\/]master/master/
SELECT @index;
--echo # fault_injection_registering_index
SET SESSION debug_dbug="+d,fault_injection_registering_index";
-- replace_regex /\.[\\\/]master/master/
-- error ER_CANT_OPEN_FILE
flush logs;
--chmod 0644 $INDEX
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-- eval SET @index=LOAD_FILE('$index')
-- replace_regex /\.[\\\/]master/master/
SELECT @index;
--source include/restart_mysqld.inc
--chmod 0644 $INDEX
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-- eval SET @index=LOAD_FILE('$index')
-- replace_regex /\.[\\\/]master/master/
SELECT @index;
--echo # fault_injection_updating_index
SET SESSION debug_dbug="+d,fault_injection_updating_index";
-- replace_regex /\.[\\\/]master/master/
-- error ER_CANT_OPEN_FILE
flush logs;
--chmod 0644 $INDEX
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-- eval SET @index=LOAD_FILE('$index')
-- replace_regex /\.[\\\/]master/master/
SELECT @index;
--source include/restart_mysqld.inc
--chmod 0644 $INDEX
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-- eval SET @index=LOAD_FILE('$index')
-- replace_regex /\.[\\\/]master/master/
SELECT @index;
eval SET SESSION debug_dbug="$old";
--echo End of tests
#
# This include file is used by more than one test suite
# (currently binlog and binlog_encryption).
# Please check all dependent tests after modifying it
#
source include/have_debug.inc;
source include/have_innodb.inc;
source include/have_log_bin.inc;
source include/have_binlog_format_mixed_or_statement.inc;
CALL mtr.add_suppression("Error writing file 'master-bin'");
RESET MASTER;
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=innodb;
INSERT INTO t1 VALUES(0);
SET SESSION debug_dbug='+d,fail_binlog_write_1';
--error ER_ERROR_ON_WRITE
INSERT INTO t1 VALUES(1);
--error ER_ERROR_ON_WRITE
INSERT INTO t1 VALUES(2);
SET SESSION debug_dbug='';
INSERT INTO t1 VALUES(3);
SELECT * FROM t1;
# Actually the output from this currently shows a bug.
# The injected IO error leaves partially written transactions in the binlog in
# the form of stray "BEGIN" events.
# These should disappear from the output if binlog error handling is improved
# (see MySQL Bug#37148 and WL#1790).
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /Server ver: .*, Binlog ver: .*/Server ver: #, Binlog ver: #/ /table_id: [0-9]+/table_id: #/
--replace_column 1 BINLOG 2 POS 5 ENDPOS
SHOW BINLOG EVENTS;
DROP TABLE t1;
#
# This include file is used by more than one test suite
# (currently binlog and binlog_encryption).
# Please check all dependent tests after modifying it
#
# Usage:
# --let $use_remote_mysqlbinlog= 1 # optional
# --source extra/binlog_tests/binlog_mysqlbinlog-cp932.inc
#
# By default, the script calls mysqlbinlog to read binary logs directly.
# If it is undesirable, this behavior can be overridden by setting
# $use_remote_binlog as shown above.
# The value will be unset after every execution of the script,
# so if it is needed, it should be set explicitly before each call.
# disabled in embedded until tools running is fixed with embedded
--source include/not_embedded.inc
-- source include/have_binlog_format_mixed_or_statement.inc
-- source include/have_cp932.inc
-- source include/have_log_bin.inc
RESET MASTER;
# Bug#16217 (mysql client did not know how not switch its internal charset)
create table t3 (f text character set utf8);
create table t4 (f text character set cp932);
--exec $MYSQL --default-character-set=utf8 test -e "insert into t3 values(_utf8'ソ')"
--exec $MYSQL --default-character-set=cp932 test -e "insert into t4 values(_cp932'\');"
flush logs;
rename table t3 to t03, t4 to t04;
let $MYSQLD_DATADIR= `select @@datadir`;
--let $mysqlbinlog_args= $MYSQLD_DATADIR/master-bin.000001
if ($use_remote_mysqlbinlog)
{
--let $mysqlbinlog_args= --read-from-remote-server --protocol=tcp --host=127.0.0.1 --port=$MASTER_MYPORT -uroot master-bin.000001
--let $use_remote_mysqlbinlog= 0
}
--exec $MYSQL_BINLOG --short-form $mysqlbinlog_args | $MYSQL --default-character-set=utf8
# original and recovered data must be equal
select HEX(f) from t03;
select HEX(f) from t3;
select HEX(f) from t04;
select HEX(f) from t4;
drop table t3, t4, t03, t04;
--echo End of 5.0 tests
This diff is collapsed.
#
# This include file is used by more than one test suite
# (currently binlog and binlog_encryption).
# Please check all dependent tests after modifying it
#
#
# === Name ===
#
# binlog_write_error.test
#
# === Description ===
#
# This test case check if the error of writing binlog file is properly
# reported and handled when executing statements.
#
# === Related Bugs ===
#
# BUG#37148
#
source include/have_log_bin.inc;
source include/have_debug.inc;
source include/have_binlog_format_mixed_or_statement.inc;
--echo #
--echo # Initialization
--echo #
disable_warnings;
DROP TABLE IF EXISTS t1, t2;
DROP FUNCTION IF EXISTS f1;
DROP FUNCTION IF EXISTS f2;
DROP PROCEDURE IF EXISTS p1;
DROP PROCEDURE IF EXISTS p2;
DROP TRIGGER IF EXISTS tr1;
DROP TRIGGER IF EXISTS tr2;
DROP VIEW IF EXISTS v1, v2;
enable_warnings;
--echo #
--echo # Test injecting binlog write error when executing queries
--echo #
let $query= CREATE TABLE t1 (a INT);
source include/binlog_inject_error.inc;
INSERT INTO t1 VALUES (1),(2),(3);
let $query= INSERT INTO t1 VALUES (4),(5),(6);
source include/binlog_inject_error.inc;
let $query= UPDATE t1 set a=a+1;
source include/binlog_inject_error.inc;
let $query= DELETE FROM t1;
source include/binlog_inject_error.inc;
let $query= CREATE TRIGGER tr1 AFTER INSERT ON t1 FOR EACH ROW INSERT INTO t1 VALUES (new.a + 100);
source include/binlog_inject_error.inc;
let $query= DROP TRIGGER tr1;
source include/binlog_inject_error.inc;
let $query= ALTER TABLE t1 ADD (b INT);
source include/binlog_inject_error.inc;
let $query= CREATE VIEW v1 AS SELECT a FROM t1;
source include/binlog_inject_error.inc;
let $query= DROP VIEW v1;
source include/binlog_inject_error.inc;
let $query= CREATE PROCEDURE p1(OUT rows INT) SELECT count(*) INTO rows FROM t1;
source include/binlog_inject_error.inc;
let $query= DROP PROCEDURE p1;
source include/binlog_inject_error.inc;
let $query= DROP TABLE t1;
source include/binlog_inject_error.inc;
let $query= CREATE FUNCTION f1() RETURNS INT return 1;
source include/binlog_inject_error.inc;
let $query= DROP FUNCTION f1;
source include/binlog_inject_error.inc;
let $query= CREATE USER user1;
source include/binlog_inject_error.inc;
let $query= REVOKE ALL PRIVILEGES, GRANT OPTION FROM user1;
source include/binlog_inject_error.inc;
let $query= DROP USER user1;
source include/binlog_inject_error.inc;
--echo #
--echo # Cleanup
--echo #
disable_warnings;
DROP TABLE IF EXISTS t1, t2;
DROP FUNCTION IF EXISTS f1;
DROP PROCEDURE IF EXISTS p1;
DROP TRIGGER IF EXISTS tr1;
DROP VIEW IF EXISTS v1, v2;
enable_warnings;
#
# This include file is used by more than one test suite
# (currently binlog and binlog_encryption).
# Please check all dependent tests after modifying it
#
--source include/have_innodb.inc
--source include/have_debug.inc
--source include/have_debug_sync.inc
--source include/have_binlog_format_row.inc
# Valgrind does not work well with test that crashes the server
--source include/not_valgrind.inc
# (We do not need to restore these settings, as we crash the server).
SET GLOBAL max_binlog_size= 4096;
SET GLOBAL innodb_flush_log_at_trx_commit= 1;
RESET MASTER;
CREATE TABLE t1 (a INT PRIMARY KEY, b MEDIUMTEXT) ENGINE=Innodb;
# Insert some data to force a couple binlog rotations (3), so we get some
# normal binlog checkpoints before starting the test.
INSERT INTO t1 VALUES (100, REPEAT("x", 4100));
# Wait for the master-bin.000002 binlog checkpoint to appear.
--let $wait_for_all= 0
--let $show_statement= SHOW BINLOG EVENTS IN "master-bin.000002"
--let $field= Info
--let $condition= = "master-bin.000002"
--source include/wait_show_condition.inc
INSERT INTO t1 VALUES (101, REPEAT("x", 4100));
--let $wait_for_all= 0
--let $show_statement= SHOW BINLOG EVENTS IN "master-bin.000003"
--let $field= Info
--let $condition= = "master-bin.000003"
--source include/wait_show_condition.inc
INSERT INTO t1 VALUES (102, REPEAT("x", 4100));
--let $wait_for_all= 0
--let $show_statement= SHOW BINLOG EVENTS IN "master-bin.000004"
--let $field= Info
--let $condition= = "master-bin.000004"
--source include/wait_show_condition.inc
# Now start a bunch of transactions that span multiple binlog
# files. Leave then in the state prepared-but-not-committed in the engine
# and crash the server. Check that crash recovery is able to recover all
# of them.
#
# We use debug_sync to get all the transactions into the prepared state before
# we commit any of them. This is because the prepare step flushes the InnoDB
# redo log - including any commits made before, so recovery would become
# unnecessary, decreasing the value of this test.
#
# We arrange to have con1 with a prepared transaction in master-bin.000004,
# con2 and con3 with a prepared transaction in master-bin.000005, and a new
# empty master-bin.000006. So the latest binlog checkpoint should be
# master-bin.000006.
connect(con1,localhost,root,,);
# First wait after prepare and before write to binlog.
SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con1_wait WAIT_FOR con1_cont";
# Then complete InnoDB commit in memory (but not commit checkpoint / write to
# disk), and hang until crash, leaving a transaction to be XA recovered.
SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con1_ready WAIT_FOR _ever";
send INSERT INTO t1 VALUES (1, REPEAT("x", 4100));
connection default;
SET DEBUG_SYNC= "now WAIT_FOR con1_wait";
connect(con2,localhost,root,,);
SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con2_wait WAIT_FOR con2_cont";
SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con2_ready WAIT_FOR _ever";
send INSERT INTO t1 VALUES (2, NULL);
connection default;
SET DEBUG_SYNC= "now WAIT_FOR con2_wait";
connect(con3,localhost,root,,);
SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con3_wait WAIT_FOR con3_cont";
SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con3_ready WAIT_FOR _ever";
send INSERT INTO t1 VALUES (3, REPEAT("x", 4100));
connection default;
SET DEBUG_SYNC= "now WAIT_FOR con3_wait";
connect(con4,localhost,root,,);
SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con4_wait WAIT_FOR con4_cont";
SET SESSION debug_dbug="+d,crash_commit_after_log";
send INSERT INTO t1 VALUES (4, NULL);
connection default;
SET DEBUG_SYNC= "now WAIT_FOR con4_wait";
SET DEBUG_SYNC= "now SIGNAL con1_cont";
SET DEBUG_SYNC= "now WAIT_FOR con1_ready";
SET DEBUG_SYNC= "now SIGNAL con2_cont";
SET DEBUG_SYNC= "now WAIT_FOR con2_ready";
SET DEBUG_SYNC= "now SIGNAL con3_cont";
SET DEBUG_SYNC= "now WAIT_FOR con3_ready";
# Check that everything is committed in binary log.
--source include/show_binary_logs.inc
--let $binlog_file= master-bin.000003
--let $binlog_start= 4
--source include/show_binlog_events.inc
--let $binlog_file= master-bin.000004
--source include/show_binlog_events.inc
--let $binlog_file= master-bin.000005
--source include/show_binlog_events.inc
--let $binlog_file= master-bin.000006
--source include/show_binlog_events.inc
# Check that server will not purge too much.
PURGE BINARY LOGS TO "master-bin.000006";
--source include/show_binary_logs.inc
# Now crash the server with one more transaction in prepared state.
--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
wait-binlog_xa_recover.test
EOF
--error 0,2006,2013
SET DEBUG_SYNC= "now SIGNAL con4_cont";
connection con4;
--error 2006,2013
reap;
--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
restart-group_commit_binlog_pos.test
EOF
connection default;
--enable_reconnect
--source include/wait_until_connected_again.inc
# Check that all transactions are recovered.
SELECT a FROM t1 ORDER BY a;
--echo Test that with multiple binlog checkpoints, recovery starts from the last one.
SET GLOBAL max_binlog_size= 4096;
SET GLOBAL innodb_flush_log_at_trx_commit= 1;
RESET MASTER;
# Rotate to binlog master-bin.000003 while delaying binlog checkpoints.
# So we get multiple binlog checkpoints in master-bin.000003.
# Then complete the checkpoints, crash, and check that we only scan
# the necessary binlog file (ie. that we use the _last_ checkpoint).
connect(con10,localhost,root,,);
SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con10_ready WAIT_FOR con10_cont";
send INSERT INTO t1 VALUES (10, REPEAT("x", 4100));
connection default;
SET DEBUG_SYNC= "now WAIT_FOR con10_ready";
connect(con11,localhost,root,,);
SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con11_ready WAIT_FOR con11_cont";
send INSERT INTO t1 VALUES (11, REPEAT("x", 4100));
connection default;
SET DEBUG_SYNC= "now WAIT_FOR con11_ready";
connect(con12,localhost,root,,);
SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con12_ready WAIT_FOR con12_cont";
send INSERT INTO t1 VALUES (12, REPEAT("x", 4100));
connection default;
SET DEBUG_SYNC= "now WAIT_FOR con12_ready";
INSERT INTO t1 VALUES (13, NULL);
--source include/show_binary_logs.inc
--let $binlog_file= master-bin.000004
--let $binlog_start= 4
--source include/show_binlog_events.inc
SET DEBUG_SYNC= "now SIGNAL con10_cont";
connection con10;
reap;
connection default;
# We need to sync the test case with the background processing of the
# commit checkpoint, otherwise we get nondeterministic results.
SET @old_dbug= @@global.DEBUG_DBUG;
SET GLOBAL debug_dbug="+d,binlog_background_checkpoint_processed";
SET DEBUG_SYNC= "now SIGNAL con12_cont";
connection con12;
reap;
connection default;
SET DEBUG_SYNC= "now WAIT_FOR binlog_background_checkpoint_processed";
SET GLOBAL debug_dbug= @old_dbug;
SET DEBUG_SYNC= "now SIGNAL con11_cont";
connection con11;
reap;
connection default;
# Wait for the last (master-bin.000004) binlog checkpoint to appear.
--let $wait_for_all= 0
--let $show_statement= SHOW BINLOG EVENTS IN "master-bin.000004"
--let $field= Info
--let $condition= = "master-bin.000004"
--source include/wait_show_condition.inc
--echo Checking that master-bin.000004 is the last binlog checkpoint
--source include/show_binlog_events.inc
--echo Now crash the server
# It is not too easy to test XA recovery, as it runs early during server
# startup, before any connections can be made.
# What we do is set a DBUG error insert which will crash if XA recovery
# starts from any other binlog than master-bin.000004 (check the file
# binlog_xa_recover-master.opt). Then we will fail here if XA recovery
# would start from the wrong place.
--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
wait-binlog_xa_recover.test
EOF
SET SESSION debug_dbug="+d,crash_commit_after_log";
--error 2006,2013
INSERT INTO t1 VALUES (14, NULL);
--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
restart-group_commit_binlog_pos.test
EOF
connection default;
--enable_reconnect
--source include/wait_until_connected_again.inc
# Check that all transactions are recovered.
SELECT a FROM t1 ORDER BY a;
--echo *** Check that recovery works if we crashed early during rotate, before
--echo *** binlog checkpoint event could be written.
SET GLOBAL max_binlog_size= 4096;
SET GLOBAL innodb_flush_log_at_trx_commit= 1;
RESET MASTER;
# We need some initial data to reach binlog master-bin.000004. Otherwise
# crash recovery fails due to the error insert used for previous test.
INSERT INTO t1 VALUES (21, REPEAT("x", 4100));
INSERT INTO t1 VALUES (22, REPEAT("x", 4100));
# Wait for the master-bin.000003 binlog checkpoint to appear.
--let $wait_for_all= 0
--let $show_statement= SHOW BINLOG EVENTS IN "master-bin.000003"
--let $field= Info
--let $condition= = "master-bin.000003"
--source include/wait_show_condition.inc
INSERT INTO t1 VALUES (23, REPEAT("x", 4100));
# Wait for the last (master-bin.000004) binlog checkpoint to appear.
--let $wait_for_all= 0
--let $show_statement= SHOW BINLOG EVENTS IN "master-bin.000004"
--let $field= Info
--let $condition= = "master-bin.000004"
--source include/wait_show_condition.inc
--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
wait-binlog_xa_recover.test
EOF
SET SESSION debug_dbug="+d,crash_before_write_checkpoint_event";
--error 2006,2013
INSERT INTO t1 VALUES (24, REPEAT("x", 4100));
--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
restart-group_commit_binlog_pos.test
EOF
--enable_reconnect
--source include/wait_until_connected_again.inc
# Check that all transactions are recovered.
SELECT a FROM t1 ORDER BY a;
--source include/show_binary_logs.inc
--let $binlog_file= master-bin.000004
--let $binlog_start= 4
--source include/show_binlog_events.inc
# Cleanup
connection default;
DROP TABLE t1;
#
# This include file is used by more than one test suite
# (currently multisource and binlog_encryption).
# Please check all dependent tests after modifying it
#
# Usage:
# --let $binlog_extra_length= X # optional, default 0
# --source extra/rpl_tests/multisource.inc
#
# By default, the script expects the length of the 2nd binary log to be
# $binlog_start_pos + length(Gtid_list event) + 2 x length(Binlog_checkpoint event)
# Some tests can have specific configuration which would change it,
# e.g. for encrypted binlogs there will be additional event
# Start_encryption of the length of 36.
# binlog_extra_length should compensate for the difference.
if (!$binlog_extra_length)
{
--let $binlog_extra_length= 0
}
#
# Test basic replication functionality
# in multi-source setup
#
--source include/not_embedded.inc
--source include/have_innodb.inc
--source include/binlog_start_pos.inc
--let $rpl_server_count= 0
--connect (slave,127.0.0.1,root,,,$SERVER_MYPORT_3)
# MDEV-3984: crash/read of freed memory when changing master with named connection
# This fails after adding the new master 'abc', check we do not free twice.
--error ER_RELAY_LOG_INIT
change master 'abc' to relay_log_file='';
# This fails before adding the new master, check that we do free it.
--error ER_WRONG_ARGUMENTS
change master 'abc2' to master_host='';
# Start replication from the first master
--replace_result $SERVER_MYPORT_1 MYPORT_1
eval change master 'master1' to
master_port=$SERVER_MYPORT_1,
master_host='127.0.0.1',
master_user='root';
start slave 'master1';
set default_master_connection = 'master1';
--source include/wait_for_slave_to_start.inc
--connect (master1,127.0.0.1,root,,,$SERVER_MYPORT_1)
--save_master_pos
--connection slave
--sync_with_master 0,'master1'
# Here and further: add an extra check on SQL thread status
# as the normal sync is not always enough
--source include/wait_for_sql_thread_read_all.inc
# each of the 3 commands should produce
# 'master1' status
let $wait_for_all= 1;
let $show_statement= SHOW ALL SLAVES STATUS;
let $field= Slave_IO_State;
let $condition= = 'Waiting for master to send event';
--source include/wait_show_condition.inc
--echo #
--echo # Checking SHOW SLAVE 'master1' STATUS
--echo #
--let $status_items= Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno
--let $slave_field_result_replace= /$SERVER_MYPORT_1/MYPORT_1/
--let $slave_name= 'master1'
--source include/show_slave_status.inc
--let $slave_name=
--echo #
--echo # Checking SHOW SLAVE STATUS
--echo #
--source include/show_slave_status.inc
--echo #
--echo # Checking SHOW ALL SLAVES STATUS
--echo #
--let $all_slaves_status= 1
--let $status_items= Connection_name, Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno, Slave_heartbeat_period
--source include/show_slave_status.inc
--let $all_slaves_status=
--echo #
# Check that replication actually works
--connection master1
--disable_warnings
drop database if exists db1;
--enable_warnings
create database db1;
use db1;
create table t1 (i int auto_increment, f1 varchar(16), primary key pk (i,f1)) engine=MyISAM;
insert into t1 (f1) values ('one'),('two');
--save_master_pos
--connection slave
--sync_with_master 0,'master1'
--sorted_result
select * from db1.t1;
--let $datadir = `SELECT @@datadir`
--echo # List of relay log files in the datadir
--list_files $datadir mysqld-relay-bin-master1.*
# Check that relay logs are recognizable
let binlog_start=4;
let binlog_file=;
source include/show_relaylog_events.inc;
let binlog_file= mysqld-relay-bin-master1.000002;
source include/show_relaylog_events.inc;
# Try to configure connection with the same name again,
# should get an error because the slave is running
--replace_result $SERVER_MYPORT_2 MYPORT_2
--error ER_SLAVE_MUST_STOP
eval change master 'master1' to
master_port=$SERVER_MYPORT_2,
master_host='127.0.0.1',
master_user='root';
# Try to configure using the default connection name
# (which is 'master1' at the moment),
# again, should get an error
--replace_result $SERVER_MYPORT_2 MYPORT_2
--error ER_SLAVE_MUST_STOP
eval change master to
master_port=$SERVER_MYPORT_2,
master_host='127.0.0.1',
master_user='root';
# Try to configure a connection with the same master
# using a different name, should get a conflict
--replace_result $SERVER_MYPORT_1 MYPORT_1
--error ER_CONNECTION_ALREADY_EXISTS
eval change master 'master2' to
master_port=$SERVER_MYPORT_1,
master_host='127.0.0.1',
master_user='root';
# Set up a proper 'default' connection to master2
set default_master_connection = '';
--replace_result $SERVER_MYPORT_2 MYPORT_2
eval change master to
master_port=$SERVER_MYPORT_2,
master_host='127.0.0.1',
master_user='root';
start slave;
--source include/wait_for_slave_to_start.inc
--source include/wait_for_sql_thread_read_all.inc
# See both connections in the same status output
let $wait_for_all= 1;
let $show_statement= SHOW ALL SLAVES STATUS;
let $field= Slave_IO_State;
let $condition= = 'Waiting for master to send event';
--source include/wait_show_condition.inc
--echo #
--echo # Checking SHOW ALL SLAVES STATUS
--echo #
--let $all_slaves_status= 1
--let $status_items= Connection_name, Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno, Slave_heartbeat_period
--let $slave_field_result_replace= /$SERVER_MYPORT_1/MYPORT_1/ /$SERVER_MYPORT_2/MYPORT_2/
--source include/show_slave_status.inc
--let $all_slaves_status=
--echo #
# Check that replication from two servers actually works
--connection master1
insert into t1 (f1) values ('three');
--save_master_pos
--connect (master2,127.0.0.1,root,,,$SERVER_MYPORT_2)
--disable_warnings
drop database if exists db2;
--enable_warnings
create database db2;
use db2;
create table t1 (pk int auto_increment primary key, f1 int) engine=InnoDB;
begin;
insert into t1 (f1) values (1),(2);
--connection slave
--sync_with_master 0,'master1'
--connection master2
--save_master_pos
--connection slave
--sync_with_master 0
--sorted_result
select * from db1.t1;
select * from db2.t1;
--connection master2
commit;
--save_master_pos
--connection slave
--sync_with_master 0
--sorted_result
select * from db2.t1;
# Flush and purge logs on one master,
# make sure slaves don't get confused
--connection master1
flush logs;
--source include/wait_for_binlog_checkpoint.inc
--save_master_pos
--connection slave
--sync_with_master 0, 'master1'
--connection master1
purge binary logs to 'master-bin.000002';
# Additional events: 39 (Gtid_list) + 2 x 40 (Binlog_checkpoint) = 119
let filesize=`select $binlog_start_pos+119+$binlog_extra_length`;
--replace_result $filesize filesize
show binary logs;
insert into t1 (f1) values ('four');
create table db1.t3 (f1 int) engine=InnoDB;
--save_master_pos
--connection slave
--sync_with_master 0,'master1'
--source include/wait_for_sql_thread_read_all.inc
let $wait_for_all= 1;
let $show_statement= SHOW ALL SLAVES STATUS;
let $field= Slave_IO_State;
let $condition= = 'Waiting for master to send event';
--source include/wait_show_condition.inc
--echo #
--echo # Checking SHOW ALL SLAVES STATUS
--echo #
--let $all_slaves_status= 1
--let $status_items= Connection_name, Master_Port, Relay_Log_File, Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_SQL_Errno, Slave_heartbeat_period
--let $slave_field_result_replace= /$SERVER_MYPORT_1/MYPORT_1/ /$SERVER_MYPORT_2/MYPORT_2/
--source include/show_slave_status.inc
--let $all_slaves_status=
--echo #
--sorted_result
select * from db1.t1;
# This should show relay log events for the default master
# (the one with the empty name)
let binlog_file=;
source include/show_relaylog_events.inc;
let binlog_file= mysqld-relay-bin.000002;
source include/show_relaylog_events.inc;
# Make sure we don't lose control over replication connections
# after reconnecting to the slave
--disconnect slave
--connect (slave,127.0.0.1,root,,,$SERVER_MYPORT_3)
stop slave io_thread;
show status like 'Slave_running';
set default_master_connection = 'master1';
show status like 'Slave_running';
# Cleanup
drop database db1;
drop database db2;
--source include/reset_master_slave.inc
--disconnect slave
--connection master1
drop database db1;
--source include/reset_master_slave.inc
--disconnect master1
--connection master2
drop database db2;
--source include/reset_master_slave.inc
--disconnect master2
This diff is collapsed.
#
# This include file is used by more than one test suite
# (currently rpl and binlog_encryption).
# Please check all dependent tests after modifying it
#
#
# Bug#11747416 : 32228 A disk full makes binary log corrupt.
#
#
# The test demonstrates reading from binlog error propagation to slave
# and reporting there.
# Conditions for the bug include a crash at time of the last event to
# the binlog was written partly. With the fixes the event is not sent out
# any longer, but rather the dump thread sends out a sound error message.
#
# Crash is not simulated. A binlog with partly written event in its end is installed
# and replication is started from it.
#
--source include/master-slave.inc
--source include/have_binlog_format_mixed.inc
--connection slave
# Make sure the slave is stopped while we are messing with master.
# Otherwise we get occasional failures as the slave manages to re-connect
# to the newly started master and we get extra events applied, causing
# conflicts.
--source include/stop_slave.inc
--connection master
call mtr.add_suppression("Error in Log_event::read_log_event()");
--let $datadir= `SELECT @@datadir`
--let $rpl_server_number= 1
--source include/rpl_stop_server.inc
--remove_file $datadir/master-bin.000001
--copy_file $MYSQL_TEST_DIR/std_data/bug11747416_32228_binlog.000001 $datadir/master-bin.000001
--let $rpl_server_number= 1
--source include/rpl_start_server.inc
--source include/wait_until_connected_again.inc
# evidence of the partial binlog
--error ER_ERROR_WHEN_EXECUTING_COMMAND
show binlog events;
--connection slave
call mtr.add_suppression("Slave I/O: Got fatal error 1236 from master when reading data from binary log");
reset slave;
start slave;
# ER_MASTER_FATAL_ERROR_READING_BINLOG 1236
--let $slave_param=Last_IO_Errno
--let $slave_param_value=1236
--source include/wait_for_slave_param.inc
--let $slave_field_result_replace= / at [0-9]*/ at XXX/
--let $status_items= Last_IO_Errno, Last_IO_Error
--source include/show_slave_status.inc
#
# Cleanup
#
--connection master
reset master;
--connection slave
stop slave;
reset slave;
# Table was created from binlog, it may not be created if SQL thread is running
# slowly and IO thread reaches incident before SQL thread applies it.
--disable_warnings
drop table if exists t;
--enable_warnings
reset master;
--echo End of the tests
--let $rpl_only_running_threads= 1
--source include/rpl_end.inc
#
# This include file is used by more than one test suite
# (currently rpl and binlog_encryption).
# Please check all dependent tests after modifying it
#
# WL2540 replication events checksum
# Testing configuration parameters
--source include/master-slave.inc
--source include/have_debug.inc
--source include/have_binlog_format_mixed.inc
call mtr.add_suppression('Slave can not handle replication events with the checksum that master is configured to log');
call mtr.add_suppression('Replication event checksum verification failed');
# due to C failure simulation
call mtr.add_suppression('Relay log write failure: could not queue event from master');
call mtr.add_suppression('Master is configured to log replication events with checksum, but will not send such events to slaves that cannot process them');
# A. read/write access to the global vars:
# binlog_checksum master_verify_checksum slave_sql_verify_checksum
connection master;
set @master_save_binlog_checksum= @@global.binlog_checksum;
set @save_master_verify_checksum = @@global.master_verify_checksum;
select @@global.binlog_checksum as 'must be CRC32 because of the command line option';
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.binlog_checksum as 'no session var';
select @@global.master_verify_checksum as 'must be zero because of default';
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.master_verify_checksum as 'no session var';
connection slave;
set @slave_save_binlog_checksum= @@global.binlog_checksum;
set @save_slave_sql_verify_checksum = @@global.slave_sql_verify_checksum;
select @@global.slave_sql_verify_checksum as 'must be one because of default';
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.slave_sql_verify_checksum as 'no session var';
connection master;
source include/show_binary_logs.inc;
set @@global.binlog_checksum = NONE;
select @@global.binlog_checksum;
--echo *** must be rotations seen ***
source include/show_binary_logs.inc;
set @@global.binlog_checksum = default;
select @@global.binlog_checksum;
# testing lack of side-effects in non-effective update of binlog_checksum:
set @@global.binlog_checksum = CRC32;
select @@global.binlog_checksum;
set @@global.binlog_checksum = CRC32;
set @@global.master_verify_checksum = 0;
set @@global.master_verify_checksum = default;
--error ER_WRONG_VALUE_FOR_VAR
set @@global.binlog_checksum = ADLER32;
--error ER_WRONG_VALUE_FOR_VAR
set @@global.master_verify_checksum = 2; # the var is of bool type
connection slave;
set @@global.slave_sql_verify_checksum = 0;
set @@global.slave_sql_verify_checksum = default;
--error ER_WRONG_VALUE_FOR_VAR
set @@global.slave_sql_verify_checksum = 2; # the var is of bool type
#
# B. Old Slave to New master conditions
#
# while master does not send a checksum-ed binlog the Old Slave can
# work with the New Master
connection master;
set @@global.binlog_checksum = NONE;
create table t1 (a int);
# testing that binlog rotation preserves opt_binlog_checksum value
flush logs;
flush logs;
flush logs;
sync_slave_with_master;
#connection slave;
# checking that rotation on the slave side leaves slave stable
flush logs;
flush logs;
flush logs;
select count(*) as zero from t1;
source include/stop_slave.inc;
connection master;
set @@global.binlog_checksum = CRC32;
-- source include/wait_for_binlog_checkpoint.inc
insert into t1 values (1) /* will not be applied on slave due to simulation */;
# instruction to the dump thread
connection slave;
set @@global.debug_dbug='d,simulate_slave_unaware_checksum';
start slave;
--let $slave_io_errno= 1236
--let $show_slave_io_error= 1
source include/wait_for_slave_io_error.inc;
select count(*) as zero from t1;
###connection master;
set @@global.debug_dbug='';
connection slave;
source include/start_slave.inc;
#
# C. checksum failure simulations
#
# C1. Failure by a client thread
connection master;
set @@global.master_verify_checksum = 1;
set @@session.debug_dbug='d,simulate_checksum_test_failure';
--error ER_ERROR_WHEN_EXECUTING_COMMAND
show binlog events;
set @@session.debug_dbug='';
set @@global.master_verify_checksum = default;
#connection master;
sync_slave_with_master;
connection slave;
source include/stop_slave.inc;
connection master;
create table t2 (a int);
let $pos_master= query_get_value(SHOW MASTER STATUS, Position, 1);
connection slave;
# C2. Failure by IO thread
# instruction to io thread
set @@global.debug_dbug='d,simulate_checksum_test_failure';
start slave io_thread;
# When the checksum error is detected, the slave sets error code 1913
# (ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE) in queue_event(), then immediately
# sets error 1595 (ER_SLAVE_RELAY_LOG_WRITE_FAILURE) in handle_slave_io().
# So we usually get 1595, but it is occasionally possible to get 1913.
--let $slave_io_errno= 1595,1913
--let $show_slave_io_error= 0
source include/wait_for_slave_io_error.inc;
set @@global.debug_dbug='';
# to make IO thread re-read it again w/o the failure
start slave io_thread;
let $slave_param= Read_Master_Log_Pos;
let $slave_param_value= $pos_master;
source include/wait_for_slave_param.inc;
# C3. Failure by SQL thread
# instruction to sql thread;
set @@global.slave_sql_verify_checksum = 1;
set @@global.debug_dbug='d,simulate_checksum_test_failure';
start slave sql_thread;
--let $slave_sql_errno= 1593
--let $show_slave_sql_error= 1
source include/wait_for_slave_sql_error.inc;
# resuming SQL thread to parse out the event w/o the failure
set @@global.debug_dbug='';
source include/start_slave.inc;
connection master;
sync_slave_with_master;
#connection slave;
select count(*) as 'must be zero' from t2;
#
# D. Reset slave, Change-Master, Binlog & Relay-log rotations with
# random value on binlog_checksum on both master and slave
#
connection slave;
stop slave;
reset slave;
# randomize slave server's own checksum policy
set @@global.binlog_checksum= IF(floor((rand()*1000)%2), "CRC32", "NONE");
flush logs;
connection master;
set @@global.binlog_checksum= CRC32;
reset master;
flush logs;
create table t3 (a int, b char(5));
connection slave;
source include/start_slave.inc;
connection master;
sync_slave_with_master;
#connection slave;
select count(*) as 'must be zero' from t3;
source include/stop_slave.inc;
--replace_result $MASTER_MYPORT MASTER_PORT
eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, master_user='root';
connection master;
flush logs;
reset master;
insert into t3 value (1, @@global.binlog_checksum);
connection slave;
source include/start_slave.inc;
flush logs;
connection master;
sync_slave_with_master;
#connection slave;
select count(*) as 'must be one' from t3;
connection master;
set @@global.binlog_checksum= IF(floor((rand()*1000)%2), "CRC32", "NONE");
insert into t3 value (1, @@global.binlog_checksum);
sync_slave_with_master;
#connection slave;
#clean-up
connection master;
drop table t1, t2, t3;
set @@global.binlog_checksum = @master_save_binlog_checksum;
set @@global.master_verify_checksum = @save_master_verify_checksum;
#
# BUG#58564: flush_read_lock fails in mysql-trunk-bugfixing after merging with WL#2540
#
# Sanity check that verifies that no assertions are triggered because
# of old FD events (generated by versions prior to server released with
# checksums feature)
#
# There is no need for query log, if something wrong this should trigger
# an assertion
--disable_query_log
BINLOG '
MfmqTA8BAAAAZwAAAGsAAAABAAQANS41LjctbTMtZGVidWctbG9nAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAx+apMEzgNAAgAEgAEBAQEEgAAVAAEGggAAAAICAgCAA==
';
--enable_query_log
#connection slave;
sync_slave_with_master;
--echo *** Bug#59123 / MDEV-5799: INCIDENT_EVENT checksum written to error log as garbage characters ***
--connection master
--source include/wait_for_binlog_checkpoint.inc
CREATE TABLE t4 (a INT PRIMARY KEY);
INSERT INTO t4 VALUES (1);
SET sql_log_bin=0;
CALL mtr.add_suppression("\\[ERROR\\] Can't generate a unique log-filename");
SET sql_log_bin=1;
SET @old_dbug= @@GLOBAL.debug_dbug;
SET debug_dbug= '+d,binlog_inject_new_name_error';
--error ER_NO_UNIQUE_LOGFILE
FLUSH LOGS;
SET debug_dbug= @old_dbug;
INSERT INTO t4 VALUES (2);
--connection slave
--let $slave_sql_errno= 1590
--source include/wait_for_slave_sql_error.inc
# Search the error log for the error message.
# The bug was that 4 garbage bytes were output in the middle of the error
# message; by searching for a pattern that spans that location, we can
# catch the error.
let $log_error_= `SELECT @@GLOBAL.log_error`;
if(!$log_error_)
{
# MySQL Server on windows is started with --console and thus
# does not know the location of its .err log, use default location
let $log_error_ = $MYSQLTEST_VARDIR/log/mysqld.2.err;
}
--let SEARCH_FILE= $log_error_
--let SEARCH_RANGE=-50000
--let SEARCH_PATTERN= Slave SQL: The incident LOST_EVENTS occurred on the master\. Message: error writing to the binary log, Internal MariaDB error code: 1590
--source include/search_pattern_in_file.inc
SELECT * FROM t4 ORDER BY a;
STOP SLAVE IO_THREAD;
SET sql_slave_skip_counter= 1;
--source include/start_slave.inc
--connection master
--save_master_pos
--connection slave
--sync_with_master
SELECT * FROM t4 ORDER BY a;
--connection slave
set @@global.binlog_checksum = @slave_save_binlog_checksum;
set @@global.slave_sql_verify_checksum = @save_slave_sql_verify_checksum;
--echo End of tests
--connection master
DROP TABLE t4;
--source include/rpl_end.inc
#
# This include file is used by more than one test suite
# (currently rpl and binlog_encryption).
# Please check all dependent tests after modifying it
#
-- source include/have_innodb.inc
-- source include/master-slave.inc
--disable_warnings
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. Statement: insert into t2 set data=repeat.*'a', @act_size.*");
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. Statement: insert into t1 values.* NAME_CONST.*'n',.*, @data .*");
--enable_warnings
connection master;
set @save_binlog_cache_size = @@global.binlog_cache_size;
set @save_binlog_checksum = @@global.binlog_checksum;
set @save_master_verify_checksum = @@global.master_verify_checksum;
set @@global.binlog_cache_size = 4096;
set @@global.binlog_checksum = CRC32;
set @@global.master_verify_checksum = 1;
# restart slave to force the dump thread to verify events (on master side)
connection slave;
source include/stop_slave.inc;
source include/start_slave.inc;
connection master;
#
# Testing a critical part of checksum handling dealing with transaction cache.
# The cache's buffer size is set to be less than the transaction's footprint
# in binlog.
#
# To verify combined buffer-by-buffer read out of the file and fixing crc per event
# there are the following parts:
#
# 1. the event size is much less than the cache's buffer
# 2. the event size is bigger than the cache's buffer
# 3. the event size if approximately the same as the cache's buffer
# 4. all in above
#
# 1. the event size is much less than the cache's buffer
#
flush status;
show status like "binlog_cache_use";
show status like "binlog_cache_disk_use";
--disable_warnings
drop table if exists t1;
--enable_warnings
#
# parameter to ensure the test slightly varies binlog content
# between different invocations
#
let $deviation_size=32;
eval create table t1 (a int PRIMARY KEY, b CHAR($deviation_size)) engine=innodb;
# Now we are going to create transaction which is long enough so its
# transaction binlog will be flushed to disk...
delimiter |;
create procedure test.p_init (n int, size int)
begin
while n > 0 do
select round(RAND() * size) into @act_size;
set @data = repeat('a', @act_size);
insert into t1 values(n, @data );
set n= n-1;
end while;
end|
delimiter ;|
let $1 = 4000; # PB2 can run it slow to time out on following sync_slave_with_master:s
begin;
--disable_warnings
# todo: check if it is really so.
#+Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave.
eval call test.p_init($1, $deviation_size);
--enable_warnings
commit;
show status like "binlog_cache_use";
--echo *** binlog_cache_disk_use must be non-zero ***
show status like "binlog_cache_disk_use";
sync_slave_with_master;
let $diff_tables=master:test.t1, slave:test.t1;
source include/diff_tables.inc;
# undoing changes with verifying the above once again
connection master;
begin;
delete from t1;
commit;
sync_slave_with_master;
#
# 2. the event size is bigger than the cache's buffer
#
connection master;
flush status;
let $t2_data_size= `select 3 * @@global.binlog_cache_size`;
let $t2_aver_size= `select 2 * @@global.binlog_cache_size`;
let $t2_max_rand= `select 1 * @@global.binlog_cache_size`;
eval create table t2(a int auto_increment primary key, data VARCHAR($t2_data_size)) ENGINE=Innodb;
let $1=100;
--disable_query_log
begin;
while ($1)
{
eval select round($t2_aver_size + RAND() * $t2_max_rand) into @act_size;
set @data = repeat('a', @act_size);
insert into t2 set data = @data;
dec $1;
}
commit;
--enable_query_log
show status like "binlog_cache_use";
--echo *** binlog_cache_disk_use must be non-zero ***
show status like "binlog_cache_disk_use";
sync_slave_with_master;
let $diff_tables=master:test.t2, slave:test.t2;
source include/diff_tables.inc;
# undoing changes with verifying the above once again
connection master;
begin;
delete from t2;
commit;
sync_slave_with_master;
#
# 3. the event size if approximately the same as the cache's buffer
#
connection master;
flush status;
let $t3_data_size= `select 2 * @@global.binlog_cache_size`;
let $t3_aver_size= `select (9 * @@global.binlog_cache_size) / 10`;
let $t3_max_rand= `select (2 * @@global.binlog_cache_size) / 10`;
eval create table t3(a int auto_increment primary key, data VARCHAR($t3_data_size)) engine=innodb;
let $1= 300;
--disable_query_log
begin;
while ($1)
{
eval select round($t3_aver_size + RAND() * $t3_max_rand) into @act_size;
insert into t3 set data= repeat('a', @act_size);
dec $1;
}
commit;
--enable_query_log
show status like "binlog_cache_use";
--echo *** binlog_cache_disk_use must be non-zero ***
show status like "binlog_cache_disk_use";
sync_slave_with_master;
let $diff_tables=master:test.t3, slave:test.t3;
source include/diff_tables.inc;
# undoing changes with verifying the above once again
connection master;
begin;
delete from t3;
commit;
sync_slave_with_master;
#
# 4. all in above
#
connection master;
flush status;
delimiter |;
eval create procedure test.p1 (n int)
begin
while n > 0 do
case (select (round(rand()*100) % 3) + 1)
when 1 then
select round(RAND() * $deviation_size) into @act_size;
set @data = repeat('a', @act_size);
insert into t1 values(n, @data);
when 2 then
begin
select round($t2_aver_size + RAND() * $t2_max_rand) into @act_size;
insert into t2 set data=repeat('a', @act_size);
end;
when 3 then
begin
select round($t3_aver_size + RAND() * $t3_max_rand) into @act_size;
insert into t3 set data= repeat('a', @act_size);
end;
end case;
set n= n-1;
end while;
end|
delimiter ;|
let $1= 1000;
set autocommit= 0;
begin;
--disable_warnings
eval call test.p1($1);
--enable_warnings
commit;
show status like "binlog_cache_use";
--echo *** binlog_cache_disk_use must be non-zero ***
show status like "binlog_cache_disk_use";
sync_slave_with_master;
let $diff_tables=master:test.t1, slave:test.t1;
source include/diff_tables.inc;
let $diff_tables=master:test.t2, slave:test.t2;
source include/diff_tables.inc;
let $diff_tables=master:test.t3, slave:test.t3;
source include/diff_tables.inc;
connection master;
begin;
delete from t1;
delete from t2;
delete from t3;
commit;
drop table t1, t2, t3;
set @@global.binlog_cache_size = @save_binlog_cache_size;
set @@global.binlog_checksum = @save_binlog_checksum;
set @@global.master_verify_checksum = @save_master_verify_checksum;
drop procedure test.p_init;
drop procedure test.p1;
--source include/rpl_end.inc
#
# This include file is used by more than one test suite
# (currently rpl and binlog_encryption).
# Please check all dependent tests after modifying it
#
############################################################
# Purpose: WL#5064 Testing with corrupted events.
# The test emulates the corruption at the vary stages
# of replication:
# - in binlog file
# - in network
# - in relay log
############################################################
#
# The tests intensively utilize @@global.debug. Note,
# Bug#11765758 - 58754,
# @@global.debug is read by the slave threads through dbug-interface.
# Hence, before a client thread set @@global.debug we have to ensure that:
# (a) the slave threads are stopped, or (b) the slave threads are in
# sync and waiting.
--source include/have_debug.inc
--source include/master-slave.inc
# Block legal errors for MTR
call mtr.add_suppression('Found invalid event in binary log');
call mtr.add_suppression('Slave I/O: Relay log write failure: could not queue event from master');
call mtr.add_suppression('event read from binlog did not pass crc check');
call mtr.add_suppression('Replication event checksum verification failed');
call mtr.add_suppression('Event crc check failed! Most likely there is event corruption');
call mtr.add_suppression('Slave SQL: Error initializing relay log position: I/O error reading event at position .*, error.* 1593');
SET @old_master_verify_checksum = @@master_verify_checksum;
# Creating test table/data and set corruption position for testing
--echo # 1. Creating test table/data and set corruption position for testing
--connection master
--echo * insert/update/delete rows in table t1 *
# Corruption algorithm modifies only the first event and
# then will be reset. To avoid checking always the first event
# from binlog (usually it is FD) we randomly execute different
# statements and set position for corruption inside events.
CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY, b VARCHAR(10), c VARCHAR(100));
--disable_query_log
let $i=`SELECT 3+CEILING(10*RAND())`;
let $j=1;
let $pos=0;
while ($i) {
eval INSERT INTO t1 VALUES ($j, 'a', NULL);
if (`SELECT RAND() > 0.7`)
{
eval UPDATE t1 SET c = REPEAT('a', 20) WHERE a = $j;
}
if (`SELECT RAND() > 0.8`)
{
eval DELETE FROM t1 WHERE a = $j;
}
if (!$pos) {
let $pos= query_get_value(SHOW MASTER STATUS, Position, 1);
--sync_slave_with_master
--source include/stop_slave.inc
--disable_query_log
--connection master
}
dec $i;
inc $j;
}
--enable_query_log
# Emulate corruption in binlog file when SHOW BINLOG EVENTS is executing
--echo # 2. Corruption in master binlog and SHOW BINLOG EVENTS
SET GLOBAL debug_dbug="+d,corrupt_read_log_event_char";
--echo SHOW BINLOG EVENTS;
--disable_query_log
send_eval SHOW BINLOG EVENTS FROM $pos;
--enable_query_log
--error ER_ERROR_WHEN_EXECUTING_COMMAND
reap;
SET GLOBAL debug_dbug="-d,corrupt_read_log_event_char";
# Emulate corruption on master with crc checking on master
--echo # 3. Master read a corrupted event from binlog and send the error to slave
# We have a rare but nasty potential race here: if the dump thread on
# the master for the _old_ slave connection has not yet discovered
# that the slave has disconnected, we will inject the corrupt event on
# the wrong connection, and the test will fail
# (+d,corrupt_read_log_event2 corrupts only one event).
# So kill any lingering dump thread (we need to kill; otherwise dump thread
# could manage to send all events down the socket before seeing it close, and
# hang forever waiting for new binlog events to be created).
let $id= `select id from information_schema.processlist where command = "Binlog Dump"`;
if ($id)
{
--disable_query_log
--error 0,1094
eval kill $id;
--enable_query_log
}
let $wait_condition=
SELECT COUNT(*)=0 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE command = 'Binlog Dump';
--source include/wait_condition.inc
SET GLOBAL debug_dbug="+d,corrupt_read_log_event2_set";
--connection slave
START SLAVE IO_THREAD;
let $slave_io_errno= 1236;
--let $slave_timeout= 10
--source include/wait_for_slave_io_error.inc
--connection master
SET GLOBAL debug_dbug="-d,corrupt_read_log_event2_set";
# Emulate corruption on master without crc checking on master
--echo # 4. Master read a corrupted event from binlog and send it to slave
--connection master
SET GLOBAL master_verify_checksum=0;
SET GLOBAL debug_dbug="+d,corrupt_read_log_event2_set";
--connection slave
START SLAVE IO_THREAD;
# When the checksum error is detected, the slave sets error code 1913
# (ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE) in queue_event(), then immediately
# sets error 1595 (ER_SLAVE_RELAY_LOG_WRITE_FAILURE) in handle_slave_io().
# So we usually get 1595, but it is occasionally possible to get 1913.
let $slave_io_errno= 1595,1913;
--source include/wait_for_slave_io_error.inc
--connection master
SET GLOBAL debug_dbug="-d,corrupt_read_log_event2_set";
SET GLOBAL debug_dbug= "";
SET GLOBAL master_verify_checksum=1;
# Emulate corruption in network
--echo # 5. Slave. Corruption in network
--connection slave
SET GLOBAL debug_dbug="+d,corrupt_queue_event";
START SLAVE IO_THREAD;
let $slave_io_errno= 1595,1913;
--source include/wait_for_slave_io_error.inc
SET GLOBAL debug_dbug="-d,corrupt_queue_event";
# Emulate corruption in relay log
--echo # 6. Slave. Corruption in relay log
SET GLOBAL debug_dbug="+d,corrupt_read_log_event_char";
START SLAVE SQL_THREAD;
let $slave_sql_errno= 1593;
--source include/wait_for_slave_sql_error.inc
SET GLOBAL debug_dbug="-d,corrupt_read_log_event_char";
SET GLOBAL debug_dbug= "";
# Start normal replication and compare same table on master
# and slave
--echo # 7. Seek diff for tables on master and slave
--connection slave
--source include/start_slave.inc
--connection master
--sync_slave_with_master
let $diff_tables= master:test.t1, slave:test.t1;
--source include/diff_tables.inc
# Clean up
--echo # 8. Clean up
--connection master
SET GLOBAL debug_dbug= "";
SET GLOBAL master_verify_checksum = @old_master_verify_checksum;
DROP TABLE t1;
--sync_slave_with_master
SET GLOBAL debug_dbug= "";
--source include/rpl_end.inc
This diff is collapsed.
#
# This include file is used by more than one test suite
# (currently rpl and binlog_encryption).
# Please check all dependent tests after modifying it
#
--source include/master-slave.inc
--source include/have_debug.inc
--echo **** On Master ****
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2),(3);
SELECT * FROM t1;
let $debug_save= `SELECT @@GLOBAL.debug`;
SET GLOBAL debug_dbug= '+d,incident_database_resync_on_replace,*';
# This will generate an incident log event and store it in the binary
# log before the replace statement.
REPLACE INTO t1 VALUES (4);
--save_master_pos
SELECT * FROM t1;
--disable_query_log
eval SET GLOBAL debug_dbug= '$debug_save';
--enable_query_log
connection slave;
# Wait until SQL thread stops with error LOST_EVENT on master
call mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occurred on the master.* 1590");
let $slave_sql_errno= 1590;
let $show_slave_sql_error= 1;
source include/wait_for_slave_sql_error.inc;
# The 4 should not be inserted into the table, since the incident log
# event should have stop the slave.
--echo **** On Slave ****
SELECT * FROM t1;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
START SLAVE;
--sync_with_master
# Now, we should have inserted the row into the table and the slave
# should be running. We should also have rotated to a new binary log.
SELECT * FROM t1;
source include/check_slave_is_running.inc;
connection master;
DROP TABLE t1;
--sync_slave_with_master
--source include/rpl_end.inc
#
# This include file is used by more than one test suite
# (currently rpl and binlog_encryption).
# Please check all dependent tests after modifying it
#
######################################################################
# Some errors that cause the slave SQL thread to stop are not shown in
# the Slave_SQL_Error column of "SHOW SLAVE STATUS". Instead, the error
# is only in the server's error log.
#
# Two failures and their respective reporting are verified:
#
# 1 - Failures during slave thread initialization
# 2 - Failures while processing queries passed through the init_slave
# option.
#
# In order to check the first type of failure, we inject a fault in the
# SQL/IO Threads through SET GLOBAL debug.
#
# To check the second type, we set @@global.init_slave to an invalid
# command thus preventing the initialization of the SQL Thread.
#
# Obs:
# 1 - Note that testing failures while initializing the relay log position
# is hard as the same function is called before the code reaches the point
# that we want to test.
#
# 2 - This test does not target failures that are reported while applying
# events such as duplicate keys, errors while reading the relay-log.bin*,
# etc. Such errors are already checked on other tests.
######################################################################
######################################################################
# Configuring the Environment
######################################################################
source include/have_debug.inc;
source include/master-slave.inc;
source include/have_log_bin.inc;
connection slave;
--disable_warnings
stop slave;
--enable_warnings
reset slave;
######################################################################
# Injecting faults in the threads' initialization
######################################################################
connection slave;
# Set debug flags on slave to force errors to occur
SET GLOBAL debug_dbug= "d,simulate_io_slave_error_on_init,simulate_sql_slave_error_on_init";
start slave;
#
# slave is going to stop because of emulated failures
# but there won't be any crashes nor asserts hit.
#
# 1593 = ER_SLAVE_FATAL_ERROR
--let $slave_sql_errno= 1593
--let $show_slave_sql_error= 1
--source include/wait_for_slave_sql_error.inc
call mtr.add_suppression("Failed during slave.* thread initialization");
SET GLOBAL debug_dbug= "";
######################################################################
# Injecting faults in the init_slave option
######################################################################
connection slave;
reset slave;
SET GLOBAL init_slave= "garbage";
start slave;
# 1064 = ER_PARSE_ERROR
--let $slave_sql_errno= 1064
--let $show_slave_sql_error= 1
--source include/wait_for_slave_sql_error.inc
######################################################################
# Clean up
######################################################################
SET GLOBAL init_slave= "";
# Clean up Last_SQL_Error
--source include/stop_slave_io.inc
RESET SLAVE;
--let $rpl_only_running_threads= 1
--source include/rpl_end.inc
#
# This include file is used by more than one test suite
# (currently rpl and binlog_encryption).
# Please check all dependent tests after modifying it
#
# See if "LOAD DATA LOCAL INFILE" is well replicated
# (LOAD DATA LOCAL INFILE is not written to the binlog
# the same way as LOAD DATA INFILE : Append_blocks are smaller).
# In MySQL 4.0 <4.0.12 there were 2 bugs with LOAD DATA LOCAL INFILE :
# - the loaded file was not written entirely to the master's binlog,
# only the first 4KB, 8KB or 16KB usually.
# - the loaded file's first line was not written entirely to the
# master's binlog (1st char was absent)
source include/master-slave.inc;
create table t1(a int);
let $1=10000;
disable_query_log;
set SQL_LOG_BIN=0;
while ($1)
{
insert into t1 values(1);
dec $1;
}
set SQL_LOG_BIN=1;
enable_query_log;
let $MYSQLD_DATADIR= `select @@datadir`;
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
eval select * into outfile '$MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' from t1;
#This will generate a 20KB file, now test LOAD DATA LOCAL
truncate table t1;
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
eval load data local infile '$MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' into table t1;
--remove_file $MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile
sync_slave_with_master;
select a,count(*) from t1 group by a;
connection master;
drop table t1;
sync_slave_with_master;
# End of 4.1 tests
#
# Now let us test how well we replicate LOAD DATA LOCAL in situation when
# we met duplicates in tables to which we are adding rows.
# (It supposed that LOAD DATA LOCAL ignores such errors)
#
connection master;
create table t1(a int);
insert into t1 values (1), (2), (2), (3);
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
eval select * into outfile '$MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' from t1;
drop table t1;
create table t1(a int primary key);
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
eval load data local infile '$MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' into table t1;
--remove_file $MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile
SELECT * FROM t1 ORDER BY a;
save_master_pos;
connection slave;
sync_with_master;
SELECT * FROM t1 ORDER BY a;
connection master;
drop table t1;
save_master_pos;
connection slave;
sync_with_master;
#
# Bug22504 load data infile sql statement in replication architecture get error
#
--echo ==== Bug22504 Initialize ====
--echo [on master]
--connection master
SET sql_mode='ignore_space';
CREATE TABLE t1(a int);
insert into t1 values (1), (2), (3), (4);
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
eval select * into outfile '$MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' from t1;
truncate table t1;
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
eval load data local infile '$MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' into table t1;
--remove_file $MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile
SELECT * FROM t1 ORDER BY a;
--echo [on slave]
sync_slave_with_master;
SELECT * FROM t1 ORDER BY a;
--echo ==== Clean up ====
--echo [on master]
connection master;
DROP TABLE t1;
--echo [on slave]
sync_slave_with_master;
--echo
--echo Bug #43746:
--echo "return wrong query string when parse 'load data infile' sql statement"
--echo
--echo [master]
connection master;
let $MYSQLD_DATADIR= `select @@datadir`;
SELECT @@SESSION.sql_mode INTO @old_mode;
SET sql_mode='ignore_space';
CREATE TABLE t1(a int);
INSERT INTO t1 VALUES (1), (2), (3), (4);
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
eval SELECT * INTO OUTFILE '$MYSQLD_DATADIR/bug43746.sql' FROM t1;
TRUNCATE TABLE t1;
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
eval LOAD DATA LOCAL INFILE '$MYSQLD_DATADIR/bug43746.sql' INTO TABLE t1;
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
eval LOAD/* look mum, with comments in weird places! */DATA/* oh hai */LOCAL INFILE '$MYSQLD_DATADIR/bug43746.sql'/* we are */INTO/* from the internets */TABLE t1;
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
eval LOAD DATA/*!10000 LOCAL */INFILE '$MYSQLD_DATADIR/bug43746.sql' INTO TABLE t1;
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
eval LOAD DATA LOCAL INFILE '$MYSQLD_DATADIR/bug43746.sql' /*!10000 INTO */ TABLE t1;
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
eval LOAD DATA LOCAL INFILE '$MYSQLD_DATADIR/bug43746.sql' /*!10000 INTO TABLE */ t1;
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
eval LOAD DATA /*!10000 LOCAL INFILE '$MYSQLD_DATADIR/bug43746.sql' INTO TABLE */ t1;
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
eval LOAD DATA/*!10000 LOCAL */INFILE '$MYSQLD_DATADIR/bug43746.sql'/*!10000 INTO*/TABLE t1;
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
eval LOAD DATA/*!10000 LOCAL */INFILE '$MYSQLD_DATADIR/bug43746.sql'/* empty */INTO TABLE t1;
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
eval LOAD DATA/*!10000 LOCAL */INFILE '$MYSQLD_DATADIR/bug43746.sql' INTO/* empty */TABLE t1;
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
eval LOAD/*!999999 special comments that do not expand */DATA/*!999999 code from the future */LOCAL INFILE '$MYSQLD_DATADIR/bug43746.sql'/*!999999 have flux capacitor */INTO/*!999999 will travel */TABLE t1;
SET sql_mode='PIPES_AS_CONCAT,ANSI_QUOTES,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER';
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
eval LOAD DATA LOCAL INFILE '$MYSQLD_DATADIR/bug43746.sql' INTO TABLE t1;
--echo [slave]
sync_slave_with_master;
--echo
--echo Bug #59267:
--echo "LOAD DATA LOCAL INFILE not executed on slave with SBR"
--echo
--echo [master]
connection master;
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
eval SELECT * INTO OUTFILE '$MYSQLD_DATADIR/bug59267.sql' FROM t1;
TRUNCATE TABLE t1;
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
eval LOAD DATA LOCAL INFILE '$MYSQLD_DATADIR/bug59267.sql' INTO TABLE t1;
SELECT 'Master', COUNT(*) FROM t1;
--echo [slave]
--sync_slave_with_master
SELECT 'Slave', COUNT(*) FROM t1;
# cleanup
--echo [master]
connection master;
--remove_file $MYSQLD_DATADIR/bug43746.sql
--remove_file $MYSQLD_DATADIR/bug59267.sql
DROP TABLE t1;
SET SESSION sql_mode=@old_mode;
--echo [slave]
sync_slave_with_master;
connection master;
--echo
--echo Bug #60580/#11902767:
--echo "statement improperly replicated crashes slave sql thread"
--echo
--echo [master]
connection master;
let $MYSQLD_DATADIR= `select @@datadir`;
CREATE TABLE t1(f1 INT, f2 INT);
CREATE TABLE t2(f1 INT, f2 TIMESTAMP);
INSERT INTO t2 VALUES(1, '2011-03-22 21:01:28');
INSERT INTO t2 VALUES(2, '2011-03-21 21:01:28');
INSERT INTO t2 VALUES(3, '2011-03-20 21:01:28');
CREATE TABLE t3 AS SELECT * FROM t2;
CREATE VIEW v1 AS SELECT * FROM t2
WHERE f1 IN (SELECT f1 FROM t3 WHERE (t3.f2 IS NULL));
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
eval SELECT 1 INTO OUTFILE '$MYSQLD_DATADIR/bug60580.csv' FROM DUAL;
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
eval LOAD DATA LOCAL INFILE '$MYSQLD_DATADIR/bug60580.csv' INTO TABLE t1 (@f1) SET f2 = (SELECT f1 FROM v1 WHERE f1=@f1);
SELECT * FROM t1;
sleep 1;
--echo [slave]
sync_slave_with_master;
SELECT * FROM t1;
--remove_file $MYSQLD_DATADIR/bug60580.csv
--echo [master]
connection master;
DROP VIEW v1;
DROP TABLE t1, t2, t3;
--echo [slave]
sync_slave_with_master;
connection master;
--source include/rpl_end.inc
--echo # End of 5.1 tests
#
# This include file is used by more than one test suite
# (currently rpl and binlog_encryption).
# Please check all dependent tests after modifying it
#
#############################################################################
# Original Author: JBM #
# Original Date: Aug/18/2005 #
#############################################################################
# TEST: To test the LOAD_FILE() in rbr #
#############################################################################
# Change Author: JBM
# Change Date: 2006-01-16
##########
# Includes
-- source include/have_binlog_format_mixed_or_row.inc
-- source include/master-slave.inc
-- source extra/rpl_tests/rpl_loadfile.test
# BUG#39701: Mixed binlog format does not switch to row mode on LOAD_FILE
#
# DESCRIPTION
#
# Problem: when using load_file string function and mixed binlogging format
# there was no switch to row based binlogging format. This leads
# to scenarios on which the slave replicates the statement and it
# will try to load the file from local file system, which in most
# likely it will not exist.
#
# Solution:
# Marking this function as unsafe for statement format, makes the
# statement using it to be logged in row based format. As such, data
# replicated from the master, becomes the content of the loaded file.
# Consequently, the slave receives the necessary data to complete
# the load_file instruction correctly.
#
# IMPLEMENTATION
#
# The test is implemented as follows:
#
# On Master,
# i) write to file the desired content.
# ii) create table and stored procedure with load_file
# iii) stop slave
# iii) execute load_file
# iv) remove file
#
# On Slave,
# v) start slave
# vi) sync it with master so that it gets the updates from binlog (which
# should have bin logged in row format).
#
# If the the binlog format does not change to row, then the assertion
# done in the following step fails. This happens because tables differ
# since the file does not exist anymore, meaning that when slave
# attempts to execute LOAD_FILE statement it inserts NULL on table
# instead of the same contents that the master loaded when it executed
# the procedure (which was executed when file existed).
#
# vii) assert that the contents of master and slave
# table are the same
--source include/rpl_reset.inc
connection master;
let $file= $MYSQLTEST_VARDIR/tmp/bug_39701.data;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--eval SELECT repeat('x',20) INTO OUTFILE '$file'
disable_warnings;
DROP TABLE IF EXISTS t1;
enable_warnings;
CREATE TABLE t1 (t text);
DELIMITER |;
CREATE PROCEDURE p(file varchar(4096))
BEGIN
INSERT INTO t1 VALUES (LOAD_FILE(file));
END|
DELIMITER ;|
# stop slave before issuing the load_file on master
connection slave;
source include/stop_slave.inc;
connection master;
# test: check that logging falls back to rbr.
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--eval CALL p('$file')
# test: remove the file from the filesystem and assert that slave still
# gets the loaded file
remove_file $file;
# now that the file is removed it is safe (regarding what we want to test)
# to start slave
connection slave;
source include/start_slave.inc;
connection master;
sync_slave_with_master;
# assertion: assert that the slave got the updates even
# if the file was removed before the slave started,
# meaning that contents were indeed transfered
# through binlog (in row format)
let $diff_tables= master:t1, slave:t1;
source include/diff_tables.inc;
# CLEAN UP
--connection master
DROP TABLE t1;
DROP PROCEDURE p;
--source include/rpl_end.inc
#
# This include file is used by more than one test suite
# (currently rpl and binlog_encryption).
# Please check all dependent tests after modifying it
#
# ==== Purpose ====
#
# Check replication protocol packet size handling
#
# ==== Related bugs ====
# Bug#19402 SQL close to the size of the max_allowed_packet fails on slave
# BUG#23755: Replicated event larger that max_allowed_packet infinitely re-transmits
# BUG#42914: No LAST_IO_ERROR for max_allowed_packet errors
# BUG#55322: SHOW BINLOG EVENTS increases @@SESSION.MAX_ALLOWED_PACKET
# 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 'slave_max_allowed_packet' bytes, .*error.* 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;
enable_warnings;
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;
sync_slave_with_master;
# Restart slave for setting to take effect
source include/stop_slave.inc;
source include/start_slave.inc;
# Reconnect to master for new setting to take effect
disconnect master;
# alas, can't use eval here; if db name changed apply the change here
connect (master,localhost,root,,DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________);
connection master;
select @@net_buffer_length, @@max_allowed_packet;
create table `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1023');
sync_slave_with_master;
eval select count(*) from `$db`.`t1` /* must be 1 */;
SHOW STATUS LIKE 'Slave_running';
select * from information_schema.session_status where variable_name= 'SLAVE_RUNNING';
connection master;
eval drop database $db;
sync_slave_with_master;
#
# Bug #23755: Replicated event larger that max_allowed_packet infinitely re-transmits
#
# Check that a situation when the size of event on the master is greater than
# max_allowed_packet on the slave does not lead to infinite re-transmits.
connection master;
# Change the max packet size on master
SET @@global.max_allowed_packet=4096;
SET @@global.net_buffer_length=4096;
# Restart slave for new setting to take effect
connection slave;
source include/stop_slave.inc;
source include/start_slave.inc;
# Reconnect to master for new setting to take effect
disconnect master;
connect (master, localhost, root);
connection master;
CREATE TABLE `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
sync_slave_with_master;
connection master;
INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2048');
#
# Bug#42914: The slave I/O thread must stop after trying to read the above
# event, However there is no Last_IO_Error report.
#
# The slave I/O thread must stop after trying to read the above event
connection slave;
# 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
# TODO: this is needed because of BUG#55790. Remove once that is fixed.
--source include/stop_slave_sql.inc
#
# Bug#42914: On the master, if a binary log event is larger than
# max_allowed_packet, the error message ER_MASTER_FATAL_ERROR_READING_BINLOG
# is sent to a slave when it requests a dump from the master, thus leading the
# I/O thread to stop. However, there is no Last_IO_Error reported.
#
--let $rpl_only_running_threads= 1
--source include/rpl_reset.inc
--connection master
DROP TABLE t1;
--sync_slave_with_master
connection master;
CREATE TABLE t1 (f1 int PRIMARY KEY, f2 LONGTEXT, f3 LONGTEXT) ENGINE=MyISAM;
sync_slave_with_master;
connection master;
INSERT INTO t1(f1, f2, f3) VALUES(1, REPEAT('a', @@global.max_allowed_packet), REPEAT('b', @@global.max_allowed_packet));
connection slave;
# The slave I/O thread must stop after receiving
# 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.
STOP SLAVE;
RESET SLAVE;
--connection master
RESET MASTER;
#
# BUG#55322: SHOW BINLOG EVENTS increases @@SESSION.MAX_ALLOWED_PACKET
#
# In BUG#55322, @@session.max_allowed_packet increased each time SHOW
# BINLOG EVENTS was issued. To verify that this bug is fixed, we
# execute SHOW BINLOG EVENTS twice and check that max_allowed_packet
# never changes. We turn off the result log because we don't care
# about the contents of the binlog.
--disable_result_log
SET @max_allowed_packet_0= @@session.max_allowed_packet;
SHOW BINLOG EVENTS;
SET @max_allowed_packet_1= @@session.max_allowed_packet;
SHOW BINLOG EVENTS;
SET @max_allowed_packet_2= @@session.max_allowed_packet;
--enable_result_log
if (`SELECT NOT(@max_allowed_packet_0 = @max_allowed_packet_1 AND @max_allowed_packet_1 = @max_allowed_packet_2)`)
{
--echo ERROR: max_allowed_packet changed after executing SHOW BINLOG EVENTS
--source include/show_rpl_debug_info.inc
SELECT @max_allowed_packet_0, @max_allowed_packet_1, @max_allowed_packet_2;
--die @max_allowed_packet changed after executing SHOW BINLOG EVENTS
}
--echo ==== clean up ====
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;
# Clear Last_IO_Error
RESET SLAVE;
--source include/rpl_end.inc
# End of tests
This diff is collapsed.
#
# This include file is used by more than one test suite
# (currently rpl and binlog_encryption).
# Please check all dependent tests after modifying it
#
# BUG#13979418: SHOW BINLOG EVENTS MAY CRASH THE SERVER
#
# The function mysql_show_binlog_events has a local stack variable
# 'LOG_INFO linfo;', which is assigned to thd->current_linfo, however
# this variable goes out of scope and is destroyed before clean
# thd->current_linfo.
#
# This test case runs SHOW BINLOG EVENTS and FLUSH LOGS to make sure
# that with the fix local variable linfo is valid along all
# mysql_show_binlog_events function scope.
#
--source include/have_debug_sync.inc
--source include/master-slave.inc
--echo [connection slave]
--connection slave
SET DEBUG_SYNC= 'after_show_binlog_events SIGNAL on_show_binlog_events WAIT_FOR end';
--send SHOW BINLOG EVENTS
--connection slave1
--echo [connection slave1]
SET DEBUG_SYNC= 'now WAIT_FOR on_show_binlog_events';
FLUSH LOGS;
SET DEBUG_SYNC= 'now SIGNAL end';
--echo [connection slave]
--connection slave
--disable_result_log
--reap
--enable_result_log
SET DEBUG_SYNC= 'RESET';
--connection master
--source include/rpl_end.inc
#
# This include file is used by more than one test suite
# (currently rpl and binlog_encryption).
# Please check all dependent tests after modifying it
#
#######################################################
# Wrapper for rpl_relayrotate.test to allow multi #
# Engines to reuse test code. By JBM 2006-02-15 #
#######################################################
-- source include/have_innodb.inc
# Slow test, don't run during staging part
-- source include/not_staging.inc
-- source include/master-slave.inc
let $engine_type=innodb;
-- source extra/rpl_tests/rpl_relayrotate.test
--source include/rpl_end.inc
This diff is collapsed.
This diff is collapsed.
#
# This include file is used by more than one test suite
# (currently rpl and binlog_encryption).
# Please check all dependent tests after modifying it
#
################################################################################
# Bug#19855907 IO THREAD AUTHENTICATION ISSUE WITH SOME CHARACTER SETS
# Problem: IO thread fails to connect to master if servers are configured with
# special character sets like utf16, utf32, ucs2.
#
# Analysis: MySQL server does not support few special character sets like
# utf16,utf32 and ucs2 as "client's character set"(eg: utf16,utf32, ucs2).
# When IO thread is trying to connect to Master, it sets server's character
# set as client's character set. When Slave server is started with these
# special character sets, IO thread (a connection to Master) fails because
# of the above said reason.
#
# Fix: If server's character set is not supported as client's character set,
# then set default's client character set(latin1) as client's character set.
###############################################################################
--source include/master-slave.inc
call mtr.add_suppression("Cannot use utf16 as character_set_client");
CREATE TABLE t1(i VARCHAR(20));
INSERT INTO t1 VALUES (0xFFFF);
--sync_slave_with_master
--let diff_tables=master:t1, slave:t1
--source include/diff_tables.inc
# Cleanup
--connection master
DROP TABLE t1;
--source include/rpl_end.inc
#
# This include file is used by more than one test suite
# (currently rpl and binlog_encryption).
# Please check all dependent tests after modifying it
#
# test to see if replication can continue when master sporadically fails on
# COM_BINLOG_DUMP and additionally limits the number of events per dump
source include/master-slave.inc;
create table t2(n int);
create table t1(n int not null auto_increment primary key);
insert into t1 values (NULL),(NULL);
truncate table t1;
# We have to use 4 in the following to make this test work with all table types
insert into t1 values (4),(NULL);
sync_slave_with_master;
--source include/stop_slave.inc
--source include/start_slave.inc
connection master;
insert into t1 values (NULL),(NULL);
flush logs;
truncate table t1;
insert into t1 values (10),(NULL),(NULL),(NULL),(NULL),(NULL);
sync_slave_with_master;
select * from t1 ORDER BY n;
connection master;
drop table t1,t2;
sync_slave_with_master;
--source include/rpl_end.inc
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -170,6 +170,7 @@ my @DEFAULT_SUITES= qw(
main-
archive-
binlog-
binlog_encryption-
csv-
encryption-
federated-
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
--let $use_remote_mysqlbinlog= 1
--source extra/binlog_tests/binlog_incident.inc
This diff is collapsed.
--source extra/binlog_tests/binlog_index.inc
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment