Debian Codegraph @

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

raw
1 # Replication of session variables.
2 # FOREIGN_KEY_CHECKS is tested in rpl_insert_id.test
3
4 source include/master-slave.inc;
5
6 disable_query_log;
7 call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
8 enable_query_log;
9
10 select @@rpl_semi_sync_master_enabled;
11 connection slave;
12 select @@rpl_semi_sync_slave_enabled;
13 show status like "rpl_semi_sync_slave_status";
14 connection master;
15
16 drop table if exists t1;
17 create table t1(a varchar(100),b int);
18 set @@session.sql_mode=pipes_as_concat;
19 insert into t1 values('My'||'SQL', 1);
20 set @@session.sql_mode=default;
21 insert into t1 values('1'||'2', 2);
22 select * from t1 where b<3 order by a;
23 sync_slave_with_master;
24 select * from t1 where b<3 order by a;
25 connection master;
26 # if the slave does the next sync_with_master fine, then it means it accepts the
27 # two lines of ANSI syntax below, which is what we want to check.
28 set @@session.sql_mode=ignore_space;
29 insert into t1 values(password ('MySQL'), 3);
30 set @@session.sql_mode=ansi_quotes;
31 create table "t2" ("a" int);
32 drop table t1, t2;
33 set @@session.sql_mode=default;
34 create table t1(a int auto_increment primary key);
35 create table t2(b int, a int);
36 set @@session.sql_auto_is_null=1;
37 insert into t1 values(null);
38 insert into t2 select 1,a from t1 where a is null;
39 set @@session.sql_auto_is_null=0;
40 insert into t1 values(null);
41 insert into t2 select 2,a from t1 where a is null;
42 select * from t2 order by b;
43 sync_slave_with_master;
44 select * from t2 order by b;
45 connection master;
46 drop table t1,t2;
47 sync_slave_with_master;
48
49 #
50 # Bug #29878 Garbage data generation when executing SESSION_USER() on a slave.
51 #
52
53 connection master;
54 CREATE TABLE t1 (
55 `id` int(11) NOT NULL auto_increment,
56 `data` varchar(100),
57 PRIMARY KEY (`id`)
58 ) ENGINE=MyISAM;
59 --disable_warnings
60 INSERT INTO t1(data) VALUES(SESSION_USER());
61 --enable_warnings
62 sync_slave_with_master;
63 SELECT length(data) < 100 FROM t1;
64 connection master;
65 drop table t1;
66
67 --source include/rpl_end.inc