mariadb/mysql-test/t/rpl_max_relay_size.test
unknown 8b8647ff42 Cleanup after test cases
mysql-test/r/init_connect.result:
  Restore global variable to the value it's set to when server is started
mysql-test/r/key_cache.result:
  Restore global variable values to original
mysql-test/r/mysqldump.result:
  Drop the user that was created. Specifying "drop user myDB_user" is equal to "drop user myDB_user@%"
mysql-test/r/rpl_deadlock.result:
  Restore global variable values to original
mysql-test/r/rpl_drop_db.result:
  Remove the conflicting file and drop database mysqltest1 before test exits
mysql-test/r/rpl_ignore_revoke.result:
  As changes to mysql.* are ignored - explicitly delete the user on slave
mysql-test/r/rpl_init_slave.result:
  Restore global variable values to original
mysql-test/r/rpl_max_relay_size.result:
  Restore global variable values to original
mysql-test/r/rpl_sp.result:
  Restore global variable values to original
mysql-test/r/rpl_timezone.result:
  Restore global variable values to original
mysql-test/r/rpl_variables.result:
  Restore global variable values to original
mysql-test/r/view_grant.result:
  Use same user in all places in the same test "readonly" is equal to "readonly@%" not "readonly@localhost"
mysql-test/t/init_connect.test:
  Restore global variable to the value it's set to when server is started
mysql-test/t/key_cache.test:
  Restore global variable values to original
mysql-test/t/mysqldump.test:
  Drop the user that was created. Specifying "drop user myDB_user" is equal to "drop user myDB_user@%"
mysql-test/t/rpl_deadlock.test:
  Restore global variable values to original
mysql-test/t/rpl_drop_db.test:
  Remove the conflicting file and drop database mysqltest1 before test exits
mysql-test/t/rpl_ignore_revoke.test:
  As changes to mysql.* are ignored - explicitly delete the user on slave
mysql-test/t/rpl_init_slave.test:
  Restore global variable values to original
mysql-test/t/rpl_max_relay_size.test:
  Restore global variable values to original
mysql-test/t/rpl_sp.test:
  Restore global variable values to original
mysql-test/t/rpl_timezone.test:
  Restore global variable values to original
mysql-test/t/rpl_variables.test:
  Restore global variable values to original
mysql-test/t/view_grant.test:
  Use same user in all places in the same test "readonly" is equal to "readonly@%" not "readonly@localhost"
2006-11-15 10:23:27 +01:00

137 lines
3 KiB
Text

# Test of options max_binlog_size and max_relay_log_size and
# how they act (if max_relay_log_size == 0, use max_binlog_size
# for relay logs too).
# Test of manual relay log rotation with FLUSH LOGS.
source include/master-slave.inc;
connection slave;
stop slave;
connection master;
--echo #
--echo # Generate a big enough master's binlog to cause relay log rotations
--echo #
create table t1 (a int);
let $1=800;
disable_query_log;
begin;
while ($1)
{
# eval means expand $ expressions
eval insert into t1 values( $1 );
dec $1;
}
enable_query_log;
drop table t1;
save_master_pos;
connection slave;
reset slave;
--echo #
--echo # Test 1
--echo #
set @my_max_binlog_size= @@global.max_binlog_size;
set global max_binlog_size=8192;
set global max_relay_log_size=8192-1; # mapped to 4096
select @@global.max_relay_log_size;
start slave;
sync_with_master;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 23 # 33 #
--vertical_results
show slave status;
--echo #
--echo # Test 2
--echo #
stop slave;
reset slave;
set global max_relay_log_size=(5*4096);
select @@global.max_relay_log_size;
start slave;
sync_with_master;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 23 # 33 #
--vertical_results
show slave status;
--echo #
--echo # Test 3: max_relay_log_size = 0
--echo #
stop slave;
reset slave;
set global max_relay_log_size=0;
select @@global.max_relay_log_size;
start slave;
sync_with_master;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 23 # 33 #
--vertical_results
show slave status;
--echo #
--echo # Test 4: Tests below are mainly to ensure that we have not coded with wrong assumptions
--echo #
stop slave;
reset slave;
# test of relay log rotation when the slave is stopped
# (to make sure it does not crash).
flush logs;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 23 # 33 #
--vertical_results
show slave status;
--echo #
--echo # Test 5
--echo #
reset slave;
start slave;
sync_with_master;
# test of relay log rotation when the slave is started
flush logs;
# We have now easy way to be sure that the SQL thread has now deleted the
# log we just closed. But a trick to achieve this is do an update on the master.
connection master;
create table t1 (a int);
save_master_pos;
connection slave;
sync_with_master;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 23 # 33 #
--vertical_results
show slave status;
--echo #
--echo # Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated
--echo #
flush logs;
connection master;
drop table t1;
save_master_pos;
connection slave;
sync_with_master;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 23 # 33 #
--vertical_results
show slave status;
connection master;
# test that the absence of relay logs does not make a master crash
flush logs;
show master status;
# Restore max_binlog_size
connection slave;
set global max_binlog_size= @my_max_binlog_size;
--echo #
--echo # End of 4.1 tests
--echo #