~ubuntu-branches/ubuntu/lucid/mysql-dfsg-5.1/lucid-security

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# This test assumes we are ignoring updates on table t2, but doing
# updates on t1
source include/master-slave.inc;
--disable_warnings
drop table if exists t11;
connection slave;
drop table if exists t11;
--enable_warnings

create table t2 (n int);
insert into t2 values(4);
connection master;
create table t2 (s char(20));
load data infile '../../std_data/words.dat' into table t2;
insert into t2 values('five');
create table t1 (m int);
insert into t1 values(15),(16),(17);
update t1 set m=20 where m=16;
delete from t1 where m=17;
create table t11 select * from t1;
save_master_pos;
connection slave;
sync_with_master;
select * from t1 ORDER BY m;
select * from t2;
--error 1146
select * from t11;
connection master;
drop table if exists t1,t2,t11;
save_master_pos;
connection slave;
sync_with_master;
# show slave status, just to see of it prints replicate-do-table
let $status_items= Replicate_Do_Table;
source include/show_slave_status.inc;
#
# BUG#12542
# TEST: "SET ONE_SHOT should always be executed on slave"
#
# We could use any timezone different than server default in this test
#
connection master;
create table t1 (ts timestamp);
set one_shot time_zone='met';
insert into t1 values('2005-08-12 00:00:00');
set one_shot time_zone='met';
select * from t1;
sync_slave_with_master;

connection slave;
set one_shot time_zone='met';
select * from t1;

connection master;
drop table t1;
sync_slave_with_master;

# End of 4.1 tests

#
# Bug#24478 DROP TRIGGER is not caught by replicate-*-table filters
#
--echo *** master ***
connection master;
create table t1 (a int, b int);
create trigger trg1 before insert on t1 for each row set new.b=2;
create table t2 (a int, b int);
create trigger trg2 before insert on t2 for each row set new.b=2;
show tables;
show triggers;
sync_slave_with_master;
--echo *** slave ***
connection slave;
show tables;
show triggers;
--echo *** master ***
connection master;
drop trigger trg1;
drop trigger trg2;
show triggers;
sync_slave_with_master;
--echo *** slave ***
connection slave;
show tables;
show triggers;
--echo *** master ***
connection master;
drop table t1;
drop table t2;
sync_slave_with_master;
--source include/rpl_end.inc