~ubuntu-branches/ubuntu/precise/mysql-5.5/precise-201203300109

« back to all changes in this revision

Viewing changes to mysql-test/suite/rpl/t/rpl_semi_sync_event.test

  • Committer: Package Import Robot
  • Author(s): Clint Byrum
  • Date: 2011-11-08 11:31:13 UTC
  • Revision ID: package-import@ubuntu.com-20111108113113-3ulw01fvi4vn8m25
Tags: upstream-5.5.17
ImportĀ upstreamĀ versionĀ 5.5.17

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
source include/have_semisync_plugin.inc;
 
2
source include/not_embedded.inc;
 
3
source include/master-slave.inc;
 
4
source include/have_innodb.inc;
 
5
 
 
6
let $engine_type= InnoDB;
 
7
 
 
8
# Suppress warnings that might be generated during the test
 
9
disable_query_log;
 
10
connection master;
 
11
call mtr.add_suppression("Timeout waiting for reply of binlog");
 
12
call mtr.add_suppression("Semi-sync master .* waiting for slave reply");
 
13
call mtr.add_suppression("Read semi-sync reply");
 
14
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.");
 
15
connection slave;
 
16
call mtr.add_suppression("Master server does not support semi-sync");
 
17
call mtr.add_suppression("Semi-sync slave .* reply");
 
18
call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
 
19
enable_query_log;
 
20
 
 
21
connection master;
 
22
disable_query_log;
 
23
let $value = query_get_value(show variables like 'rpl_semi_sync_master_enabled', Value, 1);
 
24
if ($value == No such row)
 
25
{
 
26
    set sql_log_bin=0;
 
27
    eval INSTALL PLUGIN rpl_semi_sync_master SONAME '$SEMISYNC_MASTER_PLUGIN';
 
28
    SET GLOBAL rpl_semi_sync_master_enabled = 1;
 
29
    set sql_log_bin=1;
 
30
}
 
31
enable_query_log;
 
32
 
 
33
connection slave;
 
34
source include/stop_slave.inc;
 
35
 
 
36
disable_query_log;
 
37
let $value= query_get_value(show variables like 'rpl_semi_sync_slave_enabled', Value, 1);
 
38
if ($value == No such row)
 
39
{
 
40
    set sql_log_bin=0;
 
41
    eval INSTALL PLUGIN rpl_semi_sync_slave SONAME '$SEMISYNC_SLAVE_PLUGIN';
 
42
    SET GLOBAL rpl_semi_sync_slave_enabled = 1;
 
43
    set sql_log_bin=1;
 
44
}
 
45
enable_query_log;
 
46
 
 
47
source include/start_slave.inc;
 
48
 
 
49
connection master;
 
50
SET GLOBAL event_scheduler = ON;
 
51
 
 
52
replace_result $engine_type ENGINE_TYPE;
 
53
eval CREATE TABLE t1 (i INT NOT NULL AUTO_INCREMENT PRIMARY KEY, f varchar(8)) ENGINE=$engine_type;
 
54
INSERT INTO t1 (f) VALUES ('a'),('a'),('a'),('a'),('a');
 
55
INSERT INTO t1 SELECT i+5, f FROM t1;
 
56
INSERT INTO t1 SELECT i+10, f FROM t1;
 
57
 
 
58
CREATE EVENT ev1 ON SCHEDULE EVERY 1 SECOND
 
59
DO INSERT INTO t1 VALUES (SLEEP(5),CONCAT('ev1_',CONNECTION_ID()));
 
60
CREATE EVENT ev2 ON SCHEDULE EVERY 1 SECOND
 
61
DO INSERT INTO t1 VALUES (SLEEP(5),CONCAT('ev2_',CONNECTION_ID()));
 
62
 
 
63
connection slave;
 
64
STOP SLAVE IO_THREAD;
 
65
 
 
66
connection master;
 
67
let $run = 20;
 
68
while ($run)
 
69
{
 
70
        connect (m$run,localhost,root,,);
 
71
        connection m$run;
 
72
        send;
 
73
        eval UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = $run;
 
74
        connection master;
 
75
        dec $run;
 
76
}
 
77
 
 
78
connection master;
 
79
SET GLOBAL event_scheduler = OFF;
 
80
 
 
81
let $run = 20;
 
82
while ($run)
 
83
{
 
84
        connection m$run;
 
85
        reap;
 
86
        disconnect m$run;
 
87
        dec $run;
 
88
}
 
89
 
 
90
#
 
91
# Clean up
 
92
#
 
93
connection slave;
 
94
source include/stop_slave.inc;
 
95
 
 
96
disable_warnings;
 
97
UNINSTALL PLUGIN rpl_semi_sync_slave;
 
98
 
 
99
connection master;
 
100
UNINSTALL PLUGIN rpl_semi_sync_master;
 
101
enable_warnings;
 
102
 
 
103
connection slave;
 
104
source include/start_slave.inc;
 
105
 
 
106
connection master;
 
107
DROP EVENT ev1;
 
108
DROP EVENT ev2;
 
109
DROP TABLE t1;
 
110
sync_slave_with_master;
 
111
--source include/rpl_end.inc