~linuxjedi/drizzle/trunk-bug-667053

« back to all changes in this revision

Viewing changes to mysql-test/suite/rpl/t/rpl_optimize.test

  • Committer: brian
  • Date: 2008-06-25 05:29:13 UTC
  • Revision ID: brian@localhost.localdomain-20080625052913-6upwo0jsrl4lnapl
clean slate

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Test for BUG#1858 "OPTIMIZE TABLE done by a client
 
2
# thread stops the slave SQL thread".
 
3
# You can replace OPTIMIZE by REPAIR.
 
4
#####################################
 
5
# Change Author: JBM
 
6
# Change Date: 2006-02-09
 
7
# Change: NDB does not and will not support
 
8
# OPTIMIZE for memory tables. If and when 
 
9
# it does support for Disk Data, a new 
 
10
# version of this test will be need.
 
11
# Skipping this test if default engine = ndb
 
12
#####################################
 
13
-- source include/not_ndb_default.inc
 
14
-- source include/master-slave.inc
 
15
 
 
16
create table t1 (a int not null auto_increment primary key, b int, key(b));
 
17
INSERT INTO t1 (a) VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
 
18
INSERT INTO t1 (a) SELECT null FROM t1;
 
19
INSERT INTO t1 (a) SELECT null FROM t1;
 
20
INSERT INTO t1 (a) SELECT null FROM t1;
 
21
INSERT INTO t1 (a) SELECT null FROM t1;
 
22
INSERT INTO t1 (a) SELECT null FROM t1;
 
23
INSERT INTO t1 (a) SELECT null FROM t1;
 
24
INSERT INTO t1 (a) SELECT null FROM t1;
 
25
INSERT INTO t1 (a) SELECT null FROM t1;
 
26
INSERT INTO t1 (a) SELECT null FROM t1;
 
27
INSERT INTO t1 (a) SELECT null FROM t1;
 
28
INSERT INTO t1 (a) SELECT null FROM t1;
 
29
INSERT INTO t1 (a) SELECT null FROM t1;
 
30
INSERT INTO t1 (a) SELECT null FROM t1;
 
31
save_master_pos;
 
32
# a few updates to force OPTIMIZE to do something
 
33
update t1 set b=(a/2*rand());
 
34
--disable_warnings
 
35
delete from t1 order by b limit 10000;
 
36
--enable_warnings
 
37
 
 
38
connection slave;
 
39
sync_with_master;
 
40
optimize table t1;
 
41
connection master;
 
42
save_master_pos;
 
43
connection slave;
 
44
# Bug was that when the INSERT terminated on slave,
 
45
# the slave SQL thread got killed by OPTIMIZE.
 
46
sync_with_master; # won't work if slave SQL thread stopped
 
47
 
 
48
connection master; # cleanup
 
49
drop table t1;
 
50
connection slave;
 
51
sync_with_master;
 
52
 
 
53
# If the machine is so fast that slave syncs before OPTIMIZE
 
54
# starts, this test wil demonstrate nothing but will pass.
 
55
 
 
56
# End of 4.1 tests