mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 04:53:01 +01:00
46ea874fb7
Note: The following tests fails - fulltext (Sergei has promised to fix) - rpl_charset (Guilhem should fix) - rpl_timezone (Dimitray has promised to fix) Sanja needs to check out the calling of close_thread_tables() in sp_head.cc myisam/mi_check.c: After merge fix myisam/sort.c: After merge fix mysql-test/mysql-test-run.sh: Export master socket to mysqltest mysql-test/r/func_group.result: Make result repeatable mysql-test/r/mysqlbinlog.result: After merge fix mysql-test/r/ps_1general.result: After merge fix mysql-test/r/ps_2myisam.result: After merge fix mysql-test/r/ps_3innodb.result: After merge fix mysql-test/r/ps_4heap.result: After merge fix mysql-test/r/ps_5merge.result: After merge fix mysql-test/r/ps_6bdb.result: After merge fix mysql-test/r/rpl_flush_log_loop.result: After merge fix mysql-test/r/rpl_replicate_do.result: After merge fix mysql-test/r/rpl_temporary.result: After merge fix mysql-test/r/rpl_timezone.result: After merge fix Note that this test fails now (Dimitry has promised to fix this) mysql-test/r/rpl_user_variables.result: After merge fix mysql-test/r/select.result: After merge fix mysql-test/r/sp-error.result: After merge fix mysql-test/r/sp-security.result: After merge fix mysql-test/r/sp.result: After merge fix mysql-test/r/user_var.result: After merge fix mysql-test/r/variables.result: After merge fix mysql-test/t/alter_table.test: After merge fix mysql-test/t/derived.test: After merge fix mysql-test/t/func_group.test: Make result repeatable mysql-test/t/grant_cache.test: Use MASTER_MYSOCK instead of master.sock mysql-test/t/multi_update.test: Use MASTER_MYSOCK instead of master.sock mysql-test/t/rpl000015.test: Use MASTER_MYSOCK instead of master.sock mysql-test/t/rpl000017.test: Use MASTER_MYSOCK instead of master.sock mysql-test/t/rpl000018.test: Use MASTER_MYSOCK instead of master.sock mysql-test/t/rpl_charset.test: After merge fix mysql-test/t/rpl_heap.test: Use MASTER_MYSOCK instead of master.sock mysql-test/t/rpl_rotate_logs.test: Use MASTER_MYSOCK instead of master.sock mysql-test/t/sp-error.test: after merge fix mysql-test/t/sp-security.test: after merge fix mysql-test/t/user_var.test: after merge fix scripts/mysql_fix_privilege_tables.sh: This can now be exectued from the source distribution sql/handler.cc: Cleanup sql/handler.h: More debugging sql/item.h: Indentation fixes sql/item_cmpfunc.cc: After merge fixes sql/opt_range.cc: After merge fixes sql/opt_range.h: After merge fixes sql/sp.cc: After merge fixes sql/sp_head.cc: Remove closing of thread tables in a SP function as this caused a core dump. (Has to be fixed better) sql/sql_base.cc: More debugging sql/sql_handler.cc: After merge fixes (We have to call ha_index_or_rnd_end() before calling close_thread_table()) sql/sql_parse.cc: More debugging sql/sql_prepare.cc: After merge fixes sql/sql_select.cc: After merge fixes
153 lines
4.1 KiB
Text
153 lines
4.1 KiB
Text
#
|
|
# Test is run with max_binlog_size=2048 to force automatic rotation of the
|
|
# binary log
|
|
# Tests done:
|
|
# - Check that slaves reports correct failures if master.info has strange
|
|
# modes/information
|
|
# - Automatic binary log rotation
|
|
# - Ensure that temporary tables works over flush logs and binary log
|
|
# changes
|
|
# - Test creating a duplicate key error and recover from it
|
|
|
|
connect (master,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
|
|
--disable_warnings
|
|
drop table if exists t1, t2, t3, t4;
|
|
--enable_warnings
|
|
connect (slave,localhost,root,,test,$SLAVE_MYPORT,slave.sock);
|
|
system cat /dev/null > var/slave-data/master.info;
|
|
system chmod 000 var/slave-data/master.info;
|
|
connection slave;
|
|
--disable_warnings
|
|
drop table if exists t1, t2, t3, t4;
|
|
--enable_warnings
|
|
|
|
# START SLAVE will fail because it can't read the file (mode 000)
|
|
# (system error 13)
|
|
--error 1201
|
|
start slave;
|
|
system chmod 600 var/slave-data/master.info;
|
|
# It will fail again because the file is empty so the slave cannot get valuable
|
|
# info about how to connect to the master from it (failure in
|
|
# init_strvar_from_file() in init_master_info()).
|
|
--error 1201
|
|
start slave;
|
|
--replace_result $MASTER_MYPORT MASTER_PORT
|
|
|
|
# CHANGE MASTER will fail because it first parses master.info before changing
|
|
# it (so when master.info is bad, people have to use RESET SLAVE first).
|
|
--error 1201
|
|
eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, master_user='root';
|
|
reset slave;
|
|
--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;
|
|
reset master;
|
|
connection slave;
|
|
start slave;
|
|
connection master;
|
|
|
|
#
|
|
# Test FLUSH LOGS
|
|
#
|
|
create temporary table temp_table (a char(80) not null);
|
|
insert into temp_table values ("testing temporary tables");
|
|
create table t1 (s text);
|
|
insert into t1 values('Could not break slave'),('Tried hard');
|
|
sync_slave_with_master;
|
|
--replace_result $MASTER_MYPORT MASTER_PORT
|
|
--replace_column 1 # 8 # 9 # 23 # 33 #
|
|
show slave status;
|
|
select * from t1;
|
|
connection master;
|
|
flush logs;
|
|
create table t2(m int not null auto_increment primary key);
|
|
insert into t2 values (34),(67),(123);
|
|
flush logs;
|
|
show binary logs;
|
|
create table t3 select * from temp_table;
|
|
|
|
sync_slave_with_master;
|
|
|
|
select * from t3;
|
|
connection master;
|
|
drop table temp_table, t3;
|
|
|
|
#
|
|
# Now lets make some duplicate key mess and see if we can recover from it
|
|
#
|
|
|
|
# First insert a value on the slave
|
|
connection slave;
|
|
insert into t2 values(1234);
|
|
|
|
#same value on the master
|
|
connection master;
|
|
set insert_id=1234;
|
|
insert into t2 values(NULL);
|
|
connection slave;
|
|
wait_for_slave_to_stop;
|
|
|
|
#restart slave skipping one event
|
|
set global sql_slave_skip_counter=1;
|
|
start slave;
|
|
|
|
connection master;
|
|
|
|
#let slave catch up
|
|
sync_slave_with_master;
|
|
connection master;
|
|
purge master logs to 'master-bin.000002';
|
|
show master logs;
|
|
# we just tests if synonyms are accepted
|
|
purge binary logs to 'master-bin.000002';
|
|
show binary logs;
|
|
# sleeping 10 seconds or more would make the slave believe connection is down
|
|
--real_sleep 1;
|
|
purge master logs before now();
|
|
show binary logs;
|
|
insert into t2 values (65);
|
|
sync_slave_with_master;
|
|
--replace_result $MASTER_MYPORT MASTER_PORT
|
|
--replace_column 1 # 8 # 9 # 23 # 33 #
|
|
show slave status;
|
|
select * from t2;
|
|
|
|
#
|
|
# Test forcing the replication log to rotate
|
|
#
|
|
|
|
connection master;
|
|
create temporary table temp_table (a char(80) not null);
|
|
insert into temp_table values ("testing temporary tables part 2");
|
|
let $1=100;
|
|
|
|
create table t3 (n int);
|
|
disable_query_log;
|
|
while ($1)
|
|
{
|
|
#eval means expand $ expressions
|
|
eval insert into t3 values($1 + 4);
|
|
dec $1;
|
|
}
|
|
enable_query_log;
|
|
select count(*) from t3 where n >= 4;
|
|
create table t4 select * from temp_table;
|
|
show binary logs;
|
|
show master status;
|
|
save_master_pos;
|
|
connection slave;
|
|
sync_with_master;
|
|
select * from t4;
|
|
|
|
--replace_result $MASTER_MYPORT MASTER_PORT
|
|
--replace_column 1 # 8 # 9 # 23 # 33 #
|
|
show slave status;
|
|
# because of concurrent insert, the table may not be up to date
|
|
# if we do not lock
|
|
lock tables t3 read;
|
|
select count(*) from t3 where n >= 4;
|
|
unlock tables;
|
|
#clean up
|
|
connection master;
|
|
drop table if exists t1,t2,t3,t4;
|
|
sync_slave_with_master;
|