Debian Codegraph @

mysql-test/suite/rpl/t/rpl_stm_maria.test

raw
1 # Test of Maria-specific replication bugs
2
3 --source include/have_maria.inc
4 --source include/have_binlog_format_mixed_or_statement.inc
5 --source include/master-slave.inc
6
7 # Suppress warnings that rand() is unsafe in statement binlog mode
8 CALL mtr.add_suppression('Unsafe statement written to the binary log using statement format');
9
10 --disable_warnings
11 DROP TABLE IF EXISTS t1;
12 DROP TABLE IF EXISTS t2;
13 DROP TABLE IF EXISTS t3;
14 --enable_warnings
15
16 # This one taken from rpl_trigger.test (from BUG#12482)
17 # used to segfault slave in execution of row-based events
18
19 # Need an explicit ENGINE= clause as @@STORAGE_ENGINE is not replicated
20 create table t1 (a int auto_increment, primary key (a), b int,
21 rand_value double not null) engine=maria;
22 create table t2 (a int auto_increment, primary key (a), b int) engine=maria;
23 create table t3 (a int auto_increment, primary key (a), name
24 varchar(64) not null, old_a int, old_b int, rand_value double not
25 null) engine=maria;
26
27 delimiter |;
28 create trigger t1 before insert on t1 for each row
29 begin
30 insert into t3 values (NULL, "t1", new.a, new.b, rand());
31 end|
32
33 create trigger t2 after insert on t2 for each row
34 begin
35 insert into t3 values (NULL, "t2", new.a, new.b, rand());
36 end|
37 delimiter ;|
38
39 insert into t3 values(100,"log",0,0,0);
40
41 SET @@RAND_SEED1=658490765, @@RAND_SEED2=635893186;
42
43 --disable_warnings
44 insert into t1 values(1,1,rand()),(NULL,2,rand());
45 insert into t2 (b) values(last_insert_id());
46 insert into t2 values(3,0),(NULL,0);
47 insert into t2 values(NULL,0),(500,0);
48 --enable_warnings
49
50 select a,b, truncate(rand_value,4) from t1;
51 select * from t2;
52 select a,name, old_a, old_b, truncate(rand_value,4) from t3;
53 sync_slave_with_master;
54 connection master;
55 drop table t1,t2,t3;
56 sync_slave_with_master;
57
58 # End of tests
59 --source include/rpl_end.inc