mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge gbichot@bk-internal.mysql.com:/home/bk/mysql-4.0
into mysql.com:/home/mysql_src/mysql-4.0
This commit is contained in:
27
mysql-test/r/rpl_optimize.result
Normal file
27
mysql-test/r/rpl_optimize.result
Normal file
@ -0,0 +1,27 @@
|
||||
slave stop;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
reset master;
|
||||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
slave start;
|
||||
create table t1 (a int not null auto_increment primary key, b int, key(b));
|
||||
INSERT INTO t1 (a) VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
|
||||
INSERT INTO t1 (a) SELECT null FROM t1;
|
||||
INSERT INTO t1 (a) SELECT null FROM t1;
|
||||
INSERT INTO t1 (a) SELECT null FROM t1;
|
||||
INSERT INTO t1 (a) SELECT null FROM t1;
|
||||
INSERT INTO t1 (a) SELECT null FROM t1;
|
||||
INSERT INTO t1 (a) SELECT null FROM t1;
|
||||
INSERT INTO t1 (a) SELECT null FROM t1;
|
||||
INSERT INTO t1 (a) SELECT null FROM t1;
|
||||
INSERT INTO t1 (a) SELECT null FROM t1;
|
||||
INSERT INTO t1 (a) SELECT null FROM t1;
|
||||
INSERT INTO t1 (a) SELECT null FROM t1;
|
||||
INSERT INTO t1 (a) SELECT null FROM t1;
|
||||
INSERT INTO t1 (a) SELECT null FROM t1;
|
||||
update t1 set b=(a/2*rand());
|
||||
delete from t1 order by b limit 10000;
|
||||
optimize table t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 optimize status OK
|
||||
drop table t1;
|
43
mysql-test/t/rpl_optimize.test
Normal file
43
mysql-test/t/rpl_optimize.test
Normal file
@ -0,0 +1,43 @@
|
||||
# Test for BUG#1858 "OPTIMIZE TABLE done by a client
|
||||
# thread stops the slave SQL thread".
|
||||
# You can replace OPTIMIZE by REPAIR.
|
||||
|
||||
source include/master-slave.inc;
|
||||
|
||||
create table t1 (a int not null auto_increment primary key, b int, key(b));
|
||||
INSERT INTO t1 (a) VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
|
||||
INSERT INTO t1 (a) SELECT null FROM t1;
|
||||
INSERT INTO t1 (a) SELECT null FROM t1;
|
||||
INSERT INTO t1 (a) SELECT null FROM t1;
|
||||
INSERT INTO t1 (a) SELECT null FROM t1;
|
||||
INSERT INTO t1 (a) SELECT null FROM t1;
|
||||
INSERT INTO t1 (a) SELECT null FROM t1;
|
||||
INSERT INTO t1 (a) SELECT null FROM t1;
|
||||
INSERT INTO t1 (a) SELECT null FROM t1;
|
||||
INSERT INTO t1 (a) SELECT null FROM t1;
|
||||
INSERT INTO t1 (a) SELECT null FROM t1;
|
||||
INSERT INTO t1 (a) SELECT null FROM t1;
|
||||
INSERT INTO t1 (a) SELECT null FROM t1;
|
||||
INSERT INTO t1 (a) SELECT null FROM t1;
|
||||
save_master_pos;
|
||||
# a few updates to force OPTIMIZE to do something
|
||||
update t1 set b=(a/2*rand());
|
||||
delete from t1 order by b limit 10000;
|
||||
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
optimize table t1;
|
||||
connection master;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
# Bug was that when the INSERT terminated on slave,
|
||||
# the slave SQL thread got killed by OPTIMIZE.
|
||||
sync_with_master; # won't work if slave SQL thread stopped
|
||||
|
||||
connection master; # cleanup
|
||||
drop table t1;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
|
||||
# If the machine is so fast that slave syncs before OPTIMIZE
|
||||
# starts, this test wil demonstrate nothing but will pass.
|
Reference in New Issue
Block a user