Commit 36b12d88 authored by Serge Kozlov's avatar Serge Kozlov

Bug#38603:

The patch adds restart of mysql server and replacing of binlog file 
when mysql server is stopped.
parent 176a7881
...@@ -862,6 +862,9 @@ drop table t21,t31; ...@@ -862,6 +862,9 @@ drop table t21,t31;
drop table t11; drop table t11;
STOP SLAVE; STOP SLAVE;
FLUSH LOGS; FLUSH LOGS;
--> Stop master server
--> Start master server
--> Master binlog: Server ver: 5.0.16-debug-log, Binlog ver: 4
RESET SLAVE; RESET SLAVE;
START SLAVE; START SLAVE;
SELECT MASTER_POS_WAIT('master-bin.000001', 513) >= 0; SELECT MASTER_POS_WAIT('master-bin.000001', 513) >= 0;
......
...@@ -46,9 +46,7 @@ insert into t2 values(NULL,0),(500,0); ...@@ -46,9 +46,7 @@ insert into t2 values(NULL,0),(500,0);
select a,b, truncate(rand_value,4) from t1; select a,b, truncate(rand_value,4) from t1;
select * from t2; select * from t2;
select a,name, old_a, old_b, truncate(rand_value,4) from t3; select a,name, old_a, old_b, truncate(rand_value,4) from t3;
save_master_pos; sync_slave_with_master;
connection slave;
sync_with_master;
--disable_query_log --disable_query_log
select "--- On slave --" as ""; select "--- On slave --" as "";
--enable_query_log --enable_query_log
...@@ -108,9 +106,7 @@ SELECT trigger_name, definer ...@@ -108,9 +106,7 @@ SELECT trigger_name, definer
FROM information_schema.triggers FROM information_schema.triggers
WHERE trigger_name = 't1_first'; WHERE trigger_name = 't1_first';
save_master_pos; sync_slave_with_master;
connection slave;
sync_with_master;
--disable_query_log --disable_query_log
select "--- On slave --" as ""; select "--- On slave --" as "";
--enable_query_log --enable_query_log
...@@ -165,9 +161,7 @@ create database other; ...@@ -165,9 +161,7 @@ create database other;
use other; use other;
insert into test.t1 values (1); insert into test.t1 values (1);
save_master_pos; sync_slave_with_master;
connection slave;
sync_with_master;
connection master; connection master;
use test; use test;
...@@ -304,9 +298,29 @@ STOP SLAVE; ...@@ -304,9 +298,29 @@ STOP SLAVE;
connection master; connection master;
let $MYSQLD_DATADIR= `select @@datadir`; let $MYSQLD_DATADIR= `select @@datadir`;
FLUSH LOGS; FLUSH LOGS;
# Stop master server
--echo --> Stop master server
--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
wait
EOF
--shutdown_server 10
--source include/wait_until_disconnected.inc
# Replace binlog
remove_file $MYSQLD_DATADIR/master-bin.000001; remove_file $MYSQLD_DATADIR/master-bin.000001;
copy_file $MYSQL_TEST_DIR/std_data/bug16266.000001 $MYSQLD_DATADIR/master-bin.000001; copy_file $MYSQL_TEST_DIR/std_data/bug16266.000001 $MYSQLD_DATADIR/master-bin.000001;
--echo --> Start master server
--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
restart
EOF
--enable_reconnect
--source include/wait_until_connected_again.inc
let $binlog_version= query_get_value(SHOW BINLOG EVENTS, Info, 1);
# Make the slave to replay the new binlog.
--echo --> Master binlog: $binlog_version
# Make the slave to replay the new binlog. # Make the slave to replay the new binlog.
connection slave; connection slave;
...@@ -381,9 +395,7 @@ DROP TABLE IF EXISTS t2; ...@@ -381,9 +395,7 @@ DROP TABLE IF EXISTS t2;
--echo --echo
--echo ---> Synchronizing slave with master... --echo ---> Synchronizing slave with master...
--save_master_pos --sync_slave_with_master
--connection slave
--sync_with_master
--echo --echo
--echo ---> connection: master --echo ---> connection: master
...@@ -415,9 +427,7 @@ SELECT * FROM t2; ...@@ -415,9 +427,7 @@ SELECT * FROM t2;
--echo --echo
--echo ---> Synchronizing slave with master... --echo ---> Synchronizing slave with master...
--save_master_pos --sync_slave_with_master
--connection slave
--sync_with_master
--echo ---> connection: master --echo ---> connection: master
...@@ -439,9 +449,7 @@ SELECT * FROM t2; ...@@ -439,9 +449,7 @@ SELECT * FROM t2;
DROP TABLE t1; DROP TABLE t1;
DROP TABLE t2; DROP TABLE t2;
--save_master_pos --sync_slave_with_master
--connection slave
--sync_with_master
--connection master --connection master
# #
......
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