mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 05:22:25 +01:00
5ec3a67132
rli->save_temporary_tables and slave_open_temp_tables (in old 4.0 you could make "SHOW STATUS LIKE 'slave_open_temp_tables'" grow indefinitely by doing RESET SLAVE and replicating always the same CREATE TEMPORARY TABLE). It's critical to reset save_temporary_tables to 0 (otherwise you may later read memory which has been freed) so this changeset should go into 4.1. mysql-test/r/rpl_reset_slave.result: result update mysql-test/t/rpl_reset_slave.test: test for RESET SLAVE and creating twice the same temp table in the slave. sql/slave.cc: when we delete the slave's temp tables (when slave server shuts down and when RESET SLAVE), we reset 2 variables: rli->save_temporary_tables & slave_open_temp_tables.
44 lines
1.1 KiB
Text
44 lines
1.1 KiB
Text
# See SHOW SLAVE STATUS displays well after RESET SLAVE (it should display the
|
|
# --master-* options from mysqld, as this is what is going to be used next time
|
|
# slave threads will be started). In bug 985, it displayed old values (of before
|
|
# RESET SLAVE).
|
|
# See if slave crashes when doing a CREATE TEMPORARY TABLE twice, separated by
|
|
# RESET SLAVE.
|
|
|
|
source include/master-slave.inc;
|
|
connection master;
|
|
save_master_pos;
|
|
connection slave;
|
|
sync_with_master;
|
|
--replace_result $MASTER_MYPORT MASTER_PORT
|
|
show slave status;
|
|
|
|
stop slave;
|
|
change master to master_user='test';
|
|
--replace_result $MASTER_MYPORT MASTER_PORT
|
|
show slave status;
|
|
|
|
reset slave;
|
|
--replace_result $MASTER_MYPORT MASTER_PORT
|
|
show slave status;
|
|
|
|
start slave;
|
|
sync_with_master;
|
|
--replace_result $MASTER_MYPORT MASTER_PORT
|
|
show slave status;
|
|
|
|
# test of crash with temp tables & RESET SLAVE
|
|
# (test to see if RESET SLAVE clears temp tables in memory and disk)
|
|
stop slave;
|
|
reset slave;
|
|
start slave;
|
|
connection master;
|
|
create temporary table t1 (a int);
|
|
save_master_pos;
|
|
connection slave;
|
|
sync_with_master;
|
|
stop slave;
|
|
reset slave;
|
|
start slave;
|
|
sync_with_master;
|
|
show status like 'slave_open_temp_tables';
|