| 1 |
include/master-slave.inc |
| 2 |
[connection master] |
| 3 |
CALL mtr.add_suppression('Unsafe statement written to the binary log using statement format'); |
| 4 |
DROP TABLE IF EXISTS t1; |
| 5 |
DROP TABLE IF EXISTS t2; |
| 6 |
DROP TABLE IF EXISTS t3; |
| 7 |
create table t1 (a int auto_increment, primary key (a), b int, |
| 8 |
rand_value double not null) engine=maria; |
| 9 |
create table t2 (a int auto_increment, primary key (a), b int) engine=maria; |
| 10 |
create table t3 (a int auto_increment, primary key (a), name |
| 11 |
varchar(64) not null, old_a int, old_b int, rand_value double not |
| 12 |
null) engine=maria; |
| 13 |
create trigger t1 before insert on t1 for each row |
| 14 |
begin |
| 15 |
insert into t3 values (NULL, "t1", new.a, new.b, rand()); |
| 16 |
end| |
| 17 |
create trigger t2 after insert on t2 for each row |
| 18 |
begin |
| 19 |
insert into t3 values (NULL, "t2", new.a, new.b, rand()); |
| 20 |
end| |
| 21 |
insert into t3 values(100,"log",0,0,0); |
| 22 |
SET @@RAND_SEED1=658490765, @@RAND_SEED2=635893186; |
| 23 |
insert into t1 values(1,1,rand()),(NULL,2,rand()); |
| 24 |
insert into t2 (b) values(last_insert_id()); |
| 25 |
insert into t2 values(3,0),(NULL,0); |
| 26 |
insert into t2 values(NULL,0),(500,0); |
| 27 |
select a,b, truncate(rand_value,4) from t1; |
| 28 |
a b truncate(rand_value,4) |
| 29 |
1 1 0.4320 |
| 30 |
2 2 0.3055 |
| 31 |
select * from t2; |
| 32 |
a b |
| 33 |
1 2 |
| 34 |
3 0 |
| 35 |
4 0 |
| 36 |
5 0 |
| 37 |
500 0 |
| 38 |
select a,name, old_a, old_b, truncate(rand_value,4) from t3; |
| 39 |
a name old_a old_b truncate(rand_value,4) |
| 40 |
100 log 0 0 0.0000 |
| 41 |
101 t1 1 1 0.3203 |
| 42 |
102 t1 NULL 2 0.5666 |
| 43 |
103 t2 1 2 0.9164 |
| 44 |
104 t2 3 0 0.8826 |
| 45 |
105 t2 4 0 0.6635 |
| 46 |
106 t2 5 0 0.6699 |
| 47 |
107 t2 500 0 0.3593 |
| 48 |
connection slave; |
| 49 |
connection master; |
| 50 |
drop table t1,t2,t3; |
| 51 |
connection slave; |
| 52 |
include/rpl_end.inc |