mySQL 5.0.11 sources for tomato
[tomato.git] / release / src / router / mysql / mysql-test / suite / rpl / t / rpl_session_var.test
blob4ea07d4f9d65ed26b0ca859b6699a6a3023443b2
1 # Replication of session variables.
2 # FOREIGN_KEY_CHECKS is tested in rpl_insert_id.test
4 source include/master-slave.inc;
5 drop table if exists t1;
6 create table t1(a varchar(100),b int);
7 set @@session.sql_mode=pipes_as_concat;
8 insert into t1 values('My'||'SQL', 1);
9 set @@session.sql_mode=default;
10 insert into t1 values('1'||'2', 2);
11 select * from t1 where b<3 order by a;
12 save_master_pos;
13 connection slave;
14 sync_with_master;
15 select * from t1 where b<3 order by a;
16 connection master;
17 # if the slave does the next sync_with_master fine, then it means it accepts the
18 # two lines of ANSI syntax below, which is what we want to check.
19 set @@session.sql_mode=ignore_space;
20 insert into t1 values(password          ('MySQL'), 3);
21 set @@session.sql_mode=ansi_quotes;
22 create table "t2" ("a" int);
23 drop table t1, t2;
24 set @@session.sql_mode=default;
25 create table t1(a int auto_increment primary key);
26 create table t2(b int, a int);
27 set @@session.sql_auto_is_null=1;
28 insert into t1 values(null);
29 insert into t2 select 1,a from t1 where a is null;
30 set @@session.sql_auto_is_null=0;
31 insert into t1 values(null);
32 insert into t2 select 2,a from t1 where a is null;
33 select * from t2 order by b;
34 save_master_pos;
35 connection slave;
36 sync_with_master;
37 select * from t2 order by b;
38 connection master;
39 drop table t1,t2;
40 save_master_pos;
41 connection slave;
42 sync_with_master;
45 # Bug #29878 Garbage data generation when executing SESSION_USER() on a slave. 
48 connection master;
49 CREATE TABLE t1 (
50   `id` int(11) NOT NULL auto_increment,
51   `data` varchar(100),
52   PRIMARY KEY  (`id`)
53  ) ENGINE=MyISAM;
54 --disable_warnings
55 INSERT INTO t1(data) VALUES(SESSION_USER());
56 --enable_warnings
57 save_master_pos;
58 connection slave;
59 sync_with_master;
60 SELECT length(data) < 100 FROM t1;
61 connection master;
62 drop table t1;
63 save_master_pos;
64 connection slave;
65 sync_with_master;
66 --source include/rpl_end.inc