~drizzle-trunk/drizzle/development

1 by brian
clean slate
1
#multi delete replication bugs 
2
3
4
source include/master-slave.inc;
5
6
#BUG#11139 - improper wild-table and table rules
7
#checking for multi deletes with an alias
8
9
connection master;
10
set sql_log_bin=0;
11
create database mysqltest_from;
12
set sql_log_bin=1;
13
14
connection slave;
15
create database mysqltest_to;
16
17
18
connection master;
19
use mysqltest_from;
20
--disable_warnings
21
drop table if exists a;
22
--enable_warnings
23
CREATE TABLE a (i INT);
24
INSERT INTO a VALUES(1);
25
DELETE alias FROM a alias WHERE alias.i=1;
26
SELECT * FROM a;
27
insert into a values(2),(3);
28
delete alias FROM a alias where alias.i=2;
29
select * from a;
30
save_master_pos;
31
connection slave;
32
33
use mysqltest_to;
34
sync_with_master;
35
select * from a;
36
37
# BUG#3461
38
connection master;
39
create table t1 (a int primary key);
40
create table t2 (a int);
41
42
insert into t1 values (1);
43
insert into t2 values (1);
44
45
delete t1.* from t1, t2 where t1.a = t2.a;
46
47
save_master_pos;
48
select * from t1;
49
select * from t2;
50
51
connection slave;
52
# BUG#3461 would cause sync to fail
53
sync_with_master;
54
error 1146;
55
select * from t1;
56
error 1146;
57
select * from t2;
58
59
# cleanup
60
connection master;
61
set sql_log_bin=0;
62
drop database mysqltest_from;
63
set sql_log_bin=1;
64
connection slave;
65
drop database mysqltest_to;
66
67
# End of 4.1 tests
68