mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 21:12:26 +01:00
b55468d713
mysql-test/include/wait_for_slave_io_to_stop.inc: Updated previous commit to include Magnus's change request from review. In addition, I moved it from the mysql-5.1 to mysql-5.1-maint clone. We now have 3 new replications tools and one tool that has been refactored. 1) include/wait_for_slave_to_stop.inc replaces the old mysqltest.c wait_for_slave_to_stop. NEW: 2) include/wait_for_slave_sql_to_stop.inc is for when you are expecting the slave to get an SQL error and waiting for the SQL Thread to stop. 3) include/wait_for_slave_io_to_stop.inc is used for test that you expect sometype of IO error and the IO Thread to stop. 4) include/wait_for_slave_to_start.inc for waiting for the slave to completely start before moving forward in the test. All 4 tests have a built in loop that will stop the test if any of the tools take too long. mysql-test/include/wait_for_slave_sql_to_stop.inc: Updated previous commit to include Magnus's change request from review. In addition, I moved it from the mysql-5.1 to mysql-5.1-maint clone. We now have 3 new replications tools and one tool that has been refactored. 1) include/wait_for_slave_to_stop.inc replaces the old mysqltest.c wait_for_slave_to_stop. NEW: 2) include/wait_for_slave_sql_to_stop.inc is for when you are expecting the slave to get an SQL error and waiting for the SQL Thread to stop. 3) include/wait_for_slave_io_to_stop.inc is used for test that you expect sometype of IO error and the IO Thread to stop. 4) include/wait_for_slave_to_start.inc for waiting for the slave to completely start before moving forward in the test. All 4 tests have a built in loop that will stop the test if any of the tools take too long. mysql-test/include/wait_for_slave_to_start.inc: Updated previous commit to include Magnus's change request from review. In addition, I moved it from the mysql-5.1 to mysql-5.1-maint clone. We now have 3 new replications tools and one tool that has been refactored. 1) include/wait_for_slave_to_stop.inc replaces the old mysqltest.c wait_for_slave_to_stop. NEW: 2) include/wait_for_slave_sql_to_stop.inc is for when you are expecting the slave to get an SQL error and waiting for the SQL Thread to stop. 3) include/wait_for_slave_io_to_stop.inc is used for test that you expect sometype of IO error and the IO Thread to stop. 4) include/wait_for_slave_to_start.inc for waiting for the slave to completely start before moving forward in the test. All 4 tests have a built in loop that will stop the test if any of the tools take too long. mysql-test/include/wait_for_slave_to_stop.inc: Updated previous commit to include Magnus's change request from review. In addition, I moved it from the mysql-5.1 to mysql-5.1-maint clone. We now have 3 new replications tools and one tool that has been refactored. 1) include/wait_for_slave_to_stop.inc replaces the old mysqltest.c wait_for_slave_to_stop. NEW: 2) include/wait_for_slave_sql_to_stop.inc is for when you are expecting the slave to get an SQL error and waiting for the SQL Thread to stop. 3) include/wait_for_slave_io_to_stop.inc is used for test that you expect sometype of IO error and the IO Thread to stop. 4) include/wait_for_slave_to_start.inc for waiting for the slave to completely start before moving forward in the test. All 4 tests have a built in loop that will stop the test if any of the tools take too long. mysql-test/t/rpl_critical_errors.test: Updated to use new tool(s) mysql-test/t/rpl_dual_pos_advance.test: Updated to use new tool(s) mysql-test/t/rpl_known_bugs_detection.test: Updated to use new tool(s) mysql-test/t/rpl_rotate_logs.test: Updated to use new tool(s) mysql-test/t/rpl_row_inexist_tbl.test: Updated to use new tool(s) mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test: Updated to use new tool(s) mysql-test/extra/rpl_tests/rpl_loaddata.test: Updated to use new tool(s) mysql-test/extra/rpl_tests/rpl_row_tabledefs.test: Updated to use new tool(s) mysql-test/extra/rpl_tests/rpl_stm_000001.test: Updated to use new tool(s) mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test: Updated to use new tool(s)
132 lines
3.4 KiB
Text
132 lines
3.4 KiB
Text
-- source include/have_binlog_format_mixed_or_statement.inc
|
|
-- source include/master-slave.inc
|
|
|
|
create table t1 (word char(20) not null);
|
|
load data infile '../std_data_ln/words.dat' into table t1;
|
|
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
|
|
eval load data local infile '$MYSQL_TEST_DIR/std_data/words.dat' into table t1;
|
|
select * from t1 limit 10;
|
|
|
|
#
|
|
# Test slave with wrong password
|
|
#
|
|
save_master_pos;
|
|
connection slave;
|
|
sync_with_master;
|
|
stop slave;
|
|
connection master;
|
|
set password for root@"localhost" = password('foo');
|
|
connection slave;
|
|
start slave;
|
|
connection master;
|
|
#
|
|
# Give slave time to do at last one failed connect retry
|
|
# This one must be short so that the slave will not stop retrying
|
|
real_sleep 2;
|
|
set password for root@"localhost" = password('');
|
|
# Give slave time to connect (will retry every second)
|
|
sleep 2;
|
|
|
|
create table t3(n int);
|
|
insert into t3 values(1),(2);
|
|
save_master_pos;
|
|
connection slave;
|
|
sync_with_master;
|
|
select * from t3;
|
|
select sum(length(word)) from t1;
|
|
connection master;
|
|
drop table t1,t3;
|
|
save_master_pos;
|
|
connection slave;
|
|
sync_with_master;
|
|
|
|
# Test if the slave SQL thread can be more than 16K behind the slave
|
|
# I/O thread (> IO_SIZE)
|
|
|
|
connection master;
|
|
# we'll use table-level locking to delay slave SQL thread
|
|
eval create table t1 (n int) engine=$engine_type;
|
|
sync_slave_with_master;
|
|
connection master;
|
|
reset master;
|
|
connection slave;
|
|
stop slave;
|
|
reset slave;
|
|
|
|
connection master;
|
|
let $1=5000;
|
|
# Generate 16K of relay log
|
|
disable_query_log;
|
|
while ($1)
|
|
{
|
|
eval insert into t1 values($1);
|
|
dec $1;
|
|
}
|
|
enable_query_log;
|
|
|
|
# Try to cause a large relay log lag on the slave by locking t1
|
|
connection slave;
|
|
lock tables t1 read;
|
|
start slave;
|
|
#hope this is long enough for I/O thread to fetch over 16K relay log data
|
|
sleep 3;
|
|
unlock tables;
|
|
|
|
#test handling of aborted connection in the middle of update
|
|
|
|
connection master;
|
|
create table t2(id int);
|
|
insert into t2 values(connection_id());
|
|
save_master_pos;
|
|
|
|
connection master1;
|
|
# Avoid generating result
|
|
create temporary table t3(n int);
|
|
insert into t3 select get_lock('crash_lock%20C', 1) from t2;
|
|
|
|
connection master;
|
|
send update t1 set n = n + get_lock('crash_lock%20C', 2);
|
|
connection master1;
|
|
sleep 3;
|
|
select (@id := id) - id from t2;
|
|
kill @id;
|
|
# We don't drop t3 as this is a temporary table
|
|
drop table t2;
|
|
connection master;
|
|
--error 1053,2013
|
|
reap;
|
|
connection slave;
|
|
# The SQL slave thread should now have stopped because the query was killed on
|
|
# the master (so it has a non-zero error code in the binlog).
|
|
--source include/wait_for_slave_sql_to_stop.inc
|
|
|
|
# The following test can't be done because the result of Pos will differ
|
|
# on different computers
|
|
# --replace_result $MASTER_MYPORT MASTER_PORT
|
|
# show slave status;
|
|
|
|
set global sql_slave_skip_counter=1;
|
|
start slave;
|
|
select count(*) from t1;
|
|
connection master1;
|
|
drop table t1;
|
|
create table t1 (n int);
|
|
insert into t1 values(3456);
|
|
insert into mysql.user (Host, User, Password)
|
|
VALUES ("10.10.10.%", "blafasel2", password("blafasel2"));
|
|
select select_priv,user from mysql.user where user = _binary'blafasel2';
|
|
update mysql.user set Select_priv = "Y" where User= _binary"blafasel2";
|
|
select select_priv,user from mysql.user where user = _binary'blafasel2';
|
|
save_master_pos;
|
|
connection slave;
|
|
sync_with_master;
|
|
select n from t1;
|
|
select select_priv,user from mysql.user where user = _binary'blafasel2';
|
|
connection master1;
|
|
drop table t1;
|
|
delete from mysql.user where user="blafasel2";
|
|
save_master_pos;
|
|
connection slave;
|
|
sync_with_master;
|
|
|
|
# End of 4.1 tests
|