~tsarev/percona-server/stats_null_5.5

« back to all changes in this revision

Viewing changes to patches/bug860910.patch

  • Committer: Stewart Smith
  • Date: 2011-10-24 14:28:56 UTC
  • mfrom: (190.1.1 5.5)
  • Revision ID: stewart@flamingspork.com-20111024142856-gc6x7pihh9z9cjq0
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# name       : bug860910.patch
 
2
# maintainer : Alexey
 
3
#
 
4
# Fixes LP bug #860910 / MySQL bug #62557
 
5
#
 
6
--- /dev/null
 
7
+++ b/mysql-test/suite/rpl/r/percona_bug860910.result
 
8
@@ -0,0 +1,17 @@
 
9
+*** Set up master (server_1) <-> master (server_2) replication  ***
 
10
+include/rpl_init.inc [topology=1->2->1]
 
11
+
 
12
+SELECT @@global.log_slave_updates;
 
13
+@@global.log_slave_updates
 
14
+1
 
15
+SELECT @@global.log_slave_updates;
 
16
+@@global.log_slave_updates
 
17
+1
 
18
+CREATE TABLE t1(a INT);
 
19
+SET @var:=0;
 
20
+INSERT INTO t1 VALUES (@var);
 
21
+INSERT INTO t1 VALUES (1);
 
22
+DROP TABLE t1;
 
23
+include/rpl_sync.inc
 
24
+include/check_slave_param.inc [Exec_Master_Log_Pos]
 
25
+include/rpl_end.inc
 
26
--- /dev/null
 
27
+++ b/mysql-test/suite/rpl/t/percona_bug860910.cnf
 
28
@@ -0,0 +1,8 @@
 
29
+!include ../my.cnf
 
30
+
 
31
+[mysqld.1]
 
32
+log-slave-updates
 
33
+
 
34
+[mysqld.2]
 
35
+log-slave-updates
 
36
+
 
37
--- /dev/null
 
38
+++ b/mysql-test/suite/rpl/t/percona_bug860910.test
 
39
@@ -0,0 +1,38 @@
 
40
+########################################################################
 
41
+# Bug #860910: SHOW SLAVE STATUS gives wrong output with master-master
 
42
+#              and using SET uservars
 
43
+########################################################################
 
44
+
 
45
+--echo *** Set up master (server_1) <-> master (server_2) replication  ***
 
46
+--let $rpl_topology= 1->2->1
 
47
+--source include/rpl_init.inc
 
48
+--echo
 
49
+
 
50
+--connection server_1
 
51
+SELECT @@global.log_slave_updates;
 
52
+
 
53
+--connection server_2
 
54
+SELECT @@global.log_slave_updates;
 
55
+
 
56
+--connection server_1
 
57
+CREATE TABLE t1(a INT);
 
58
+SET @var:=0;
 
59
+INSERT INTO t1 VALUES (@var);
 
60
+INSERT INTO t1 VALUES (1);
 
61
+
 
62
+DROP TABLE t1;
 
63
+
 
64
+# The following would hang with the bug not fixed due to incorrect
 
65
+# Exec_Master_Log_Pos
 
66
+--source include/rpl_sync.inc
 
67
+
 
68
+--connection server_2
 
69
+--let $master_log_pos= query_get_value(SHOW MASTER STATUS, Position, 1)
 
70
+
 
71
+--connection server_1
 
72
+--let $slave_param= Exec_Master_Log_Pos
 
73
+--let $slave_param_value= $master_log_pos
 
74
+--source include/check_slave_param.inc
 
75
+
 
76
+# Cleanup
 
77
+--source include/rpl_end.inc
 
78
--- a/sql/log.cc
 
79
+++ b/sql/log.cc
 
80
@@ -5090,6 +5090,12 @@
 
81
                                  user_var_event->type,
 
82
                                  user_var_event->charset_number,
 
83
                                  flags);
 
84
+             /*
 
85
+               These User_var_log_events must be logged with event_info's
 
86
+               server_id, rather than the current one.
 
87
+             */
 
88
+             e.server_id= event_info->server_id;
 
89
+
 
90
             if (e.write(file))
 
91
               goto err;
 
92
             if (file == &log_file)