~ubuntu-branches/ubuntu/trusty/mysql-5.6/trusty

« back to all changes in this revision

Viewing changes to mysql-test/suite/engines/funcs/t/rpl_user_variables.test

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-02-12 11:54:27 UTC
  • Revision ID: package-import@ubuntu.com-20140212115427-oq6tfsqxl1wuwehi
Tags: upstream-5.6.15
ImportĀ upstreamĀ versionĀ 5.6.15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
###################################
 
2
#
 
3
# Test of replicating user variables
 
4
#
 
5
###################################
 
6
 
 
7
-- source include/master-slave.inc
 
8
# Disable PS as the log positions differs
 
9
--disable_ps_protocol
 
10
 
 
11
 
 
12
# Clean up old slave's binlogs.
 
13
# The slave is started with --log-slave-updates
 
14
# and this test does SHOW BINLOG EVENTS on the slave's
 
15
# binlog. But previous tests can influence the current test's
 
16
# binlog (e.g. a temporary table in the previous test has not
 
17
# been explicitly deleted, or it has but the slave hasn't had
 
18
# enough time to catch it before STOP SLAVE, 
 
19
# and at the beginning of the current
 
20
# test the slave immediately writes DROP TEMPORARY TABLE this_old_table).
 
21
# We wait for the slave to have written all he wants to the binlog
 
22
# (otherwise RESET MASTER may come too early).
 
23
save_master_pos;
 
24
connection slave;
 
25
sync_with_master;
 
26
reset master;
 
27
connection master;
 
28
 
 
29
create table t1(n char(30));
 
30
set @i1:=12345678901234, @i2:=-12345678901234, @i3:=0, @i4:=-1;
 
31
set @s1:='This is a test', @r1:=12.5, @r2:=-12.5;
 
32
set @n1:=null;
 
33
set @s2:='', @s3:='abc\'def', @s4:= 'abc\\def', @s5:= 'abc''def';
 
34
insert into t1 values (@i1), (@i2), (@i3), (@i4);
 
35
insert into t1 values (@r1), (@r2);
 
36
insert into t1 values (@s1), (@s2), (@s3), (@s4), (@s5);
 
37
insert into t1 values (@n1);
 
38
insert into t1 values (@n2); # not explicitely set before
 
39
insert into t1 values (@a:=0), (@a:=@a+1), (@a:=@a+1);
 
40
insert into t1 values (@a+(@b:=@a+1));
 
41
set @q:='abc';
 
42
insert t1 values (@q), (@q:=concat(@q, 'n1')), (@q:=concat(@q, 'n2'));
 
43
set @a:=5;
 
44
insert into t1 values (@a),(@a);
 
45
# To flush the pending event, we add the following statement. RBR can
 
46
# concatenate the result of several statements, which SBR cannot.
 
47
select * from t1 where n = '<nonexistant>';
 
48
connection master1; # see if variable is reset in binlog when thread changes
 
49
insert into t1 values (@a),(@a),(@a*5);
 
50
SELECT * FROM t1 ORDER BY n;
 
51
sync_slave_with_master;
 
52
SELECT * FROM t1 ORDER BY n;
 
53
connection master;
 
54
insert into t1 select * FROM (select @var1 union  select @var2) AS t2;
 
55
drop table t1;
 
56
sync_slave_with_master;
 
57
stop slave;