diff options
author | unknown <guilhem@mysql.com> | 2004-02-22 11:22:51 +0100 |
---|---|---|
committer | unknown <guilhem@mysql.com> | 2004-02-22 11:22:51 +0100 |
commit | a61331d805aab3a4492ed51ab9a71db1170d4219 (patch) | |
tree | 02fb3768436564d8a9d24bff92193732da6ed299 /mysql-test/t/rpl_optimize.test | |
parent | 653112051422ab0191f728b0b33f4858e52d2d2c (diff) | |
download | mariadb-git-a61331d805aab3a4492ed51ab9a71db1170d4219.tar.gz |
Complement to
ChangeSet 1.1616.23.1
Fix for BUG#1858 "SQL-Thread stops working when using optimize table".
A test for this.
sql/sql_base.cc:
In remove_table_from_cache(), kill only delayed threads.
Diffstat (limited to 'mysql-test/t/rpl_optimize.test')
-rw-r--r-- | mysql-test/t/rpl_optimize.test | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/mysql-test/t/rpl_optimize.test b/mysql-test/t/rpl_optimize.test new file mode 100644 index 00000000000..9f02b715885 --- /dev/null +++ b/mysql-test/t/rpl_optimize.test @@ -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. |