mirror of
https://github.com/MariaDB/server.git
synced 2025-01-20 05:52:27 +01:00
2c4fa340cc
Fixed bugs in my last changeset that made MySQL hard to compile. Added mutex around some data that could cause table cache corruptions when using OPTIMIZE TABLE / REPAIR TABLE or automatic repair of MyISAM tables. Added mutex around some data in the slave start/stop code that could cause THD linked list corruptions Extended my_chsize() to allow one to specify a filler character. Extend vio_blocking to return the old state (This made some usage of this function much simpler) Added testing for some functions that they caller have got the required mutexes before calling the function. Use setrlimit() to ensure that we can write core file if one specifies --core-file. Added --slave-compressed-protocol Made 2 the minimum length for ft_min_word_len Added variables foreign_key_checks & unique_checks. Less logging from replication code (if not started with --log-warnings) Changed that SHOW INNODB STATUS requre the SUPER privilege More DBUG statements and a lot of new code comments
43 lines
1.2 KiB
Text
43 lines
1.2 KiB
Text
# test case to make slave thread get ahead by 22 bytes
|
|
|
|
source include/master-slave.inc;
|
|
|
|
# first, cause a duplicate key problem on the slave
|
|
create table t1(n int auto_increment primary key);
|
|
save_master_pos;
|
|
connection slave;
|
|
sync_with_master;
|
|
insert into t1 values (2);
|
|
connection master;
|
|
insert into t1 values(NULL);
|
|
insert into t1 values(NULL);
|
|
save_master_pos;
|
|
connection slave;
|
|
sleep 1; # there is no way around this sleep - we have to wait until
|
|
# the slave tries to run the query, fails and aborts slave thread
|
|
delete from t1 where n = 2;
|
|
slave start;
|
|
sync_with_master;
|
|
#now the buggy slave would be confused on the offset but it can replicate
|
|
#in order to make it break, we need to stop/start the slave one more time
|
|
slave stop;
|
|
connection master;
|
|
# to be able to really confuse the slave, we need some non-auto-increment
|
|
# events in the log
|
|
create table t2(n int);
|
|
drop table t2;
|
|
insert into t1 values(NULL);
|
|
save_master_pos;
|
|
connection slave;
|
|
slave start;
|
|
#now the truth comes out - if the slave is buggy, it will never sync because
|
|
#the slave thread is not able to read events
|
|
sync_with_master;
|
|
select * from t1;
|
|
#clean up
|
|
connection master;
|
|
drop table t1;
|
|
save_master_pos;
|
|
connection slave;
|
|
sync_with_master;
|
|
|