Merge lp:~sergei.glushchenko/percona-server/5.1-18205_03_wl47.patch into lp:percona-server/5.1

Proposed by Sergei Glushchenko
Status: Superseded
Proposed branch: lp:~sergei.glushchenko/percona-server/5.1-18205_03_wl47.patch
Merge into: lp:percona-server/5.1
Prerequisite: lp:~tsarev/percona-server/5.1-18205_02_wl36.patch
Diff against target: 4202 lines (+2841/-163) (has conflicts)
57 files modified
Percona-Server/client/client_priv.h (+6/-1)
Percona-Server/client/mysqlbinlog.cc (+175/-14)
Percona-Server/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test (+7/-2)
Percona-Server/mysql-test/extra/rpl_tests/rpl_log.test (+1/-0)
Percona-Server/mysql-test/extra/rpl_tests/rpl_row_annotate.test (+156/-0)
Percona-Server/mysql-test/include/binlog_start_pos.inc (+26/-0)
Percona-Server/mysql-test/include/show_binlog_events.inc (+1/-1)
Percona-Server/mysql-test/include/show_binlog_events2.inc (+1/-1)
Percona-Server/mysql-test/r/ctype_cp932_binlog_stm.result (+0/-3)
Percona-Server/mysql-test/r/mysqlbinlog.result (+11/-8)
Percona-Server/mysql-test/r/percona_server_variables_debug.result (+2/-0)
Percona-Server/mysql-test/r/percona_server_variables_release.result (+2/-0)
Percona-Server/mysql-test/std_data/words3.dat (+66/-0)
Percona-Server/mysql-test/suite/binlog/r/binlog_row_annotate.result (+1219/-0)
Percona-Server/mysql-test/suite/binlog/r/binlog_stm_binlog.result (+2/-2)
Percona-Server/mysql-test/suite/binlog/t/binlog_incident.test (+2/-1)
Percona-Server/mysql-test/suite/binlog/t/binlog_killed.test (+3/-1)
Percona-Server/mysql-test/suite/binlog/t/binlog_killed_simulate.test (+2/-1)
Percona-Server/mysql-test/suite/binlog/t/binlog_row_annotate-master.opt (+1/-0)
Percona-Server/mysql-test/suite/binlog/t/binlog_row_annotate.test (+189/-0)
Percona-Server/mysql-test/suite/rpl/r/percona_replicate_annotate_rows_events.result (+16/-0)
Percona-Server/mysql-test/suite/rpl/r/rpl_row_annotate_do.result (+141/-0)
Percona-Server/mysql-test/suite/rpl/r/rpl_row_annotate_dont.result (+123/-0)
Percona-Server/mysql-test/suite/rpl/r/rpl_row_conflicts.result (+1/-1)
Percona-Server/mysql-test/suite/rpl/t/percona_replicate_annotate_rows_events-master.opt (+1/-0)
Percona-Server/mysql-test/suite/rpl/t/percona_replicate_annotate_rows_events-slave.opt (+1/-0)
Percona-Server/mysql-test/suite/rpl/t/percona_replicate_annotate_rows_events.test (+35/-0)
Percona-Server/mysql-test/suite/rpl/t/rpl_row_annotate_do-slave.opt (+1/-0)
Percona-Server/mysql-test/suite/rpl/t/rpl_row_annotate_do.test (+16/-0)
Percona-Server/mysql-test/suite/rpl/t/rpl_row_annotate_dont-slave.opt (+1/-0)
Percona-Server/mysql-test/suite/rpl/t/rpl_row_annotate_dont.test (+9/-0)
Percona-Server/mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test (+2/-1)
Percona-Server/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test (+12/-6)
Percona-Server/mysql-test/suite/rpl/t/rpl_stm_flsh_tbls.test (+2/-1)
Percona-Server/mysql-test/t/ctype_cp932_binlog_stm.test (+0/-10)
Percona-Server/mysql-test/t/mysqlbinlog-master.opt (+0/-1)
Percona-Server/mysql-test/t/mysqlbinlog.test (+78/-21)
Percona-Server/mysql-test/t/mysqlbinlog2.test (+23/-11)
Percona-Server/sql/handler.cc (+7/-2)
Percona-Server/sql/log.cc (+19/-5)
Percona-Server/sql/log.h (+1/-1)
Percona-Server/sql/log_event.cc (+151/-9)
Percona-Server/sql/log_event.h (+61/-1)
Percona-Server/sql/mysql_priv.h (+5/-1)
Percona-Server/sql/mysqld.cc (+15/-0)
Percona-Server/sql/rpl_rli.cc (+3/-1)
Percona-Server/sql/rpl_rli.h (+38/-0)
Percona-Server/sql/set_var.cc (+3/-0)
Percona-Server/sql/slave.cc (+60/-16)
Percona-Server/sql/slave.h (+1/-0)
Percona-Server/sql/sql_binlog.cc (+1/-1)
Percona-Server/sql/sql_class.h (+3/-1)
Percona-Server/sql/sql_insert.cc (+5/-0)
Percona-Server/sql/sql_repl.cc (+50/-37)
doc/source/flexibility/annotate_rows_log_event.rst (+70/-0)
doc/source/index.rst (+6/-1)
doc/source/scalability/innodb_io.rst (+8/-0)
Text conflict in Percona-Server/client/client_priv.h
Text conflict in Percona-Server/client/mysqlbinlog.cc
Text conflict in doc/source/index.rst
Text conflict in doc/source/scalability/innodb_io.rst
To merge this branch: bzr merge lp:~sergei.glushchenko/percona-server/5.1-18205_03_wl47.patch
Reviewer Review Type Date Requested Status
Laurynas Biveinis (community) Needs Fixing
Review via email: mp+99857@code.launchpad.net

This proposal supersedes a proposal from 2012-02-17.

This proposal has been superseded by a proposal from 2012-03-29.

Description of the change

Feature wl47
http://jenkins.percona.com/view/Percona%20Server%205.1/job/percona-server-5.1-param/297/
https://blueprints.launchpad.net/percona-server/+spec/wl47

> I'd make a little class encapsulating annotate_event,
> keep_annotate_event, print_annotate_event, free_annotate_event
> methods.

done

> Adjust mysql-test/include/show_binlog_events.inc and
> show_binlog_events2.inc to refer to binlog_start_pos.inc.

done

> s/WL 47/MariaDB WL 47 everywhere.

done

> Line 3176: (MYQL_BIN_LOG::write): s/0/FALSE

done not only in this place

> Lines 3306+: Annotate_rows_log_event constructors: use initializer
> lists for m_query_txt and m_query_len initializations too.

done

To post a comment you must log in.
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote : Posted in a previous version of this proposal

To whomever is going to work on this next:

  I'd make a little class encapsulating annotate_event,
  keep_annotate_event, print_annotate_event, free_annotate_event
  methods.

  If not the class, then make mysqlbinlog.cc new functions
  static. Put free_annotate_event, read_remote_annotate_event,
  keep_annotate_event, print_annotate_event in a section of file with
  function implementations, not in the middle of variable
  declarations. Put read_remote_annotate_event away from the other three.

  Adjust mysql-test/include/show_binlog_events.inc and
  show_binlog_events2.inc to refer to binlog_start_pos.inc.

  s/WL 47/MariaDB WL 47 everywhere.

  Line 3176: (MYQL_BIN_LOG::write): s/0/FALSE

  Lines 3306+: Annotate_rows_log_event constructors: use initializer
  lists for m_query_txt and m_query_len initializations too.

review: Needs Fixing
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

The review diff has many conflicts, maybe due to the prerequisite branch?

review: Needs Fixing

Unmerged revisions

429. By Sergei Glushchenko

Merge MariaDB WL #47 - annotate rows log events

428. By Oleg Tsarev

merge lp:~tsarev/percona-server/5.1-18205_02_wl36.patch

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Percona-Server/client/client_priv.h'
2--- Percona-Server/client/client_priv.h 2012-02-09 15:03:59 +0000
3+++ Percona-Server/client/client_priv.h 2012-03-29 03:25:47 +0000
4@@ -97,7 +97,12 @@
5 OPT_SYSLOG,
6 #endif
7 OPT_FIRST_SLAVE,
8- OPT_REWRITE_DB,
9+<<<<<<< TREE
10+ OPT_REWRITE_DB,
11+=======
12+ OPT_REWRITE_DB,
13+ OPT_SKIP_ANNOTATE_ROWS_EVENTS,
14+>>>>>>> MERGE-SOURCE
15 OPT_ALL,
16 OPT_NO_REMOVE_EOL_CARRET,
17 OPT_INNODB_OPTIMIZE_KEYS,
18
19=== modified file 'Percona-Server/client/mysqlbinlog.cc'
20--- Percona-Server/client/mysqlbinlog.cc 2012-03-16 09:08:25 +0000
21+++ Percona-Server/client/mysqlbinlog.cc 2012-03-29 03:25:47 +0000
22@@ -110,6 +110,7 @@
23 static short binlog_flags = 0;
24 static MYSQL* mysql = NULL;
25 static const char* dirname_for_local_load= 0;
26+static bool opt_skip_annotate_rows_events= 0;
27
28 /**
29 Pointer to the Format_description_log_event of the currently active binlog.
30@@ -131,6 +132,81 @@
31 OK_STOP
32 };
33
34+class Annotate_event
35+{
36+ /**
37+ Pointer to the last read Annotate_rows_log_event. Having read an
38+ Annotate_rows event, we should not print it immediatedly because all
39+ subsequent rbr events can be filtered away, and have to keep it for a while.
40+ Also because of that when reading a remote Annotate event we have to keep
41+ its binary log representation in a separately allocated buffer.
42+ */
43+ Annotate_rows_log_event *annotate_event;
44+
45+public:
46+
47+ Annotate_event() : annotate_event(NULL) {}
48+
49+ ~Annotate_event()
50+ {
51+ free();
52+ }
53+
54+ void free()
55+ {
56+ delete annotate_event;
57+ annotate_event= NULL;
58+ }
59+
60+ void keep(Annotate_rows_log_event* event)
61+ {
62+ free();
63+ annotate_event= event;
64+ }
65+
66+ void print(PRINT_EVENT_INFO *print_event_info)
67+ {
68+ if (annotate_event)
69+ {
70+ annotate_event->print(result_file, print_event_info);
71+ free(); // the event should not be printed more than once
72+ }
73+ }
74+
75+};
76+
77+static Annotate_event annotate_event;
78+
79+Log_event* read_remote_annotate_event(uchar* net_buf, ulong event_len,
80+ const char **error_msg)
81+{
82+ uchar *event_buf;
83+ Log_event* event;
84+
85+ if (!(event_buf= (uchar*) my_malloc(event_len + 1, MYF(MY_WME))))
86+ {
87+ error("Out of memory");
88+ return 0;
89+ }
90+
91+ memcpy(event_buf, net_buf, event_len);
92+ event_buf[event_len]= 0;
93+
94+ if (!(event= Log_event::read_log_event((const char*) event_buf, event_len,
95+ error_msg, glob_description_event)))
96+ {
97+ my_free(event_buf, MYF(0));
98+ return 0;
99+ }
100+ /*
101+ Ensure the event->temp_buf is pointing to the allocated buffer.
102+ (TRUE = free temp_buf on the event deletion)
103+ */
104+ event->register_temp_buf((char*)event_buf, TRUE);
105+
106+ return event;
107+}
108+
109 static Exit_status dump_local_log_entries(PRINT_EVENT_INFO *print_event_info,
110 const char* logname);
111 static Exit_status dump_remote_log_entries(PRINT_EVENT_INFO *print_event_info,
112@@ -956,6 +1032,19 @@
113 my_free(fname, MYF(MY_WME));
114 break;
115 }
116+ case ANNOTATE_ROWS_EVENT:
117+ if (!opt_skip_annotate_rows_events)
118+ {
119+ /*
120+ We don't print Annotate event just now because all subsequent
121+ rbr-events can be filtered away. Instead we'll keep the event
122+ till it will be printed together with the first not filtered
123+ away Table map or the last rbr will be processed.
124+ */
125+ annotate_event.keep((Annotate_rows_log_event*) ev);
126+ destroy_evt= FALSE;
127+ }
128+ break;
129 case TABLE_MAP_EVENT:
130 {
131 Table_map_log_event *map= ((Table_map_log_event *)ev);
132@@ -965,14 +1054,32 @@
133 destroy_evt= FALSE;
134 goto end;
135 }
136- size_t len_to= 0;
137- const char* db_to= binlog_filter->get_rewrite_db(map->get_db_name(),
138- &len_to);
139- if (len_to && map->rewrite_db(db_to, len_to, glob_description_event))
140- {
141- error("Could not rewrite database name");
142- goto err;
143- }
144+<<<<<<< TREE
145+ size_t len_to= 0;
146+ const char* db_to= binlog_filter->get_rewrite_db(map->get_db_name(),
147+ &len_to);
148+ if (len_to && map->rewrite_db(db_to, len_to, glob_description_event))
149+ {
150+ error("Could not rewrite database name");
151+ goto err;
152+ }
153+=======
154+ /*
155+ The Table map is to be printed, so it's just the time when we may
156+ print the kept Annotate event (if there is any).
157+ annotate_event.print() also deletes the kept Annotate event.
158+ */
159+ annotate_event.print(print_event_info);
160+
161+ size_t len_to= 0;
162+ const char* db_to= binlog_filter->get_rewrite_db(map->get_db_name(),
163+ &len_to);
164+ if (len_to && map->rewrite_db(db_to, len_to, glob_description_event))
165+ {
166+ error("Could not rewrite database name");
167+ goto err;
168+ }
169+>>>>>>> MERGE-SOURCE
170 }
171 case WRITE_ROWS_EVENT:
172 case DELETE_ROWS_EVENT:
173@@ -1002,6 +1109,13 @@
174 if (print_event_info->m_table_map_ignored.count() > 0)
175 print_event_info->m_table_map_ignored.clear_tables();
176
177+ /*
178+ If there is a kept Annotate event and all corresponding
179+ rbr-events were filtered away, the Annotate event was not
180+ freed and it is just the time to do it.
181+ */
182+ annotate_event.free();
183+
184 /*
185 One needs to take into account an event that gets
186 filtered but was last event in the statement. If this is
187@@ -1235,10 +1349,22 @@
188 "Used to reserve file descriptors for use by this program.",
189 &open_files_limit, &open_files_limit, 0, GET_ULONG,
190 REQUIRED_ARG, MY_NFILE, 8, OS_FILE_LIMIT, 0, 1, 0},
191- {"rewrite-db", OPT_REWRITE_DB,
192- "Updates to a database with a different name than the original. \
193-Example: rewrite-db='from->to'.",
194- 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
195+<<<<<<< TREE
196+ {"rewrite-db", OPT_REWRITE_DB,
197+ "Updates to a database with a different name than the original. \
198+Example: rewrite-db='from->to'.",
199+ 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
200+=======
201+ {"rewrite-db", OPT_REWRITE_DB,
202+ "Updates to a database with a different name than the original. \
203+Example: rewrite-db='from->to'.",
204+ 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
205+ {"skip-annotate-rows-events", OPT_SKIP_ANNOTATE_ROWS_EVENTS,
206+ "Don't print Annotate_rows events stored in the binary log.",
207+ (uchar**) &opt_skip_annotate_rows_events,
208+ (uchar**) &opt_skip_annotate_rows_events,
209+ 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
210+>>>>>>> MERGE-SOURCE
211 {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
212 };
213
214@@ -1703,6 +1829,8 @@
215 cast to uint32.
216 */
217 int4store(buf, (uint32)start_position);
218+ if (!opt_skip_annotate_rows_events)
219+ binlog_flags|= BINLOG_SEND_ANNOTATE_ROWS_EVENT;
220 int2store(buf + BIN_LOG_HEADER_SIZE, binlog_flags);
221
222 size_t tlen = strlen(logname);
223@@ -1735,6 +1863,7 @@
224 break; // end of data
225 DBUG_PRINT("info",( "len: %lu net->read_pos[5]: %d\n",
226 len, net->read_pos[5]));
227+<<<<<<< TREE
228 if (!(ev= Log_event::read_log_event((const char*) net->read_pos + 1 ,
229 len - 1, &error_msg,
230 glob_description_event)))
231@@ -1747,6 +1876,32 @@
232 Log_event class is pointing to the incoming stream.
233 */
234 ev->register_temp_buf((char *) net->read_pos + 1, FALSE);
235+=======
236+ if (net->read_pos[5] == ANNOTATE_ROWS_EVENT)
237+ {
238+ if (!(ev= read_remote_annotate_event(net->read_pos + 1, len - 1,
239+ &error_msg)))
240+ {
241+ error("Could not construct annotate event object: %s", error_msg);
242+ DBUG_RETURN(ERROR_STOP);
243+ }
244+ }
245+ else
246+ {
247+ if (!(ev= Log_event::read_log_event((const char*) net->read_pos + 1 ,
248+ len - 1, &error_msg,
249+ glob_description_event)))
250+ {
251+ error("Could not construct log event object: %s", error_msg);
252+ DBUG_RETURN(ERROR_STOP);
253+ }
254+ /*
255+ If reading from a remote host, ensure the temp_buf for the
256+ Log_event class is pointing to the incoming stream.
257+ */
258+ ev->register_temp_buf((char *) net->read_pos + 1, FALSE);
259+ }
260+>>>>>>> MERGE-SOURCE
261
262 Log_event_type type= ev->get_type_code();
263 if (glob_description_event->binlog_version >= 3 ||
264@@ -2256,8 +2411,14 @@
265 if (result_file != stdout)
266 my_fclose(result_file, MYF(0));
267 cleanup();
268- delete binlog_filter;
269- free_root(&s_mem_root, MYF(0));
270+<<<<<<< TREE
271+ delete binlog_filter;
272+ free_root(&s_mem_root, MYF(0));
273+=======
274+ annotate_event.free();
275+ delete binlog_filter;
276+ free_root(&s_mem_root, MYF(0));
277+>>>>>>> MERGE-SOURCE
278 free_defaults(defaults_argv);
279 my_free_open_file_info();
280 load_processor.destroy();
281
282=== modified file 'Percona-Server/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test'
283--- Percona-Server/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test 2008-03-03 09:17:32 +0000
284+++ Percona-Server/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test 2012-03-29 03:25:47 +0000
285@@ -321,14 +321,19 @@
286 # we check that the error code of the "ROLLBACK" event is 0 and not
287 # ER_SERVER_SHUTDOWN (i.e. disconnection just rolls back transaction
288 # and does not make slave to stop)
289+
290+-- source include/binlog_start_pos.inc
291+
292 if (`select @@binlog_format = 'ROW'`)
293 {
294- --exec $MYSQL_BINLOG --start-position=524 $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output
295+ let $start_pos= `select @binlog_start + 418`;
296+ --exec $MYSQL_BINLOG --start-position=$start_pos $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output
297 }
298
299 if (`select @@binlog_format = 'STATEMENT' || @@binlog_format = 'MIXED'`)
300 {
301- --exec $MYSQL_BINLOG --start-position=555 $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output
302+ let $start_pos= `select @binlog_start + 449`;
303+ --exec $MYSQL_BINLOG --start-position=$start_pos $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output
304 }
305
306 --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
307
308=== modified file 'Percona-Server/mysql-test/extra/rpl_tests/rpl_log.test'
309--- Percona-Server/mysql-test/extra/rpl_tests/rpl_log.test 2010-12-19 17:07:28 +0000
310+++ Percona-Server/mysql-test/extra/rpl_tests/rpl_log.test 2012-03-29 03:25:47 +0000
311@@ -14,6 +14,7 @@
312 reset master;
313 reset slave;
314 source include/start_slave.inc;
315+source include/binlog_start_pos.inc;
316
317 let $VERSION=`select version()`;
318
319
320=== added file 'Percona-Server/mysql-test/extra/rpl_tests/rpl_row_annotate.test'
321--- Percona-Server/mysql-test/extra/rpl_tests/rpl_row_annotate.test 1970-01-01 00:00:00 +0000
322+++ Percona-Server/mysql-test/extra/rpl_tests/rpl_row_annotate.test 2012-03-29 03:25:47 +0000
323@@ -0,0 +1,156 @@
324+##########################################################################
325+# MariaDB WL 47: Store in binlog text of statements that caused RBR events
326+# new event : ANNOTATE_ROWS_EVENT
327+# new master option : --binlog-annotate-rows-events
328+# new slave option : --replicate-annotate-rows-events
329+##########################################################################
330+--source include/master-slave.inc
331+connect (master2,127.0.0.1,root,,test,$MASTER_MYPORT,);
332+
333+connection master;
334+--disable_query_log
335+
336+--disable_warnings
337+DROP DATABASE IF EXISTS test1;
338+--enable_warnings
339+
340+CREATE DATABASE test1;
341+USE test1;
342+
343+CREATE TABLE t1(a int primary key, b int);
344+CREATE TABLE t2(a int, b int);
345+CREATE TABLE t3(a int, b int);
346+CREATE TABLE t4(a int, b int);
347+CREATE TABLE xt1(a int, b int);
348+CREATE TABLE xt2(a int, b int);
349+
350+CREATE TABLE t5 (
351+ a INT PRIMARY KEY AUTO_INCREMENT,
352+ b VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_bin
353+);
354+
355+SET SESSION binlog_annotate_rows_events = OFF;
356+
357+INSERT INTO t1 VALUES (0,0), (1,1);
358+
359+SET SESSION binlog_annotate_rows_events = ON;
360+
361+UPDATE t1 SET b = b + 1;
362+REPLACE t1 VALUES (1,1), (2,2), (3,3);
363+
364+INSERT INTO t2 VALUES (1,1), (2,2), (3,3);
365+INSERT INTO t3 VALUES (1,1), (2,2), (3,3);
366+DELETE t1, t2 FROM t1 INNER JOIN t2 INNER JOIN t3 WHERE t1.a=t2.a AND t2.a=t3.a;
367+
368+INSERT INTO xt1 VALUES (1,1), (2,2), (3,3);
369+INSERT INTO t2 VALUES (1,1), (2,2), (3,3);
370+DELETE xt1, t2 FROM xt1 INNER JOIN t2 INNER JOIN t3 WHERE xt1.a=t2.a AND t2.a=t3.a;
371+
372+INSERT INTO xt1 VALUES (1,1), (2,2), (3,3);
373+INSERT INTO xt2 VALUES (1,1), (2,2), (3,3);
374+DELETE xt1, xt2 FROM xt1 INNER JOIN xt2 INNER JOIN t3 WHERE xt1.a=xt2.a AND xt2.a=t3.a;
375+
376+INSERT INTO t5(b) VALUES ('foo'), ('bar'), ('baz');
377+SET NAMES latin1;
378+INSERT INTO t5(b) VALUES ('gås');
379+SET NAMES utf8;
380+INSERT INTO t5(b) VALUES ('gås');
381+SET NAMES latin1;
382+
383+FLUSH LOGS;
384+
385+--echo ########################################################################
386+--echo # TABLES ON MASTER
387+--echo ########################################################################
388+--enable_query_log
389+
390+SELECT * FROM t1 ORDER BY a;
391+SELECT * FROM t2 ORDER BY a;
392+SELECT * FROM t3 ORDER BY a;
393+SELECT * FROM t5 ORDER BY a;
394+
395+sync_slave_with_master;
396+--echo ########################################################################
397+--echo # TABLES ON SLAVE: should be the same as on master
398+--echo ########################################################################
399+--disable_query_log
400+USE test1;
401+--enable_query_log
402+
403+SELECT * FROM t1 ORDER BY a;
404+SELECT * FROM t2 ORDER BY a;
405+SELECT * FROM t3 ORDER BY a;
406+SELECT * FROM t5 ORDER BY a;
407+
408+--echo ########################################################################
409+--echo # EVENTS ON SLAVE
410+let $annotate= `select @@global.replicate_annotate_rows_events`;
411+if ($annotate)
412+{
413+ --echo # The following Annotate_rows events should appear below:
414+ --echo # - UPDATE t1 SET b = b + 1;
415+ --echo # - REPLACE t1 VALUES (1,1), (2,2), (3,3);
416+ --echo # - INSERT INTO t2 VALUES (1,1), (2,2), (3,3)
417+ --echo # - INSERT INTO t3 VALUES (1,1), (2,2), (3,3)
418+ --echo # - DELETE t1, t2 FROM <...>
419+ --echo # - INSERT INTO t2 VALUES (1,1), (2,2), (3,3)
420+ --echo # - DELETE xt1, t2 FROM <...>
421+ --echo # - INSERT INTO t5(b) VALUES <...> (3 instances)
422+}
423+if (!$annotate)
424+{
425+ --echo # No Annotate_rows events should appear below
426+}
427+--echo ########################################################################
428+FLUSH LOGS;
429+
430+--source include/binlog_start_pos.inc
431+let $start_pos= `select @binlog_start`;
432+--replace_column 2 # 5 #
433+--replace_result $start_pos <start_pos>
434+--replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\//
435+--eval show binlog events in 'slave-bin.000001' from $start_pos
436+
437+--echo #
438+--echo ########################################################################
439+--echo # INSERTs DELAYED ON MASTERs
440+--echo ########################################################################
441+connection master;
442+SET SESSION binlog_annotate_rows_events = ON;
443+INSERT DELAYED INTO test1.t4 VALUES (1,1);
444+FLUSH TABLES;
445+SELECT * FROM test1.t4 ORDER BY a;
446+
447+sync_slave_with_master;
448+connection master;
449+sync_slave_with_master;
450+
451+--echo ########################################################################
452+--echo # ON SLAVE
453+--echo # No Annotate_rows events should appear below
454+--echo ########################################################################
455+FLUSH LOGS;
456+
457+--exec $MYSQL --host=127.0.0.1 --port=$SLAVE_MYPORT test -e "show binlog events in 'slave-bin.000002'" > $MYSQLTEST_VARDIR/tmp/annotated_events.txt
458+perl;
459+ open F, '<', "$ENV{MYSQLTEST_VARDIR}/tmp/annotated_events.txt" or die;
460+ binmode STDOUT;
461+ while (defined ($_ = <F>)) {
462+ if (/Annotate_rows/) {
463+ s/[0-9]+\sAnnotate_rows\s[0-9]+\s[0-9]+/# Annotate_rows # #/;
464+ print($_);
465+ $_ = <F>;
466+ s/[0-9]+\sTable_map\s[0-9]+\s[0-9]+\stable_id:\s[0-9]+/# Table_map # # table_id: #/;
467+ print($_);
468+ }
469+ }
470+EOF
471+
472+# Clean-up
473+connection master;
474+--disable_query_log
475+DROP DATABASE test1;
476+sync_slave_with_master;
477+--enable_query_log
478+
479+--source include/rpl_end.inc
480
481=== added file 'Percona-Server/mysql-test/include/binlog_start_pos.inc'
482--- Percona-Server/mysql-test/include/binlog_start_pos.inc 1970-01-01 00:00:00 +0000
483+++ Percona-Server/mysql-test/include/binlog_start_pos.inc 2012-03-29 03:25:47 +0000
484@@ -0,0 +1,26 @@
485+##############################################################################
486+#
487+# binlog_start is the postion of the the first event in the binary log
488+# which follows the Format description event. Intended to reduce test suite
489+# dependance on the Format description event length changes (e.g. in case
490+# of adding new events). Evaluated as:
491+#
492+# binlog_start = 4 /* binlog header */ +
493+# (Format_description_log_event length)
494+#
495+# Format_description_log_event length =
496+# 19 /* event common header */ +
497+# 57 /* misc stuff in the Format description header */ +
498+# number of events.
499+#
500+# With current number of events = 160,
501+#
502+# binlog_start = 4 + 19 + 57 + 160 = 240.
503+#
504+##############################################################################
505+
506+let $binlog_start=240;
507+--disable_query_log
508+SET @binlog_start=240;
509+--enable_query_log
510+
511
512=== modified file 'Percona-Server/mysql-test/include/show_binlog_events.inc'
513--- Percona-Server/mysql-test/include/show_binlog_events.inc 2010-10-21 13:20:50 +0000
514+++ Percona-Server/mysql-test/include/show_binlog_events.inc 2012-03-29 03:25:47 +0000
515@@ -3,7 +3,7 @@
516 #
517 # Useage:
518 # let $binlog_file= master-bin.000002;
519-# let $binlog_start= 106;
520+# source include/binlog_start_pos.inc;
521 # let $binlog_limit= 1, 3;
522 # source include/show_binlog_events.inc;
523 #
524
525=== modified file 'Percona-Server/mysql-test/include/show_binlog_events2.inc'
526--- Percona-Server/mysql-test/include/show_binlog_events2.inc 2008-02-05 13:52:20 +0000
527+++ Percona-Server/mysql-test/include/show_binlog_events2.inc 2012-03-29 03:25:47 +0000
528@@ -1,4 +1,4 @@
529---let $binlog_start=106
530+--source include/binlog_start_pos.inc
531 --replace_result $binlog_start <binlog_start>
532 --replace_column 2 # 5 #
533 --replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
534
535=== modified file 'Percona-Server/mysql-test/r/ctype_cp932_binlog_stm.result'
536--- Percona-Server/mysql-test/r/ctype_cp932_binlog_stm.result 2011-03-30 12:33:53 +0000
537+++ Percona-Server/mysql-test/r/ctype_cp932_binlog_stm.result 2012-03-29 03:25:47 +0000
538@@ -44,9 +44,6 @@
539 master-bin.000001 # Query # # use `test`; DROP PROCEDURE bug18293
540 master-bin.000001 # Query # # use `test`; DROP TABLE t4
541 End of 5.0 tests
542-call mtr.add_suppression("Error in Log_event::read_log_event\\\(\\\): 'Sanity check failed', data_len: 258, event_type: 49");
543-SHOW BINLOG EVENTS FROM 365;
544-ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Wrong offset or I/O error
545 Bug#44352 UPPER/LOWER function doesn't work correctly on cp932 and sjis environment.
546 CREATE TABLE t1 (a varchar(16)) character set cp932;
547 INSERT INTO t1 VALUES (0x8372835E),(0x8352835E);
548
549=== modified file 'Percona-Server/mysql-test/r/mysqlbinlog.result'
550--- Percona-Server/mysql-test/r/mysqlbinlog.result 2012-02-09 15:01:35 +0000
551+++ Percona-Server/mysql-test/r/mysqlbinlog.result 2012-03-29 03:25:47 +0000
552@@ -1,15 +1,17 @@
553 reset master;
554+SET @save_binlog_size= @@global.max_binlog_size;
555+SET @@global.max_binlog_size= 4096;
556 set timestamp=1000000000;
557 drop table if exists t1,t2,t3,t4,t5,t03,t04;
558 create table t1 (word varchar(20));
559 create table t2 (id int auto_increment not null primary key);
560 insert into t1 values ("abirvalg");
561 insert into t2 values ();
562-load data infile '../../std_data/words.dat' into table t1;
563-load data infile '../../std_data/words.dat' into table t1;
564-load data infile '../../std_data/words.dat' into table t1;
565-load data infile '../../std_data/words.dat' into table t1;
566-load data infile '../../std_data/words.dat' into table t1;
567+load data infile '../../std_data/words3.dat' into table t1;
568+load data infile '../../std_data/words3.dat' into table t1;
569+load data infile '../../std_data/words3.dat' into table t1;
570+load data infile '../../std_data/words3.dat' into table t1;
571+load data infile '../../std_data/words3.dat' into table t1;
572 insert into t1 values ("Alas");
573 flush logs;
574
575@@ -255,6 +257,7 @@
576 ROLLBACK /* added by mysqlbinlog */;
577 /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
578 drop table t1,t2;
579+SET @@global.max_binlog_size= @save_binlog_size;
580 flush logs;
581 flush logs;
582 select * from t5 /* must be (1),(1) */;
583@@ -377,14 +380,14 @@
584 /*!*/;
585 SET TIMESTAMP=1000000000/*!*/;
586 SET @@session.collation_database=7/*!*/;
587-LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-a-0' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`)
588+LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`)
589 /*!*/;
590 SET TIMESTAMP=1000000000/*!*/;
591 SET @@session.collation_database=DEFAULT/*!*/;
592-LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-b-0' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`)
593+LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`)
594 /*!*/;
595 SET TIMESTAMP=1000000000/*!*/;
596-LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-c-0' INTO TABLE `t1` CHARACTER SET koi8r FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`)
597+LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` CHARACTER SET koi8r FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`)
598 /*!*/;
599 SET TIMESTAMP=1000000000/*!*/;
600 drop table t1
601
602=== modified file 'Percona-Server/mysql-test/r/percona_server_variables_debug.result'
603--- Percona-Server/mysql-test/r/percona_server_variables_debug.result 2012-01-30 04:30:33 +0000
604+++ Percona-Server/mysql-test/r/percona_server_variables_debug.result 2012-03-29 03:25:47 +0000
605@@ -7,6 +7,7 @@
606 BACK_LOG
607 BASEDIR
608 BIG_TABLES
609+BINLOG_ANNOTATE_ROWS_EVENTS
610 BINLOG_CACHE_SIZE
611 BINLOG_DIRECT_NON_TRANSACTIONAL_UPDATES
612 BINLOG_FORMAT
613@@ -273,6 +274,7 @@
614 RELAY_LOG_INFO_FILE
615 RELAY_LOG_PURGE
616 RELAY_LOG_SPACE_LIMIT
617+REPLICATE_ANNOTATE_ROWS_EVENTS
618 REPORT_HOST
619 REPORT_PASSWORD
620 REPORT_PORT
621
622=== modified file 'Percona-Server/mysql-test/r/percona_server_variables_release.result'
623--- Percona-Server/mysql-test/r/percona_server_variables_release.result 2011-11-24 02:01:33 +0000
624+++ Percona-Server/mysql-test/r/percona_server_variables_release.result 2012-03-29 03:25:47 +0000
625@@ -7,6 +7,7 @@
626 BACK_LOG
627 BASEDIR
628 BIG_TABLES
629+BINLOG_ANNOTATE_ROWS_EVENTS
630 BINLOG_CACHE_SIZE
631 BINLOG_DIRECT_NON_TRANSACTIONAL_UPDATES
632 BINLOG_FORMAT
633@@ -270,6 +271,7 @@
634 RELAY_LOG_INFO_FILE
635 RELAY_LOG_PURGE
636 RELAY_LOG_SPACE_LIMIT
637+REPLICATE_ANNOTATE_ROWS_EVENTS
638 REPORT_HOST
639 REPORT_PASSWORD
640 REPORT_PORT
641
642=== added file 'Percona-Server/mysql-test/std_data/words3.dat'
643--- Percona-Server/mysql-test/std_data/words3.dat 1970-01-01 00:00:00 +0000
644+++ Percona-Server/mysql-test/std_data/words3.dat 2012-03-29 03:25:47 +0000
645@@ -0,0 +1,66 @@
646+Aarhus
647+Aaron
648+Ababa
649+aback
650+abaft
651+abandon
652+abandoned
653+abandoning
654+abandonment
655+abandons
656+Aarhus
657+Aaron
658+Ababa
659+aback
660+abaft
661+abandon
662+abandoned
663+abandoning
664+abandonment
665+abandons
666+abase
667+abased
668+abasement
669+abasements
670+abases
671+abash
672+abashed
673+abashes
674+abashing
675+abasing
676+abate
677+abated
678+abatement
679+abatements
680+abater
681+abates
682+abating
683+Abba
684+abbe
685+abbey
686+abbeys
687+abbot
688+abbots
689+Abbott
690+abbreviate
691+abbreviated
692+abbreviates
693+abbreviating
694+abbreviation
695+abbreviations
696+Abby
697+abdomen
698+abdomens
699+abdominal
700+abduct
701+abducted
702+abduction
703+abductions
704+abductor
705+abductors
706+abducts
707+Abe
708+abed
709+Abel
710+Abelian
711+Abelson
712
713=== added file 'Percona-Server/mysql-test/suite/binlog/r/binlog_row_annotate.result'
714--- Percona-Server/mysql-test/suite/binlog/r/binlog_row_annotate.result 1970-01-01 00:00:00 +0000
715+++ Percona-Server/mysql-test/suite/binlog/r/binlog_row_annotate.result 2012-03-29 03:25:47 +0000
716@@ -0,0 +1,1219 @@
717+#####################################################################################
718+# The following Annotate_rows events should appear below:
719+# - INSERT INTO test2.t2 VALUES (1), (2), (3)
720+# - INSERT INTO test3.t3 VALUES (1), (2), (3)
721+# - DELETE test1.t1, test2.t2 FROM <...>
722+# - INSERT INTO test2.t2 VALUES (1), (2), (3)
723+# - DELETE xtest1.xt1, test2.t2 FROM <...>
724+#####################################################################################
725+show binlog events in 'master-bin.000001' from <start_pos>;
726+Log_name Pos Event_type Server_id End_log_pos Info
727+master-bin.000001 # Query 1 # DROP DATABASE IF EXISTS test1
728+master-bin.000001 # Query 1 # DROP DATABASE IF EXISTS test2
729+master-bin.000001 # Query 1 # DROP DATABASE IF EXISTS test3
730+master-bin.000001 # Query 1 # CREATE DATABASE test1
731+master-bin.000001 # Query 1 # CREATE DATABASE test2
732+master-bin.000001 # Query 1 # CREATE DATABASE test3
733+master-bin.000001 # Query 1 # BEGIN
734+master-bin.000001 # Table_map 1 # table_id: # (test1.t1)
735+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
736+master-bin.000001 # Query 1 # COMMIT
737+master-bin.000001 # Query 1 # BEGIN
738+master-bin.000001 # Annotate_rows 1 # INSERT INTO test2.t2 VALUES (1), (2), (3)
739+master-bin.000001 # Table_map 1 # table_id: # (test2.t2)
740+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
741+master-bin.000001 # Query 1 # COMMIT
742+master-bin.000001 # Query 1 # BEGIN
743+master-bin.000001 # Annotate_rows 1 # INSERT INTO test3.t3 VALUES (1), (2), (3)
744+master-bin.000001 # Table_map 1 # table_id: # (test3.t3)
745+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
746+master-bin.000001 # Query 1 # COMMIT
747+master-bin.000001 # Query 1 # BEGIN
748+master-bin.000001 # Annotate_rows 1 # DELETE test1.t1, test2.t2
749+FROM test1.t1 INNER JOIN test2.t2 INNER JOIN test3.t3
750+WHERE test1.t1.a=test2.t2.a AND test2.t2.a=test3.t3.a
751+master-bin.000001 # Table_map 1 # table_id: # (test1.t1)
752+master-bin.000001 # Table_map 1 # table_id: # (test2.t2)
753+master-bin.000001 # Delete_rows 1 # table_id: #
754+master-bin.000001 # Delete_rows 1 # table_id: # flags: STMT_END_F
755+master-bin.000001 # Query 1 # COMMIT
756+master-bin.000001 # Query 1 # BEGIN
757+master-bin.000001 # Annotate_rows 1 # INSERT INTO test2.v2 VALUES (1), (2), (3)
758+master-bin.000001 # Table_map 1 # table_id: # (test2.t2)
759+master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
760+master-bin.000001 # Query 1 # COMMIT
761+master-bin.000001 # Query 1 # BEGIN
762+master-bin.000001 # Annotate_rows 1 # DELETE xtest1.xt1, test2.t2
763+FROM xtest1.xt1 INNER JOIN test2.t2 INNER JOIN test3.t3
764+WHERE xtest1.xt1.a=test2.t2.a AND test2.t2.a=test3.t3.a
765+master-bin.000001 # Table_map 1 # table_id: # (test2.t2)
766+master-bin.000001 # Delete_rows 1 # table_id: # flags: STMT_END_F
767+master-bin.000001 # Query 1 # COMMIT
768+master-bin.000001 # Rotate 1 # master-bin.000002;pos=4
769+#
770+#####################################################################################
771+# mysqlbinlog
772+# The following Annotates should appear in this output:
773+# - INSERT INTO test2.t2 VALUES (1), (2), (3)
774+# - INSERT INTO test3.t3 VALUES (1), (2), (3)
775+# - DELETE test1.t1, test2.t2 FROM <...> (with two subsequent Table maps)
776+# - INSERT INTO test2.t2 VALUES (1), (2), (3)
777+# - DELETE xtest1.xt1, test2.t2 FROM <...> (with one subsequent Table map)
778+#####################################################################################
779+/*!40019 SET @@session.max_insert_delayed_threads=0*/;
780+/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
781+DELIMITER /*!*/;
782+# at #
783+#010909 4:46:40 server id # end_log_pos # Start: binlog v 4, server v #.##.## created 010909 4:46:40 at startup
784+ROLLBACK/*!*/;
785+# at #
786+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
787+SET TIMESTAMP=1000000000/*!*/;
788+SET @@session.pseudo_thread_id=#/*!*/;
789+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
790+SET @@session.sql_mode=0/*!*/;
791+SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
792+/*!\C latin1 *//*!*/;
793+SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
794+SET @@session.lc_time_names=0/*!*/;
795+SET @@session.collation_database=DEFAULT/*!*/;
796+DROP DATABASE IF EXISTS test1
797+/*!*/;
798+# at #
799+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
800+SET TIMESTAMP=1000000000/*!*/;
801+DROP DATABASE IF EXISTS test2
802+/*!*/;
803+# at #
804+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
805+SET TIMESTAMP=1000000000/*!*/;
806+DROP DATABASE IF EXISTS test3
807+/*!*/;
808+# at #
809+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
810+SET TIMESTAMP=1000000000/*!*/;
811+CREATE DATABASE test1
812+/*!*/;
813+# at #
814+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
815+SET TIMESTAMP=1000000000/*!*/;
816+CREATE DATABASE test2
817+/*!*/;
818+# at #
819+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
820+SET TIMESTAMP=1000000000/*!*/;
821+CREATE DATABASE test3
822+/*!*/;
823+# at #
824+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
825+SET TIMESTAMP=1000000000/*!*/;
826+BEGIN
827+/*!*/;
828+# at #
829+# at #
830+#010909 4:46:40 server id # end_log_pos # Table_map: `test1`.`t1` mapped to number #
831+#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
832+### INSERT INTO test1.t1
833+### SET
834+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
835+### INSERT INTO test1.t1
836+### SET
837+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
838+### INSERT INTO test1.t1
839+### SET
840+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
841+# at #
842+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
843+SET TIMESTAMP=1000000000/*!*/;
844+COMMIT
845+/*!*/;
846+# at #
847+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
848+SET TIMESTAMP=1000000000/*!*/;
849+BEGIN
850+/*!*/;
851+# at #
852+# at #
853+# at #
854+#010909 4:46:40 server id # end_log_pos # Annotate_rows:
855+#Q> INSERT INTO test2.t2 VALUES (1), (2), (3)
856+#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
857+#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
858+### INSERT INTO test2.t2
859+### SET
860+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
861+### INSERT INTO test2.t2
862+### SET
863+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
864+### INSERT INTO test2.t2
865+### SET
866+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
867+# at #
868+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
869+SET TIMESTAMP=1000000000/*!*/;
870+COMMIT
871+/*!*/;
872+# at #
873+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
874+SET TIMESTAMP=1000000000/*!*/;
875+BEGIN
876+/*!*/;
877+# at #
878+# at #
879+# at #
880+#010909 4:46:40 server id # end_log_pos # Annotate_rows:
881+#Q> INSERT INTO test3.t3 VALUES (1), (2), (3)
882+#010909 4:46:40 server id # end_log_pos # Table_map: `test3`.`t3` mapped to number #
883+#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
884+### INSERT INTO test3.t3
885+### SET
886+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
887+### INSERT INTO test3.t3
888+### SET
889+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
890+### INSERT INTO test3.t3
891+### SET
892+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
893+# at #
894+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
895+SET TIMESTAMP=1000000000/*!*/;
896+COMMIT
897+/*!*/;
898+# at #
899+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
900+SET TIMESTAMP=1000000000/*!*/;
901+BEGIN
902+/*!*/;
903+# at #
904+# at #
905+# at #
906+# at #
907+# at #
908+#010909 4:46:40 server id # end_log_pos # Annotate_rows:
909+#Q> DELETE test1.t1, test2.t2
910+#Q> FROM test1.t1 INNER JOIN test2.t2 INNER JOIN test3.t3
911+#Q> WHERE test1.t1.a=test2.t2.a AND test2.t2.a=test3.t3
912+#010909 4:46:40 server id # end_log_pos # Table_map: `test1`.`t1` mapped to number #
913+#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
914+#010909 4:46:40 server id # end_log_pos # Delete_rows: table id #
915+#010909 4:46:40 server id # end_log_pos # Delete_rows: table id # flags: STMT_END_F
916+### DELETE FROM test1.t1
917+### WHERE
918+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
919+### DELETE FROM test1.t1
920+### WHERE
921+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
922+### DELETE FROM test1.t1
923+### WHERE
924+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
925+### DELETE FROM test2.t2
926+### WHERE
927+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
928+### DELETE FROM test2.t2
929+### WHERE
930+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
931+### DELETE FROM test2.t2
932+### WHERE
933+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
934+# at #
935+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
936+SET TIMESTAMP=1000000000/*!*/;
937+COMMIT
938+/*!*/;
939+# at #
940+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
941+SET TIMESTAMP=1000000000/*!*/;
942+BEGIN
943+/*!*/;
944+# at #
945+# at #
946+# at #
947+#010909 4:46:40 server id # end_log_pos # Annotate_rows:
948+#Q> INSERT INTO test2.v2 VALUES (1), (2), (3)
949+#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
950+#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
951+### INSERT INTO test2.t2
952+### SET
953+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
954+### INSERT INTO test2.t2
955+### SET
956+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
957+### INSERT INTO test2.t2
958+### SET
959+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
960+# at #
961+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
962+SET TIMESTAMP=1000000000/*!*/;
963+COMMIT
964+/*!*/;
965+# at #
966+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
967+SET TIMESTAMP=1000000000/*!*/;
968+BEGIN
969+/*!*/;
970+# at #
971+# at #
972+# at #
973+#010909 4:46:40 server id # end_log_pos # Annotate_rows:
974+#Q> DELETE xtest1.xt1, test2.t2
975+#Q> FROM xtest1.xt1 INNER JOIN test2.t2 INNER JOIN test3.t3
976+#Q> WHERE xtest1.xt1.a=test2.t2.a AND test2.t2.a=test3.t3
977+#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
978+#010909 4:46:40 server id # end_log_pos # Delete_rows: table id # flags: STMT_END_F
979+### DELETE FROM test2.t2
980+### WHERE
981+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
982+### DELETE FROM test2.t2
983+### WHERE
984+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
985+### DELETE FROM test2.t2
986+### WHERE
987+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
988+# at #
989+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
990+SET TIMESTAMP=1000000000/*!*/;
991+COMMIT
992+/*!*/;
993+# at #
994+#010909 4:46:40 server id # end_log_pos # Rotate to master-bin.000002 pos: 4
995+DELIMITER ;
996+# End of log file
997+ROLLBACK /* added by mysqlbinlog */;
998+/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
999+#
1000+#####################################################################################
1001+# mysqlbinlog --database=test1
1002+# The following Annotate should appear in this output:
1003+# - DELETE test1.t1, test2.t2 FROM <...>
1004+#####################################################################################
1005+/*!40019 SET @@session.max_insert_delayed_threads=0*/;
1006+/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
1007+DELIMITER /*!*/;
1008+# at #
1009+#010909 4:46:40 server id # end_log_pos # Start: binlog v 4, server v #.##.## created 010909 4:46:40 at startup
1010+ROLLBACK/*!*/;
1011+# at #
1012+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1013+SET TIMESTAMP=1000000000/*!*/;
1014+SET @@session.pseudo_thread_id=#/*!*/;
1015+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
1016+SET @@session.sql_mode=0/*!*/;
1017+SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
1018+/*!\C latin1 *//*!*/;
1019+SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
1020+SET @@session.lc_time_names=0/*!*/;
1021+SET @@session.collation_database=DEFAULT/*!*/;
1022+DROP DATABASE IF EXISTS test1
1023+/*!*/;
1024+# at #
1025+# at #
1026+# at #
1027+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1028+SET TIMESTAMP=1000000000/*!*/;
1029+CREATE DATABASE test1
1030+/*!*/;
1031+# at #
1032+# at #
1033+# at #
1034+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1035+SET TIMESTAMP=1000000000/*!*/;
1036+BEGIN
1037+/*!*/;
1038+# at #
1039+# at #
1040+#010909 4:46:40 server id # end_log_pos # Table_map: `test1`.`t1` mapped to number #
1041+#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
1042+### INSERT INTO test1.t1
1043+### SET
1044+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
1045+### INSERT INTO test1.t1
1046+### SET
1047+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
1048+### INSERT INTO test1.t1
1049+### SET
1050+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
1051+# at #
1052+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1053+SET TIMESTAMP=1000000000/*!*/;
1054+COMMIT
1055+/*!*/;
1056+# at #
1057+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1058+SET TIMESTAMP=1000000000/*!*/;
1059+BEGIN
1060+/*!*/;
1061+# at #
1062+# at #
1063+# at #
1064+# at #
1065+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1066+SET TIMESTAMP=1000000000/*!*/;
1067+COMMIT
1068+/*!*/;
1069+# at #
1070+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1071+SET TIMESTAMP=1000000000/*!*/;
1072+BEGIN
1073+/*!*/;
1074+# at #
1075+# at #
1076+# at #
1077+# at #
1078+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1079+SET TIMESTAMP=1000000000/*!*/;
1080+COMMIT
1081+/*!*/;
1082+# at #
1083+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1084+SET TIMESTAMP=1000000000/*!*/;
1085+BEGIN
1086+/*!*/;
1087+# at #
1088+# at #
1089+# at #
1090+# at #
1091+# at #
1092+#010909 4:46:40 server id # end_log_pos # Annotate_rows:
1093+#Q> DELETE test1.t1, test2.t2
1094+#Q> FROM test1.t1 INNER JOIN test2.t2 INNER JOIN test3.t3
1095+#Q> WHERE test1.t1.a=test2.t2.a AND test2.t2.a=test3.t3
1096+#010909 4:46:40 server id # end_log_pos # Table_map: `test1`.`t1` mapped to number #
1097+#010909 4:46:40 server id # end_log_pos # Delete_rows: table id #
1098+### DELETE FROM test1.t1
1099+### WHERE
1100+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
1101+### DELETE FROM test1.t1
1102+### WHERE
1103+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
1104+### DELETE FROM test1.t1
1105+### WHERE
1106+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
1107+# at #
1108+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1109+SET TIMESTAMP=1000000000/*!*/;
1110+COMMIT
1111+/*!*/;
1112+# at #
1113+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1114+SET TIMESTAMP=1000000000/*!*/;
1115+BEGIN
1116+/*!*/;
1117+# at #
1118+# at #
1119+# at #
1120+# at #
1121+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1122+SET TIMESTAMP=1000000000/*!*/;
1123+COMMIT
1124+/*!*/;
1125+# at #
1126+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1127+SET TIMESTAMP=1000000000/*!*/;
1128+BEGIN
1129+/*!*/;
1130+# at #
1131+# at #
1132+# at #
1133+# at #
1134+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1135+SET TIMESTAMP=1000000000/*!*/;
1136+COMMIT
1137+/*!*/;
1138+# at #
1139+#010909 4:46:40 server id # end_log_pos # Rotate to master-bin.000002 pos: 4
1140+DELIMITER ;
1141+# End of log file
1142+ROLLBACK /* added by mysqlbinlog */;
1143+/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
1144+#
1145+#####################################################################################
1146+# mysqlbinlog --skip-annotate-rows-events
1147+# No Annotates should appear in this output
1148+#####################################################################################
1149+/*!40019 SET @@session.max_insert_delayed_threads=0*/;
1150+/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
1151+DELIMITER /*!*/;
1152+# at #
1153+#010909 4:46:40 server id # end_log_pos # Start: binlog v 4, server v #.##.## created 010909 4:46:40 at startup
1154+ROLLBACK/*!*/;
1155+# at #
1156+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1157+SET TIMESTAMP=1000000000/*!*/;
1158+SET @@session.pseudo_thread_id=#/*!*/;
1159+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
1160+SET @@session.sql_mode=0/*!*/;
1161+SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
1162+/*!\C latin1 *//*!*/;
1163+SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
1164+SET @@session.lc_time_names=0/*!*/;
1165+SET @@session.collation_database=DEFAULT/*!*/;
1166+DROP DATABASE IF EXISTS test1
1167+/*!*/;
1168+# at #
1169+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1170+SET TIMESTAMP=1000000000/*!*/;
1171+DROP DATABASE IF EXISTS test2
1172+/*!*/;
1173+# at #
1174+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1175+SET TIMESTAMP=1000000000/*!*/;
1176+DROP DATABASE IF EXISTS test3
1177+/*!*/;
1178+# at #
1179+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1180+SET TIMESTAMP=1000000000/*!*/;
1181+CREATE DATABASE test1
1182+/*!*/;
1183+# at #
1184+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1185+SET TIMESTAMP=1000000000/*!*/;
1186+CREATE DATABASE test2
1187+/*!*/;
1188+# at #
1189+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1190+SET TIMESTAMP=1000000000/*!*/;
1191+CREATE DATABASE test3
1192+/*!*/;
1193+# at #
1194+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1195+SET TIMESTAMP=1000000000/*!*/;
1196+BEGIN
1197+/*!*/;
1198+# at #
1199+# at #
1200+#010909 4:46:40 server id # end_log_pos # Table_map: `test1`.`t1` mapped to number #
1201+#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
1202+### INSERT INTO test1.t1
1203+### SET
1204+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
1205+### INSERT INTO test1.t1
1206+### SET
1207+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
1208+### INSERT INTO test1.t1
1209+### SET
1210+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
1211+# at #
1212+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1213+SET TIMESTAMP=1000000000/*!*/;
1214+COMMIT
1215+/*!*/;
1216+# at #
1217+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1218+SET TIMESTAMP=1000000000/*!*/;
1219+BEGIN
1220+/*!*/;
1221+# at #
1222+# at #
1223+# at #
1224+#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
1225+#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
1226+### INSERT INTO test2.t2
1227+### SET
1228+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
1229+### INSERT INTO test2.t2
1230+### SET
1231+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
1232+### INSERT INTO test2.t2
1233+### SET
1234+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
1235+# at #
1236+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1237+SET TIMESTAMP=1000000000/*!*/;
1238+COMMIT
1239+/*!*/;
1240+# at #
1241+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1242+SET TIMESTAMP=1000000000/*!*/;
1243+BEGIN
1244+/*!*/;
1245+# at #
1246+# at #
1247+# at #
1248+#010909 4:46:40 server id # end_log_pos # Table_map: `test3`.`t3` mapped to number #
1249+#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
1250+### INSERT INTO test3.t3
1251+### SET
1252+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
1253+### INSERT INTO test3.t3
1254+### SET
1255+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
1256+### INSERT INTO test3.t3
1257+### SET
1258+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
1259+# at #
1260+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1261+SET TIMESTAMP=1000000000/*!*/;
1262+COMMIT
1263+/*!*/;
1264+# at #
1265+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1266+SET TIMESTAMP=1000000000/*!*/;
1267+BEGIN
1268+/*!*/;
1269+# at #
1270+# at #
1271+# at #
1272+# at #
1273+# at #
1274+#010909 4:46:40 server id # end_log_pos # Table_map: `test1`.`t1` mapped to number #
1275+#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
1276+#010909 4:46:40 server id # end_log_pos # Delete_rows: table id #
1277+#010909 4:46:40 server id # end_log_pos # Delete_rows: table id # flags: STMT_END_F
1278+### DELETE FROM test1.t1
1279+### WHERE
1280+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
1281+### DELETE FROM test1.t1
1282+### WHERE
1283+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
1284+### DELETE FROM test1.t1
1285+### WHERE
1286+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
1287+### DELETE FROM test2.t2
1288+### WHERE
1289+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
1290+### DELETE FROM test2.t2
1291+### WHERE
1292+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
1293+### DELETE FROM test2.t2
1294+### WHERE
1295+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
1296+# at #
1297+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1298+SET TIMESTAMP=1000000000/*!*/;
1299+COMMIT
1300+/*!*/;
1301+# at #
1302+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1303+SET TIMESTAMP=1000000000/*!*/;
1304+BEGIN
1305+/*!*/;
1306+# at #
1307+# at #
1308+# at #
1309+#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
1310+#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
1311+### INSERT INTO test2.t2
1312+### SET
1313+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
1314+### INSERT INTO test2.t2
1315+### SET
1316+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
1317+### INSERT INTO test2.t2
1318+### SET
1319+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
1320+# at #
1321+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1322+SET TIMESTAMP=1000000000/*!*/;
1323+COMMIT
1324+/*!*/;
1325+# at #
1326+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1327+SET TIMESTAMP=1000000000/*!*/;
1328+BEGIN
1329+/*!*/;
1330+# at #
1331+# at #
1332+# at #
1333+#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
1334+#010909 4:46:40 server id # end_log_pos # Delete_rows: table id # flags: STMT_END_F
1335+### DELETE FROM test2.t2
1336+### WHERE
1337+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
1338+### DELETE FROM test2.t2
1339+### WHERE
1340+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
1341+### DELETE FROM test2.t2
1342+### WHERE
1343+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
1344+# at #
1345+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1346+SET TIMESTAMP=1000000000/*!*/;
1347+COMMIT
1348+/*!*/;
1349+# at #
1350+#010909 4:46:40 server id # end_log_pos # Rotate to master-bin.000002 pos: 4
1351+DELIMITER ;
1352+# End of log file
1353+ROLLBACK /* added by mysqlbinlog */;
1354+/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
1355+#
1356+#####################################################################################
1357+# mysqlbinlog --read-from-remote-server
1358+# The following Annotates should appear in this output:
1359+# - INSERT INTO test2.t2 VALUES (1), (2), (3)
1360+# - INSERT INTO test3.t3 VALUES (1), (2), (3)
1361+# - DELETE test1.t1, test2.t2 FROM <...> (with two subsequent Table maps)
1362+# - INSERT INTO test2.t2 VALUES (1), (2), (3)
1363+# - DELETE xtest1.xt1, test2.t2 FROM <...> (with one subsequent Table map)
1364+#####################################################################################
1365+/*!40019 SET @@session.max_insert_delayed_threads=0*/;
1366+/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
1367+DELIMITER /*!*/;
1368+# at #
1369+#010909 4:46:40 server id # end_log_pos # Start: binlog v 4, server v #.##.## created 010909 4:46:40 at startup
1370+ROLLBACK/*!*/;
1371+# at #
1372+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1373+SET TIMESTAMP=1000000000/*!*/;
1374+SET @@session.pseudo_thread_id=#/*!*/;
1375+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
1376+SET @@session.sql_mode=0/*!*/;
1377+SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
1378+/*!\C latin1 *//*!*/;
1379+SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
1380+SET @@session.lc_time_names=0/*!*/;
1381+SET @@session.collation_database=DEFAULT/*!*/;
1382+DROP DATABASE IF EXISTS test1
1383+/*!*/;
1384+# at #
1385+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1386+SET TIMESTAMP=1000000000/*!*/;
1387+DROP DATABASE IF EXISTS test2
1388+/*!*/;
1389+# at #
1390+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1391+SET TIMESTAMP=1000000000/*!*/;
1392+DROP DATABASE IF EXISTS test3
1393+/*!*/;
1394+# at #
1395+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1396+SET TIMESTAMP=1000000000/*!*/;
1397+CREATE DATABASE test1
1398+/*!*/;
1399+# at #
1400+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1401+SET TIMESTAMP=1000000000/*!*/;
1402+CREATE DATABASE test2
1403+/*!*/;
1404+# at #
1405+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1406+SET TIMESTAMP=1000000000/*!*/;
1407+CREATE DATABASE test3
1408+/*!*/;
1409+# at #
1410+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1411+SET TIMESTAMP=1000000000/*!*/;
1412+BEGIN
1413+/*!*/;
1414+# at #
1415+# at #
1416+#010909 4:46:40 server id # end_log_pos # Table_map: `test1`.`t1` mapped to number #
1417+#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
1418+### INSERT INTO test1.t1
1419+### SET
1420+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
1421+### INSERT INTO test1.t1
1422+### SET
1423+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
1424+### INSERT INTO test1.t1
1425+### SET
1426+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
1427+# at #
1428+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1429+SET TIMESTAMP=1000000000/*!*/;
1430+COMMIT
1431+/*!*/;
1432+# at #
1433+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1434+SET TIMESTAMP=1000000000/*!*/;
1435+BEGIN
1436+/*!*/;
1437+# at #
1438+# at #
1439+# at #
1440+#010909 4:46:40 server id # end_log_pos # Annotate_rows:
1441+#Q> INSERT INTO test2.t2 VALUES (1), (2), (3)
1442+#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
1443+#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
1444+### INSERT INTO test2.t2
1445+### SET
1446+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
1447+### INSERT INTO test2.t2
1448+### SET
1449+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
1450+### INSERT INTO test2.t2
1451+### SET
1452+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
1453+# at #
1454+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1455+SET TIMESTAMP=1000000000/*!*/;
1456+COMMIT
1457+/*!*/;
1458+# at #
1459+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1460+SET TIMESTAMP=1000000000/*!*/;
1461+BEGIN
1462+/*!*/;
1463+# at #
1464+# at #
1465+# at #
1466+#010909 4:46:40 server id # end_log_pos # Annotate_rows:
1467+#Q> INSERT INTO test3.t3 VALUES (1), (2), (3)
1468+#010909 4:46:40 server id # end_log_pos # Table_map: `test3`.`t3` mapped to number #
1469+#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
1470+### INSERT INTO test3.t3
1471+### SET
1472+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
1473+### INSERT INTO test3.t3
1474+### SET
1475+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
1476+### INSERT INTO test3.t3
1477+### SET
1478+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
1479+# at #
1480+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1481+SET TIMESTAMP=1000000000/*!*/;
1482+COMMIT
1483+/*!*/;
1484+# at #
1485+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1486+SET TIMESTAMP=1000000000/*!*/;
1487+BEGIN
1488+/*!*/;
1489+# at #
1490+# at #
1491+# at #
1492+# at #
1493+# at #
1494+#010909 4:46:40 server id # end_log_pos # Annotate_rows:
1495+#Q> DELETE test1.t1, test2.t2
1496+#Q> FROM test1.t1 INNER JOIN test2.t2 INNER JOIN test3.t3
1497+#Q> WHERE test1.t1.a=test2.t2.a AND test2.t2.a=test3.t3
1498+#010909 4:46:40 server id # end_log_pos # Table_map: `test1`.`t1` mapped to number #
1499+#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
1500+#010909 4:46:40 server id # end_log_pos # Delete_rows: table id #
1501+#010909 4:46:40 server id # end_log_pos # Delete_rows: table id # flags: STMT_END_F
1502+### DELETE FROM test1.t1
1503+### WHERE
1504+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
1505+### DELETE FROM test1.t1
1506+### WHERE
1507+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
1508+### DELETE FROM test1.t1
1509+### WHERE
1510+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
1511+### DELETE FROM test2.t2
1512+### WHERE
1513+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
1514+### DELETE FROM test2.t2
1515+### WHERE
1516+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
1517+### DELETE FROM test2.t2
1518+### WHERE
1519+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
1520+# at #
1521+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1522+SET TIMESTAMP=1000000000/*!*/;
1523+COMMIT
1524+/*!*/;
1525+# at #
1526+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1527+SET TIMESTAMP=1000000000/*!*/;
1528+BEGIN
1529+/*!*/;
1530+# at #
1531+# at #
1532+# at #
1533+#010909 4:46:40 server id # end_log_pos # Annotate_rows:
1534+#Q> INSERT INTO test2.v2 VALUES (1), (2), (3)
1535+#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
1536+#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
1537+### INSERT INTO test2.t2
1538+### SET
1539+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
1540+### INSERT INTO test2.t2
1541+### SET
1542+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
1543+### INSERT INTO test2.t2
1544+### SET
1545+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
1546+# at #
1547+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1548+SET TIMESTAMP=1000000000/*!*/;
1549+COMMIT
1550+/*!*/;
1551+# at #
1552+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1553+SET TIMESTAMP=1000000000/*!*/;
1554+BEGIN
1555+/*!*/;
1556+# at #
1557+# at #
1558+# at #
1559+#010909 4:46:40 server id # end_log_pos # Annotate_rows:
1560+#Q> DELETE xtest1.xt1, test2.t2
1561+#Q> FROM xtest1.xt1 INNER JOIN test2.t2 INNER JOIN test3.t3
1562+#Q> WHERE xtest1.xt1.a=test2.t2.a AND test2.t2.a=test3.t3
1563+#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
1564+#010909 4:46:40 server id # end_log_pos # Delete_rows: table id # flags: STMT_END_F
1565+### DELETE FROM test2.t2
1566+### WHERE
1567+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
1568+### DELETE FROM test2.t2
1569+### WHERE
1570+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
1571+### DELETE FROM test2.t2
1572+### WHERE
1573+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
1574+# at #
1575+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1576+SET TIMESTAMP=1000000000/*!*/;
1577+COMMIT
1578+/*!*/;
1579+# at #
1580+#010909 4:46:40 server id # end_log_pos # Rotate to master-bin.000002 pos: 4
1581+DELIMITER ;
1582+# End of log file
1583+ROLLBACK /* added by mysqlbinlog */;
1584+/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
1585+#
1586+#####################################################################################
1587+# mysqlbinlog --read-from-remote-server --database=test1
1588+# The following Annotate should appear in this output:
1589+# - DELETE test1.t1, test2.t2 FROM <...>
1590+#####################################################################################
1591+/*!40019 SET @@session.max_insert_delayed_threads=0*/;
1592+/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
1593+DELIMITER /*!*/;
1594+# at #
1595+#010909 4:46:40 server id # end_log_pos # Start: binlog v 4, server v #.##.## created 010909 4:46:40 at startup
1596+ROLLBACK/*!*/;
1597+# at #
1598+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1599+SET TIMESTAMP=1000000000/*!*/;
1600+SET @@session.pseudo_thread_id=#/*!*/;
1601+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
1602+SET @@session.sql_mode=0/*!*/;
1603+SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
1604+/*!\C latin1 *//*!*/;
1605+SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
1606+SET @@session.lc_time_names=0/*!*/;
1607+SET @@session.collation_database=DEFAULT/*!*/;
1608+DROP DATABASE IF EXISTS test1
1609+/*!*/;
1610+# at #
1611+# at #
1612+# at #
1613+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1614+SET TIMESTAMP=1000000000/*!*/;
1615+CREATE DATABASE test1
1616+/*!*/;
1617+# at #
1618+# at #
1619+# at #
1620+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1621+SET TIMESTAMP=1000000000/*!*/;
1622+BEGIN
1623+/*!*/;
1624+# at #
1625+# at #
1626+#010909 4:46:40 server id # end_log_pos # Table_map: `test1`.`t1` mapped to number #
1627+#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
1628+### INSERT INTO test1.t1
1629+### SET
1630+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
1631+### INSERT INTO test1.t1
1632+### SET
1633+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
1634+### INSERT INTO test1.t1
1635+### SET
1636+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
1637+# at #
1638+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1639+SET TIMESTAMP=1000000000/*!*/;
1640+COMMIT
1641+/*!*/;
1642+# at #
1643+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1644+SET TIMESTAMP=1000000000/*!*/;
1645+BEGIN
1646+/*!*/;
1647+# at #
1648+# at #
1649+# at #
1650+# at #
1651+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1652+SET TIMESTAMP=1000000000/*!*/;
1653+COMMIT
1654+/*!*/;
1655+# at #
1656+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1657+SET TIMESTAMP=1000000000/*!*/;
1658+BEGIN
1659+/*!*/;
1660+# at #
1661+# at #
1662+# at #
1663+# at #
1664+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1665+SET TIMESTAMP=1000000000/*!*/;
1666+COMMIT
1667+/*!*/;
1668+# at #
1669+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1670+SET TIMESTAMP=1000000000/*!*/;
1671+BEGIN
1672+/*!*/;
1673+# at #
1674+# at #
1675+# at #
1676+# at #
1677+# at #
1678+#010909 4:46:40 server id # end_log_pos # Annotate_rows:
1679+#Q> DELETE test1.t1, test2.t2
1680+#Q> FROM test1.t1 INNER JOIN test2.t2 INNER JOIN test3.t3
1681+#Q> WHERE test1.t1.a=test2.t2.a AND test2.t2.a=test3.t3
1682+#010909 4:46:40 server id # end_log_pos # Table_map: `test1`.`t1` mapped to number #
1683+#010909 4:46:40 server id # end_log_pos # Delete_rows: table id #
1684+### DELETE FROM test1.t1
1685+### WHERE
1686+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
1687+### DELETE FROM test1.t1
1688+### WHERE
1689+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
1690+### DELETE FROM test1.t1
1691+### WHERE
1692+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
1693+# at #
1694+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1695+SET TIMESTAMP=1000000000/*!*/;
1696+COMMIT
1697+/*!*/;
1698+# at #
1699+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1700+SET TIMESTAMP=1000000000/*!*/;
1701+BEGIN
1702+/*!*/;
1703+# at #
1704+# at #
1705+# at #
1706+# at #
1707+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1708+SET TIMESTAMP=1000000000/*!*/;
1709+COMMIT
1710+/*!*/;
1711+# at #
1712+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1713+SET TIMESTAMP=1000000000/*!*/;
1714+BEGIN
1715+/*!*/;
1716+# at #
1717+# at #
1718+# at #
1719+# at #
1720+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1721+SET TIMESTAMP=1000000000/*!*/;
1722+COMMIT
1723+/*!*/;
1724+# at #
1725+#010909 4:46:40 server id # end_log_pos # Rotate to master-bin.000002 pos: 4
1726+DELIMITER ;
1727+# End of log file
1728+ROLLBACK /* added by mysqlbinlog */;
1729+/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
1730+#
1731+#####################################################################################
1732+# mysqlbinlog --read-from-remote-server --skip-annotate-rows-events
1733+# No Annotates should appear in this output
1734+#####################################################################################
1735+/*!40019 SET @@session.max_insert_delayed_threads=0*/;
1736+/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
1737+DELIMITER /*!*/;
1738+# at #
1739+#010909 4:46:40 server id # end_log_pos # Start: binlog v 4, server v #.##.## created 010909 4:46:40 at startup
1740+ROLLBACK/*!*/;
1741+# at #
1742+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1743+SET TIMESTAMP=1000000000/*!*/;
1744+SET @@session.pseudo_thread_id=#/*!*/;
1745+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
1746+SET @@session.sql_mode=0/*!*/;
1747+SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
1748+/*!\C latin1 *//*!*/;
1749+SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
1750+SET @@session.lc_time_names=0/*!*/;
1751+SET @@session.collation_database=DEFAULT/*!*/;
1752+DROP DATABASE IF EXISTS test1
1753+/*!*/;
1754+# at #
1755+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1756+SET TIMESTAMP=1000000000/*!*/;
1757+DROP DATABASE IF EXISTS test2
1758+/*!*/;
1759+# at #
1760+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1761+SET TIMESTAMP=1000000000/*!*/;
1762+DROP DATABASE IF EXISTS test3
1763+/*!*/;
1764+# at #
1765+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1766+SET TIMESTAMP=1000000000/*!*/;
1767+CREATE DATABASE test1
1768+/*!*/;
1769+# at #
1770+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1771+SET TIMESTAMP=1000000000/*!*/;
1772+CREATE DATABASE test2
1773+/*!*/;
1774+# at #
1775+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1776+SET TIMESTAMP=1000000000/*!*/;
1777+CREATE DATABASE test3
1778+/*!*/;
1779+# at #
1780+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1781+SET TIMESTAMP=1000000000/*!*/;
1782+BEGIN
1783+/*!*/;
1784+# at #
1785+# at #
1786+#010909 4:46:40 server id # end_log_pos # Table_map: `test1`.`t1` mapped to number #
1787+#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
1788+### INSERT INTO test1.t1
1789+### SET
1790+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
1791+### INSERT INTO test1.t1
1792+### SET
1793+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
1794+### INSERT INTO test1.t1
1795+### SET
1796+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
1797+# at #
1798+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1799+SET TIMESTAMP=1000000000/*!*/;
1800+COMMIT
1801+/*!*/;
1802+# at #
1803+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1804+SET TIMESTAMP=1000000000/*!*/;
1805+BEGIN
1806+/*!*/;
1807+# at #
1808+# at #
1809+#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
1810+#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
1811+### INSERT INTO test2.t2
1812+### SET
1813+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
1814+### INSERT INTO test2.t2
1815+### SET
1816+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
1817+### INSERT INTO test2.t2
1818+### SET
1819+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
1820+# at #
1821+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1822+SET TIMESTAMP=1000000000/*!*/;
1823+COMMIT
1824+/*!*/;
1825+# at #
1826+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1827+SET TIMESTAMP=1000000000/*!*/;
1828+BEGIN
1829+/*!*/;
1830+# at #
1831+# at #
1832+#010909 4:46:40 server id # end_log_pos # Table_map: `test3`.`t3` mapped to number #
1833+#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
1834+### INSERT INTO test3.t3
1835+### SET
1836+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
1837+### INSERT INTO test3.t3
1838+### SET
1839+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
1840+### INSERT INTO test3.t3
1841+### SET
1842+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
1843+# at #
1844+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1845+SET TIMESTAMP=1000000000/*!*/;
1846+COMMIT
1847+/*!*/;
1848+# at #
1849+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1850+SET TIMESTAMP=1000000000/*!*/;
1851+BEGIN
1852+/*!*/;
1853+# at #
1854+# at #
1855+# at #
1856+# at #
1857+#010909 4:46:40 server id # end_log_pos # Table_map: `test1`.`t1` mapped to number #
1858+#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
1859+#010909 4:46:40 server id # end_log_pos # Delete_rows: table id #
1860+#010909 4:46:40 server id # end_log_pos # Delete_rows: table id # flags: STMT_END_F
1861+### DELETE FROM test1.t1
1862+### WHERE
1863+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
1864+### DELETE FROM test1.t1
1865+### WHERE
1866+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
1867+### DELETE FROM test1.t1
1868+### WHERE
1869+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
1870+### DELETE FROM test2.t2
1871+### WHERE
1872+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
1873+### DELETE FROM test2.t2
1874+### WHERE
1875+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
1876+### DELETE FROM test2.t2
1877+### WHERE
1878+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
1879+# at #
1880+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1881+SET TIMESTAMP=1000000000/*!*/;
1882+COMMIT
1883+/*!*/;
1884+# at #
1885+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1886+SET TIMESTAMP=1000000000/*!*/;
1887+BEGIN
1888+/*!*/;
1889+# at #
1890+# at #
1891+#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
1892+#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
1893+### INSERT INTO test2.t2
1894+### SET
1895+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
1896+### INSERT INTO test2.t2
1897+### SET
1898+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
1899+### INSERT INTO test2.t2
1900+### SET
1901+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
1902+# at #
1903+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1904+SET TIMESTAMP=1000000000/*!*/;
1905+COMMIT
1906+/*!*/;
1907+# at #
1908+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1909+SET TIMESTAMP=1000000000/*!*/;
1910+BEGIN
1911+/*!*/;
1912+# at #
1913+# at #
1914+#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
1915+#010909 4:46:40 server id # end_log_pos # Delete_rows: table id # flags: STMT_END_F
1916+### DELETE FROM test2.t2
1917+### WHERE
1918+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
1919+### DELETE FROM test2.t2
1920+### WHERE
1921+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
1922+### DELETE FROM test2.t2
1923+### WHERE
1924+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
1925+# at #
1926+#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
1927+SET TIMESTAMP=1000000000/*!*/;
1928+COMMIT
1929+/*!*/;
1930+# at #
1931+#010909 4:46:40 server id # end_log_pos # Rotate to master-bin.000002 pos: 4
1932+DELIMITER ;
1933+# End of log file
1934+ROLLBACK /* added by mysqlbinlog */;
1935+/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
1936
1937=== modified file 'Percona-Server/mysql-test/suite/binlog/r/binlog_stm_binlog.result'
1938--- Percona-Server/mysql-test/suite/binlog/r/binlog_stm_binlog.result 2011-02-23 09:31:37 +0000
1939+++ Percona-Server/mysql-test/suite/binlog/r/binlog_stm_binlog.result 2012-03-29 03:25:47 +0000
1940@@ -331,7 +331,7 @@
1941 master-bin.000001 # Query # # use `test`; insert into t1 values( 243 )
1942 master-bin.000001 # Query # # use `test`; insert into t1 values( 242 )
1943 master-bin.000001 # Query # # use `test`; insert into t1 values( 241 )
1944-master-bin.000001 # Query # # use `test`; insert into t1 values( 240 )
1945+master-bin.000001 # Query # # use `test`; insert into t1 values( <binlog_start> )
1946 master-bin.000001 # Query # # use `test`; insert into t1 values( 239 )
1947 master-bin.000001 # Query # # use `test`; insert into t1 values( 238 )
1948 master-bin.000001 # Query # # use `test`; insert into t1 values( 237 )
1949@@ -465,7 +465,7 @@
1950 master-bin.000001 # Query # # use `test`; insert into t1 values( 109 )
1951 master-bin.000001 # Query # # use `test`; insert into t1 values( 108 )
1952 master-bin.000001 # Query # # use `test`; insert into t1 values( 107 )
1953-master-bin.000001 # Query # # use `test`; insert into t1 values( <binlog_start> )
1954+master-bin.000001 # Query # # use `test`; insert into t1 values( 106 )
1955 master-bin.000001 # Query # # use `test`; insert into t1 values( 105 )
1956 master-bin.000001 # Query # # use `test`; insert into t1 values( 104 )
1957 master-bin.000001 # Query # # use `test`; insert into t1 values( 103 )
1958
1959=== modified file 'Percona-Server/mysql-test/suite/binlog/t/binlog_incident.test'
1960--- Percona-Server/mysql-test/suite/binlog/t/binlog_incident.test 2009-09-07 05:42:54 +0000
1961+++ Percona-Server/mysql-test/suite/binlog/t/binlog_incident.test 2012-03-29 03:25:47 +0000
1962@@ -4,6 +4,7 @@
1963
1964 source include/have_log_bin.inc;
1965 source include/have_debug.inc;
1966+source include/binlog_start_pos.inc;
1967
1968 let $MYSQLD_DATADIR= `select @@datadir`;
1969 RESET MASTER;
1970@@ -20,7 +21,7 @@
1971 DROP TABLE t1;
1972 FLUSH LOGS;
1973
1974-exec $MYSQL_BINLOG --start-position=106 $MYSQLD_DATADIR/master-bin.000001 >$MYSQLTEST_VARDIR/tmp/binlog_incident-bug44442.sql;
1975+exec $MYSQL_BINLOG --start-position=$binlog_start $MYSQLD_DATADIR/master-bin.000001 >$MYSQLTEST_VARDIR/tmp/binlog_incident-bug44442.sql;
1976 --disable_query_log
1977 eval SELECT cont LIKE '%RELOAD DATABASE; # Shall generate syntax error%' AS `Contain RELOAD DATABASE` FROM (SELECT load_file('$MYSQLTEST_VARDIR/tmp/binlog_incident-bug44442.sql') AS cont) AS tbl;
1978 --enable_query_log
1979
1980=== modified file 'Percona-Server/mysql-test/suite/binlog/t/binlog_killed.test'
1981--- Percona-Server/mysql-test/suite/binlog/t/binlog_killed.test 2010-05-20 07:39:02 +0000
1982+++ Percona-Server/mysql-test/suite/binlog/t/binlog_killed.test 2012-03-29 03:25:47 +0000
1983@@ -1,5 +1,6 @@
1984 -- source include/have_innodb.inc
1985 -- source include/have_binlog_format_statement.inc
1986+-- source include/binlog_start_pos.inc
1987
1988 # You cannot use `KILL' with the Embedded MySQL Server library,
1989 # because the embedded server merely runs inside the threads of the host
1990@@ -51,7 +52,8 @@
1991 let $rows= `select count(*) from t2 /* must be 2 or 0 */`;
1992
1993 let $MYSQLD_DATADIR= `select @@datadir`;
1994---exec $MYSQL_BINLOG --force-if-open --start-position=134 $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/kill_query_calling_sp.binlog
1995+let $start_pos= `select @binlog_start + 28`;
1996+--exec $MYSQL_BINLOG --force-if-open --start-position=$start_pos $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/kill_query_calling_sp.binlog
1997 --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
1998 eval select
1999 (@a:=load_file("$MYSQLTEST_VARDIR/tmp/kill_query_calling_sp.binlog"))
2000
2001=== modified file 'Percona-Server/mysql-test/suite/binlog/t/binlog_killed_simulate.test'
2002--- Percona-Server/mysql-test/suite/binlog/t/binlog_killed_simulate.test 2010-08-03 02:22:19 +0000
2003+++ Percona-Server/mysql-test/suite/binlog/t/binlog_killed_simulate.test 2012-03-29 03:25:47 +0000
2004@@ -1,5 +1,6 @@
2005 -- source include/have_debug.inc
2006 -- source include/have_binlog_format_statement.inc
2007+-- source include/binlog_start_pos.inc
2008 #
2009 # bug#27571 asynchronous setting mysql_$query()'s local error and
2010 # Query_log_event::error_code
2011@@ -24,7 +25,7 @@
2012 # for some constants like the offset of the first real event
2013 # that is different between severs versions.
2014 let $MYSQLD_DATADIR= `select @@datadir`;
2015---exec $MYSQL_BINLOG --force-if-open --start-position=106 $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog
2016+--exec $MYSQL_BINLOG --force-if-open --start-position=$binlog_start $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog
2017 --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
2018 eval select
2019 (@a:=load_file("$MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog"))
2020
2021=== added file 'Percona-Server/mysql-test/suite/binlog/t/binlog_row_annotate-master.opt'
2022--- Percona-Server/mysql-test/suite/binlog/t/binlog_row_annotate-master.opt 1970-01-01 00:00:00 +0000
2023+++ Percona-Server/mysql-test/suite/binlog/t/binlog_row_annotate-master.opt 2012-03-29 03:25:47 +0000
2024@@ -0,0 +1,1 @@
2025+--timezone=GMT-3 --binlog-do-db=test1 --binlog-do-db=test2 --binlog-do-db=test3
2026
2027=== added file 'Percona-Server/mysql-test/suite/binlog/t/binlog_row_annotate.test'
2028--- Percona-Server/mysql-test/suite/binlog/t/binlog_row_annotate.test 1970-01-01 00:00:00 +0000
2029+++ Percona-Server/mysql-test/suite/binlog/t/binlog_row_annotate.test 2012-03-29 03:25:47 +0000
2030@@ -0,0 +1,189 @@
2031+###############################################################################
2032+# MariaDB WL 47: Store in binlog text of statements that caused RBR events
2033+# new event: ANNOTATE_ROWS_EVENT
2034+# new master option: --binlog-annotate-rows-events
2035+# new mysqlbinlog option: --skip-annotate-rows-events
2036+#
2037+# Intended to test that:
2038+# *** If the --binlog-annotate-rows-events option is switched on on master
2039+# then Annotate_rows events:
2040+# - are generated;
2041+# - are generated only once for "multi-table-maps" rbr queries;
2042+# - are not generated when the corresponding queries are filtered away;
2043+# - are generated when the corresponding queries are filtered away partialy
2044+# (e.g. in case of multi-delete).
2045+# *** Annotate_rows events are printed by mysqlbinlog started without
2046+# --skip-annotate-rows-events options both in remote and local cases.
2047+# *** Annotate_rows events are not printed by mysqlbinlog started with
2048+# --skip-annotate-rows-events options both in remote and local cases.
2049+###############################################################################
2050+
2051+--source include/have_log_bin.inc
2052+--source include/have_binlog_format_row.inc
2053+--source include/binlog_start_pos.inc
2054+
2055+--disable_query_log
2056+
2057+# Fix timestamp to avoid varying results
2058+SET timestamp=1000000000;
2059+
2060+# Delete all existing binary logs
2061+RESET MASTER;
2062+
2063+--disable_warnings
2064+DROP DATABASE IF EXISTS test1;
2065+DROP DATABASE IF EXISTS test2;
2066+DROP DATABASE IF EXISTS test3;
2067+DROP DATABASE IF EXISTS xtest1;
2068+DROP DATABASE IF EXISTS xtest2;
2069+--enable_warnings
2070+
2071+CREATE DATABASE test1;
2072+CREATE TABLE test1.t1(a int);
2073+
2074+CREATE DATABASE test2;
2075+CREATE TABLE test2.t2(a int);
2076+CREATE VIEW test2.v2 AS SELECT * FROM test2.t2;
2077+
2078+CREATE DATABASE test3;
2079+CREATE TABLE test3.t3(a int);
2080+
2081+CREATE DATABASE xtest1;
2082+CREATE TABLE xtest1.xt1(a int);
2083+
2084+CREATE DATABASE xtest2;
2085+CREATE TABLE xtest2.xt2(a int);
2086+
2087+# By default SESSION binlog_annotate_rows_events = OFF
2088+
2089+INSERT INTO test1.t1 VALUES (1), (2), (3);
2090+
2091+SET SESSION binlog_annotate_rows_events = ON;
2092+
2093+INSERT INTO test2.t2 VALUES (1), (2), (3);
2094+INSERT INTO test3.t3 VALUES (1), (2), (3);
2095+
2096+# This query generates two Table maps but the Annotate
2097+# event should appear only once before the first Table map
2098+DELETE test1.t1, test2.t2
2099+ FROM test1.t1 INNER JOIN test2.t2 INNER JOIN test3.t3
2100+ WHERE test1.t1.a=test2.t2.a AND test2.t2.a=test3.t3.a;
2101+
2102+# This event should be filtered out together with Annotate event
2103+INSERT INTO xtest1.xt1 VALUES (1), (2), (3);
2104+
2105+# This event should pass the filter
2106+INSERT INTO test2.v2 VALUES (1), (2), (3);
2107+
2108+# This event should pass the filter only for test2.t2 part
2109+DELETE xtest1.xt1, test2.t2
2110+ FROM xtest1.xt1 INNER JOIN test2.t2 INNER JOIN test3.t3
2111+ WHERE xtest1.xt1.a=test2.t2.a AND test2.t2.a=test3.t3.a;
2112+
2113+# These events should be filtered out together with Annotate events
2114+INSERT INTO xtest1.xt1 VALUES (1), (2), (3);
2115+INSERT INTO xtest2.xt2 VALUES (1), (2), (3);
2116+DELETE xtest1.xt1, xtest2.xt2
2117+ FROM xtest1.xt1 INNER JOIN xtest2.xt2 INNER JOIN test3.t3
2118+ WHERE xtest1.xt1.a=xtest2.xt2.a AND xtest2.xt2.a=test3.t3.a;
2119+
2120+FLUSH LOGS;
2121+--enable_query_log
2122+
2123+--echo #####################################################################################
2124+--echo # The following Annotate_rows events should appear below:
2125+--echo # - INSERT INTO test2.t2 VALUES (1), (2), (3)
2126+--echo # - INSERT INTO test3.t3 VALUES (1), (2), (3)
2127+--echo # - DELETE test1.t1, test2.t2 FROM <...>
2128+--echo # - INSERT INTO test2.t2 VALUES (1), (2), (3)
2129+--echo # - DELETE xtest1.xt1, test2.t2 FROM <...>
2130+--echo #####################################################################################
2131+
2132+let $start_pos= `select @binlog_start`;
2133+--replace_column 2 # 5 #
2134+--replace_result $start_pos <start_pos>
2135+--replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\//
2136+--eval show binlog events in 'master-bin.000001' from $start_pos
2137+
2138+--echo #
2139+--echo #####################################################################################
2140+--echo # mysqlbinlog
2141+--echo # The following Annotates should appear in this output:
2142+--echo # - INSERT INTO test2.t2 VALUES (1), (2), (3)
2143+--echo # - INSERT INTO test3.t3 VALUES (1), (2), (3)
2144+--echo # - DELETE test1.t1, test2.t2 FROM <...> (with two subsequent Table maps)
2145+--echo # - INSERT INTO test2.t2 VALUES (1), (2), (3)
2146+--echo # - DELETE xtest1.xt1, test2.t2 FROM <...> (with one subsequent Table map)
2147+--echo #####################################################################################
2148+
2149+let $MYSQLD_DATADIR= `select @@datadir`;
2150+--replace_regex /server id [0-9]*/server id #/ /server v [^ ]*/server v #.##.##/ /exec_time=[0-9]*/exec_time=#/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/
2151+--exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLD_DATADIR/master-bin.000001
2152+
2153+--echo #
2154+--echo #####################################################################################
2155+--echo # mysqlbinlog --database=test1
2156+--echo # The following Annotate should appear in this output:
2157+--echo # - DELETE test1.t1, test2.t2 FROM <...>
2158+--echo #####################################################################################
2159+
2160+let $MYSQLD_DATADIR= `select @@datadir`;
2161+--replace_regex /server id [0-9]*/server id #/ /server v [^ ]*/server v #.##.##/ /exec_time=[0-9]*/exec_time=#/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/
2162+--exec $MYSQL_BINLOG --base64-output=decode-rows --database=test1 -v -v $MYSQLD_DATADIR/master-bin.000001
2163+
2164+--echo #
2165+--echo #####################################################################################
2166+--echo # mysqlbinlog --skip-annotate-rows-events
2167+--echo # No Annotates should appear in this output
2168+--echo #####################################################################################
2169+
2170+let $MYSQLD_DATADIR= `select @@datadir`;
2171+--replace_regex /server id [0-9]*/server id #/ /server v [^ ]*/server v #.##.##/ /exec_time=[0-9]*/exec_time=#/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/
2172+--exec $MYSQL_BINLOG --base64-output=decode-rows --skip-annotate-rows-events -v -v $MYSQLD_DATADIR/master-bin.000001
2173+
2174+--echo #
2175+--echo #####################################################################################
2176+--echo # mysqlbinlog --read-from-remote-server
2177+--echo # The following Annotates should appear in this output:
2178+--echo # - INSERT INTO test2.t2 VALUES (1), (2), (3)
2179+--echo # - INSERT INTO test3.t3 VALUES (1), (2), (3)
2180+--echo # - DELETE test1.t1, test2.t2 FROM <...> (with two subsequent Table maps)
2181+--echo # - INSERT INTO test2.t2 VALUES (1), (2), (3)
2182+--echo # - DELETE xtest1.xt1, test2.t2 FROM <...> (with one subsequent Table map)
2183+--echo #####################################################################################
2184+
2185+let $MYSQLD_DATADIR= `select @@datadir`;
2186+--replace_regex /server id [0-9]*/server id #/ /server v [^ ]*/server v #.##.##/ /exec_time=[0-9]*/exec_time=#/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/
2187+--exec $MYSQL_BINLOG --base64-output=decode-rows -v -v --read-from-remote-server --user=root --host=localhost --port=$MASTER_MYPORT master-bin.000001
2188+
2189+--echo #
2190+--echo #####################################################################################
2191+--echo # mysqlbinlog --read-from-remote-server --database=test1
2192+--echo # The following Annotate should appear in this output:
2193+--echo # - DELETE test1.t1, test2.t2 FROM <...>
2194+--echo #####################################################################################
2195+
2196+let $MYSQLD_DATADIR= `select @@datadir`;
2197+--replace_regex /server id [0-9]*/server id #/ /server v [^ ]*/server v #.##.##/ /exec_time=[0-9]*/exec_time=#/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/
2198+--exec $MYSQL_BINLOG --base64-output=decode-rows --database=test1 -v -v --read-from-remote-server --user=root --host=localhost --port=$MASTER_MYPORT master-bin.000001
2199+
2200+--echo #
2201+--echo #####################################################################################
2202+--echo # mysqlbinlog --read-from-remote-server --skip-annotate-rows-events
2203+--echo # No Annotates should appear in this output
2204+--echo #####################################################################################
2205+
2206+let $MYSQLD_DATADIR= `select @@datadir`;
2207+--replace_regex /server id [0-9]*/server id #/ /server v [^ ]*/server v #.##.##/ /exec_time=[0-9]*/exec_time=#/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/
2208+--exec $MYSQL_BINLOG --base64-output=decode-rows --skip-annotate-rows-events -v -v --read-from-remote-server --user=root --host=localhost --port=$MASTER_MYPORT master-bin.000001
2209+
2210+# Clean-up
2211+
2212+--disable_query_log
2213+DROP DATABASE test1;
2214+DROP DATABASE test2;
2215+DROP DATABASE test3;
2216+DROP DATABASE xtest1;
2217+DROP DATABASE xtest2;
2218+--enable_query_log
2219+
2220
2221=== added file 'Percona-Server/mysql-test/suite/rpl/r/percona_replicate_annotate_rows_events.result'
2222--- Percona-Server/mysql-test/suite/rpl/r/percona_replicate_annotate_rows_events.result 1970-01-01 00:00:00 +0000
2223+++ Percona-Server/mysql-test/suite/rpl/r/percona_replicate_annotate_rows_events.result 2012-03-29 03:25:47 +0000
2224@@ -0,0 +1,16 @@
2225+include/master-slave.inc
2226+[connection master]
2227+DROP TABLE IF EXISTS t;
2228+CREATE TABLE t (a INT);
2229+INSERT INTO t VALUES(1);
2230+DROP TABLE t;
2231+select 738;
2232+738
2233+738
2234+select 738 = 738;
2235+738 = 738
2236+1
2237+select 738 = 738;
2238+738 = 738
2239+1
2240+include/rpl_end.inc
2241
2242=== added file 'Percona-Server/mysql-test/suite/rpl/r/rpl_row_annotate_do.result'
2243--- Percona-Server/mysql-test/suite/rpl/r/rpl_row_annotate_do.result 1970-01-01 00:00:00 +0000
2244+++ Percona-Server/mysql-test/suite/rpl/r/rpl_row_annotate_do.result 2012-03-29 03:25:47 +0000
2245@@ -0,0 +1,141 @@
2246+include/master-slave.inc
2247+[connection master]
2248+########################################################################
2249+# TABLES ON MASTER
2250+########################################################################
2251+SELECT * FROM t1 ORDER BY a;
2252+a b
2253+0 1
2254+SELECT * FROM t2 ORDER BY a;
2255+a b
2256+SELECT * FROM t3 ORDER BY a;
2257+a b
2258+1 1
2259+2 2
2260+3 3
2261+SELECT * FROM t5 ORDER BY a;
2262+a b
2263+1 foo
2264+2 bar
2265+3 baz
2266+4 gås
2267+5 gås
2268+########################################################################
2269+# TABLES ON SLAVE: should be the same as on master
2270+########################################################################
2271+SELECT * FROM t1 ORDER BY a;
2272+a b
2273+0 1
2274+SELECT * FROM t2 ORDER BY a;
2275+a b
2276+SELECT * FROM t3 ORDER BY a;
2277+a b
2278+1 1
2279+2 2
2280+3 3
2281+SELECT * FROM t5 ORDER BY a;
2282+a b
2283+1 foo
2284+2 bar
2285+3 baz
2286+4 gås
2287+5 gås
2288+########################################################################
2289+# EVENTS ON SLAVE
2290+# The following Annotate_rows events should appear below:
2291+# - UPDATE t1 SET b = b + 1;
2292+# - REPLACE t1 VALUES (1,1), (2,2), (3,3);
2293+# - INSERT INTO t2 VALUES (1,1), (2,2), (3,3)
2294+# - INSERT INTO t3 VALUES (1,1), (2,2), (3,3)
2295+# - DELETE t1, t2 FROM <...>
2296+# - INSERT INTO t2 VALUES (1,1), (2,2), (3,3)
2297+# - DELETE xt1, t2 FROM <...>
2298+# - INSERT INTO t5(b) VALUES <...> (3 instances)
2299+########################################################################
2300+FLUSH LOGS;
2301+show binlog events in 'slave-bin.000001' from <start_pos>;
2302+Log_name Pos Event_type Server_id End_log_pos Info
2303+slave-bin.000001 # Query 1 # DROP DATABASE IF EXISTS test1
2304+slave-bin.000001 # Query 1 # CREATE DATABASE test1
2305+slave-bin.000001 # Query 1 # use `test1`; CREATE TABLE t1(a int primary key, b int)
2306+slave-bin.000001 # Query 1 # use `test1`; CREATE TABLE t2(a int, b int)
2307+slave-bin.000001 # Query 1 # use `test1`; CREATE TABLE t3(a int, b int)
2308+slave-bin.000001 # Query 1 # use `test1`; CREATE TABLE t4(a int, b int)
2309+slave-bin.000001 # Query 1 # use `test1`; CREATE TABLE t5 (
2310+a INT PRIMARY KEY AUTO_INCREMENT,
2311+b VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_bin
2312+)
2313+slave-bin.000001 # Query 1 # BEGIN
2314+slave-bin.000001 # Table_map 1 # table_id: # (test1.t1)
2315+slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
2316+slave-bin.000001 # Query 1 # COMMIT
2317+slave-bin.000001 # Query 1 # BEGIN
2318+slave-bin.000001 # Annotate_rows 1 # UPDATE t1 SET b = b + 1
2319+slave-bin.000001 # Table_map 1 # table_id: # (test1.t1)
2320+slave-bin.000001 # Update_rows 1 # table_id: # flags: STMT_END_F
2321+slave-bin.000001 # Query 1 # COMMIT
2322+slave-bin.000001 # Query 1 # BEGIN
2323+slave-bin.000001 # Annotate_rows 1 # REPLACE t1 VALUES (1,1), (2,2), (3,3)
2324+slave-bin.000001 # Table_map 1 # table_id: # (test1.t1)
2325+slave-bin.000001 # Update_rows 1 # table_id: #
2326+slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
2327+slave-bin.000001 # Query 1 # COMMIT
2328+slave-bin.000001 # Query 1 # BEGIN
2329+slave-bin.000001 # Annotate_rows 1 # INSERT INTO t2 VALUES (1,1), (2,2), (3,3)
2330+slave-bin.000001 # Table_map 1 # table_id: # (test1.t2)
2331+slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
2332+slave-bin.000001 # Query 1 # COMMIT
2333+slave-bin.000001 # Query 1 # BEGIN
2334+slave-bin.000001 # Annotate_rows 1 # INSERT INTO t3 VALUES (1,1), (2,2), (3,3)
2335+slave-bin.000001 # Table_map 1 # table_id: # (test1.t3)
2336+slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
2337+slave-bin.000001 # Query 1 # COMMIT
2338+slave-bin.000001 # Query 1 # BEGIN
2339+slave-bin.000001 # Annotate_rows 1 # DELETE t1, t2 FROM t1 INNER JOIN t2 INNER JOIN t3 WHERE t1.a=t2.a AND t2.a=t3.a
2340+slave-bin.000001 # Table_map 1 # table_id: # (test1.t2)
2341+slave-bin.000001 # Table_map 1 # table_id: # (test1.t1)
2342+slave-bin.000001 # Delete_rows 1 # table_id: #
2343+slave-bin.000001 # Delete_rows 1 # table_id: # flags: STMT_END_F
2344+slave-bin.000001 # Query 1 # COMMIT
2345+slave-bin.000001 # Query 1 # BEGIN
2346+slave-bin.000001 # Annotate_rows 1 # INSERT INTO t2 VALUES (1,1), (2,2), (3,3)
2347+slave-bin.000001 # Table_map 1 # table_id: # (test1.t2)
2348+slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
2349+slave-bin.000001 # Query 1 # COMMIT
2350+slave-bin.000001 # Query 1 # BEGIN
2351+slave-bin.000001 # Annotate_rows 1 # DELETE xt1, t2 FROM xt1 INNER JOIN t2 INNER JOIN t3 WHERE xt1.a=t2.a AND t2.a=t3.a
2352+slave-bin.000001 # Table_map 1 # table_id: # (test1.t2)
2353+slave-bin.000001 # Delete_rows 1 # table_id: # flags: STMT_END_F
2354+slave-bin.000001 # Query 1 # COMMIT
2355+slave-bin.000001 # Query 1 # BEGIN
2356+slave-bin.000001 # Annotate_rows 1 # INSERT INTO t5(b) VALUES ('foo'), ('bar'), ('baz')
2357+slave-bin.000001 # Table_map 1 # table_id: # (test1.t5)
2358+slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
2359+slave-bin.000001 # Query 1 # COMMIT
2360+slave-bin.000001 # Query 1 # BEGIN
2361+slave-bin.000001 # Annotate_rows 1 # INSERT INTO t5(b) VALUES ('gås')
2362+slave-bin.000001 # Table_map 1 # table_id: # (test1.t5)
2363+slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
2364+slave-bin.000001 # Query 1 # COMMIT
2365+slave-bin.000001 # Query 1 # BEGIN
2366+slave-bin.000001 # Annotate_rows 1 # INSERT INTO t5(b) VALUES ('gås')
2367+slave-bin.000001 # Table_map 1 # table_id: # (test1.t5)
2368+slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
2369+slave-bin.000001 # Query 1 # COMMIT
2370+slave-bin.000001 # Rotate 2 # slave-bin.000002;pos=4
2371+#
2372+########################################################################
2373+# INSERTs DELAYED ON MASTERs
2374+########################################################################
2375+SET SESSION binlog_annotate_rows_events = ON;
2376+INSERT DELAYED INTO test1.t4 VALUES (1,1);
2377+FLUSH TABLES;
2378+SELECT * FROM test1.t4 ORDER BY a;
2379+a b
2380+1 1
2381+########################################################################
2382+# ON SLAVE
2383+# No Annotate_rows events should appear below
2384+########################################################################
2385+FLUSH LOGS;
2386+include/rpl_end.inc
2387
2388=== added file 'Percona-Server/mysql-test/suite/rpl/r/rpl_row_annotate_dont.result'
2389--- Percona-Server/mysql-test/suite/rpl/r/rpl_row_annotate_dont.result 1970-01-01 00:00:00 +0000
2390+++ Percona-Server/mysql-test/suite/rpl/r/rpl_row_annotate_dont.result 2012-03-29 03:25:47 +0000
2391@@ -0,0 +1,123 @@
2392+include/master-slave.inc
2393+[connection master]
2394+########################################################################
2395+# TABLES ON MASTER
2396+########################################################################
2397+SELECT * FROM t1 ORDER BY a;
2398+a b
2399+0 1
2400+SELECT * FROM t2 ORDER BY a;
2401+a b
2402+SELECT * FROM t3 ORDER BY a;
2403+a b
2404+1 1
2405+2 2
2406+3 3
2407+SELECT * FROM t5 ORDER BY a;
2408+a b
2409+1 foo
2410+2 bar
2411+3 baz
2412+4 gås
2413+5 gås
2414+########################################################################
2415+# TABLES ON SLAVE: should be the same as on master
2416+########################################################################
2417+SELECT * FROM t1 ORDER BY a;
2418+a b
2419+0 1
2420+SELECT * FROM t2 ORDER BY a;
2421+a b
2422+SELECT * FROM t3 ORDER BY a;
2423+a b
2424+1 1
2425+2 2
2426+3 3
2427+SELECT * FROM t5 ORDER BY a;
2428+a b
2429+1 foo
2430+2 bar
2431+3 baz
2432+4 gås
2433+5 gås
2434+########################################################################
2435+# EVENTS ON SLAVE
2436+# No Annotate_rows events should appear below
2437+########################################################################
2438+FLUSH LOGS;
2439+show binlog events in 'slave-bin.000001' from <start_pos>;
2440+Log_name Pos Event_type Server_id End_log_pos Info
2441+slave-bin.000001 # Query 1 # DROP DATABASE IF EXISTS test1
2442+slave-bin.000001 # Query 1 # CREATE DATABASE test1
2443+slave-bin.000001 # Query 1 # use `test1`; CREATE TABLE t1(a int primary key, b int)
2444+slave-bin.000001 # Query 1 # use `test1`; CREATE TABLE t2(a int, b int)
2445+slave-bin.000001 # Query 1 # use `test1`; CREATE TABLE t3(a int, b int)
2446+slave-bin.000001 # Query 1 # use `test1`; CREATE TABLE t4(a int, b int)
2447+slave-bin.000001 # Query 1 # use `test1`; CREATE TABLE t5 (
2448+a INT PRIMARY KEY AUTO_INCREMENT,
2449+b VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_bin
2450+)
2451+slave-bin.000001 # Query 1 # BEGIN
2452+slave-bin.000001 # Table_map 1 # table_id: # (test1.t1)
2453+slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
2454+slave-bin.000001 # Query 1 # COMMIT
2455+slave-bin.000001 # Query 1 # BEGIN
2456+slave-bin.000001 # Table_map 1 # table_id: # (test1.t1)
2457+slave-bin.000001 # Update_rows 1 # table_id: # flags: STMT_END_F
2458+slave-bin.000001 # Query 1 # COMMIT
2459+slave-bin.000001 # Query 1 # BEGIN
2460+slave-bin.000001 # Table_map 1 # table_id: # (test1.t1)
2461+slave-bin.000001 # Update_rows 1 # table_id: #
2462+slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
2463+slave-bin.000001 # Query 1 # COMMIT
2464+slave-bin.000001 # Query 1 # BEGIN
2465+slave-bin.000001 # Table_map 1 # table_id: # (test1.t2)
2466+slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
2467+slave-bin.000001 # Query 1 # COMMIT
2468+slave-bin.000001 # Query 1 # BEGIN
2469+slave-bin.000001 # Table_map 1 # table_id: # (test1.t3)
2470+slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
2471+slave-bin.000001 # Query 1 # COMMIT
2472+slave-bin.000001 # Query 1 # BEGIN
2473+slave-bin.000001 # Table_map 1 # table_id: # (test1.t2)
2474+slave-bin.000001 # Table_map 1 # table_id: # (test1.t1)
2475+slave-bin.000001 # Delete_rows 1 # table_id: #
2476+slave-bin.000001 # Delete_rows 1 # table_id: # flags: STMT_END_F
2477+slave-bin.000001 # Query 1 # COMMIT
2478+slave-bin.000001 # Query 1 # BEGIN
2479+slave-bin.000001 # Table_map 1 # table_id: # (test1.t2)
2480+slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
2481+slave-bin.000001 # Query 1 # COMMIT
2482+slave-bin.000001 # Query 1 # BEGIN
2483+slave-bin.000001 # Table_map 1 # table_id: # (test1.t2)
2484+slave-bin.000001 # Delete_rows 1 # table_id: # flags: STMT_END_F
2485+slave-bin.000001 # Query 1 # COMMIT
2486+slave-bin.000001 # Query 1 # BEGIN
2487+slave-bin.000001 # Table_map 1 # table_id: # (test1.t5)
2488+slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
2489+slave-bin.000001 # Query 1 # COMMIT
2490+slave-bin.000001 # Query 1 # BEGIN
2491+slave-bin.000001 # Table_map 1 # table_id: # (test1.t5)
2492+slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
2493+slave-bin.000001 # Query 1 # COMMIT
2494+slave-bin.000001 # Query 1 # BEGIN
2495+slave-bin.000001 # Table_map 1 # table_id: # (test1.t5)
2496+slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
2497+slave-bin.000001 # Query 1 # COMMIT
2498+slave-bin.000001 # Rotate 2 # slave-bin.000002;pos=4
2499+#
2500+########################################################################
2501+# INSERTs DELAYED ON MASTERs
2502+########################################################################
2503+SET SESSION binlog_annotate_rows_events = ON;
2504+INSERT DELAYED INTO test1.t4 VALUES (1,1);
2505+FLUSH TABLES;
2506+SELECT * FROM test1.t4 ORDER BY a;
2507+a b
2508+1 1
2509+########################################################################
2510+# ON SLAVE
2511+# No Annotate_rows events should appear below
2512+########################################################################
2513+FLUSH LOGS;
2514+include/rpl_end.inc
2515
2516=== modified file 'Percona-Server/mysql-test/suite/rpl/r/rpl_row_conflicts.result'
2517--- Percona-Server/mysql-test/suite/rpl/r/rpl_row_conflicts.result 2011-02-23 09:31:37 +0000
2518+++ Percona-Server/mysql-test/suite/rpl/r/rpl_row_conflicts.result 2012-03-29 03:25:47 +0000
2519@@ -21,7 +21,7 @@
2520 [on slave]
2521 ---- Wait until slave stops with an error ----
2522 include/wait_for_slave_sql_error.inc [errno=1062]
2523-Last_SQL_Error = Could not execute Write_rows event on table test.t1; Duplicate entry '1' for key 'PRIMARY', Error_code: 1062; handler error HA_ERR_FOUND_DUPP_KEY; the event's master log master-bin.000001, end_log_pos 346 (expected "duplicate key" error)
2524+Last_SQL_Error = Could not execute Write_rows event on table test.t1; Duplicate entry '1' for key 'PRIMARY', Error_code: 1062; handler error HA_ERR_FOUND_DUPP_KEY; the event's master log master-bin.000001, end_log_pos 480 (expected "duplicate key" error)
2525 call mtr.add_suppression("Slave SQL.*Duplicate entry .1. for key .PRIMARY.* Error_code: 1062");
2526 SELECT * FROM t1;
2527 a
2528
2529=== added file 'Percona-Server/mysql-test/suite/rpl/t/percona_replicate_annotate_rows_events-master.opt'
2530--- Percona-Server/mysql-test/suite/rpl/t/percona_replicate_annotate_rows_events-master.opt 1970-01-01 00:00:00 +0000
2531+++ Percona-Server/mysql-test/suite/rpl/t/percona_replicate_annotate_rows_events-master.opt 2012-03-29 03:25:47 +0000
2532@@ -0,0 +1,1 @@
2533+--binlog_annotate_rows_events --replicate_annotate_rows_events
2534
2535=== added file 'Percona-Server/mysql-test/suite/rpl/t/percona_replicate_annotate_rows_events-slave.opt'
2536--- Percona-Server/mysql-test/suite/rpl/t/percona_replicate_annotate_rows_events-slave.opt 1970-01-01 00:00:00 +0000
2537+++ Percona-Server/mysql-test/suite/rpl/t/percona_replicate_annotate_rows_events-slave.opt 2012-03-29 03:25:47 +0000
2538@@ -0,0 +1,1 @@
2539+--slave_net_timeout=1 --log_slave_updates=0 --binlog_annotate_rows_events --replicate_annotate_rows_events
2540
2541=== added file 'Percona-Server/mysql-test/suite/rpl/t/percona_replicate_annotate_rows_events.test'
2542--- Percona-Server/mysql-test/suite/rpl/t/percona_replicate_annotate_rows_events.test 1970-01-01 00:00:00 +0000
2543+++ Percona-Server/mysql-test/suite/rpl/t/percona_replicate_annotate_rows_events.test 2012-03-29 03:25:47 +0000
2544@@ -0,0 +1,35 @@
2545+########################################################################
2546+# Bug #872754: Annotate rows events on slave doesnt' work without slave's binlog
2547+########################################################################
2548+
2549+--source include/master-slave.inc
2550+--source include/have_binlog_format_row.inc
2551+--source include/have_debug.inc
2552+
2553+connection master;
2554+--disable_warnings
2555+DROP TABLE IF EXISTS t;
2556+--enable_warnings
2557+
2558+CREATE TABLE t (a INT);
2559+INSERT INTO t VALUES(1);
2560+
2561+--sleep 2
2562+
2563+DROP TABLE t;
2564+
2565+# The following would hang with the bug not fixed
2566+--sync_slave_with_master
2567+
2568+connection master;
2569+--let $master_log_pos= query_get_value(SHOW MASTER STATUS, Position, 1)
2570+--eval select $master_log_pos
2571+
2572+connection slave;
2573+--let $read_master_log_pos= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1)
2574+--eval select $master_log_pos = $read_master_log_pos
2575+
2576+--let $exec_master_log_pos= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1)
2577+--eval select $master_log_pos = $exec_master_log_pos
2578+
2579+--source include/rpl_end.inc
2580
2581=== added file 'Percona-Server/mysql-test/suite/rpl/t/rpl_row_annotate_do-slave.opt'
2582--- Percona-Server/mysql-test/suite/rpl/t/rpl_row_annotate_do-slave.opt 1970-01-01 00:00:00 +0000
2583+++ Percona-Server/mysql-test/suite/rpl/t/rpl_row_annotate_do-slave.opt 2012-03-29 03:25:47 +0000
2584@@ -0,0 +1,1 @@
2585+--log-slave-updates --replicate-annotate-rows-events --replicate-ignore-table=test1.xt1 --replicate-ignore-table=test1.xt2
2586\ No newline at end of file
2587
2588=== added file 'Percona-Server/mysql-test/suite/rpl/t/rpl_row_annotate_do.test'
2589--- Percona-Server/mysql-test/suite/rpl/t/rpl_row_annotate_do.test 1970-01-01 00:00:00 +0000
2590+++ Percona-Server/mysql-test/suite/rpl/t/rpl_row_annotate_do.test 2012-03-29 03:25:47 +0000
2591@@ -0,0 +1,16 @@
2592+###############################################################################
2593+# MariaDB WL 47: Store in binlog text of statements that caused RBR events
2594+# Wrapper for extra/rpl/rpl_row_annotate.test.
2595+# Intended to test that if the --replicate-annotate-rows-events option
2596+# is switched on on slave then Annotate_events:
2597+# - are reproduced on slave
2598+# - are reproduced only once for "multi-table-maps" rbr queries
2599+# - are not reproduced when the corresponding queries are filtered away
2600+# on replication
2601+# - are reproduced when the corresponding queries are filtered away partialy
2602+# (e.g. in case of multi-delete)
2603+# - are not generated on slave for queries that are not annotated on master.
2604+###############################################################################
2605+
2606+--source include/have_binlog_format_row.inc
2607+--source extra/rpl_tests/rpl_row_annotate.test
2608
2609=== added file 'Percona-Server/mysql-test/suite/rpl/t/rpl_row_annotate_dont-slave.opt'
2610--- Percona-Server/mysql-test/suite/rpl/t/rpl_row_annotate_dont-slave.opt 1970-01-01 00:00:00 +0000
2611+++ Percona-Server/mysql-test/suite/rpl/t/rpl_row_annotate_dont-slave.opt 2012-03-29 03:25:47 +0000
2612@@ -0,0 +1,1 @@
2613+--log-slave-updates --replicate-ignore-table=test1.xt1 --replicate-ignore-table=test1.xt2
2614\ No newline at end of file
2615
2616=== added file 'Percona-Server/mysql-test/suite/rpl/t/rpl_row_annotate_dont.test'
2617--- Percona-Server/mysql-test/suite/rpl/t/rpl_row_annotate_dont.test 1970-01-01 00:00:00 +0000
2618+++ Percona-Server/mysql-test/suite/rpl/t/rpl_row_annotate_dont.test 2012-03-29 03:25:47 +0000
2619@@ -0,0 +1,9 @@
2620+###############################################################################
2621+# MariaDB WL 47: Store in binlog text of statements that caused RBR events
2622+# Wrapper for extra/rpl/rpl_row_annotate.test.
2623+# Intended to test that if the --replicate-annotate-rows-events option
2624+# is switched off on slave then Annotate_events are not reproduced.
2625+###############################################################################
2626+
2627+--source include/have_binlog_format_row.inc
2628+--source extra/rpl_tests/rpl_row_annotate.test
2629
2630=== modified file 'Percona-Server/mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test'
2631--- Percona-Server/mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test 2010-12-19 17:07:28 +0000
2632+++ Percona-Server/mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test 2012-03-29 03:25:47 +0000
2633@@ -1,7 +1,8 @@
2634 # depends on the binlog output
2635 -- source include/have_binlog_format_row.inc
2636+--source include/binlog_start_pos.inc
2637
2638-let $rename_event_pos= 897;
2639+let $rename_event_pos= `select @binlog_start + 791`;
2640
2641 # Bug#18326: Do not lock table for writing during prepare of statement
2642 # The use of the ps protocol causes extra table maps in the binlog, so
2643
2644=== modified file 'Percona-Server/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test'
2645--- Percona-Server/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test 2010-12-19 17:07:28 +0000
2646+++ Percona-Server/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test 2012-03-29 03:25:47 +0000
2647@@ -162,15 +162,18 @@
2648
2649 remove_file $MYSQLTEST_VARDIR/tmp/master.sql;
2650
2651+--source include/binlog_start_pos.inc
2652
2653 # this test for position option
2654-# By setting this position to 416, we should only get the create of t3
2655+# By setting this position to start_binlog_pos + 310, we should only get the create of t3
2656+let $start_pos= `select @binlog_start + 310`;
2657+let $stop_pos= `select @binlog_start + 463`;
2658 --disable_query_log
2659 select "--- Test 2 position test --" as "";
2660 --enable_query_log
2661 let $MYSQLD_DATADIR= `select @@datadir;`;
2662 --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
2663---exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --position=416 --stop-position=569 $MYSQLD_DATADIR/master-bin.000001
2664+--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --position=$start_pos --stop-position=$stop_pos $MYSQLD_DATADIR/master-bin.000001
2665
2666 # These are tests for remote binlog.
2667 # They should return the same as previous test.
2668@@ -181,7 +184,7 @@
2669
2670 # This is broken now
2671 --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
2672---exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --stop-position=569 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
2673+--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --stop-position=$stop_pos --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
2674
2675 # This part is disabled due to bug #17654
2676
2677@@ -257,7 +260,7 @@
2678 select "--- Test 5 LOAD DATA --" as "";
2679 --enable_query_log
2680 --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
2681---exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --stop-position=106 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002
2682+--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --stop-position=$binlog_start --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002
2683
2684 # Bug#7853 (mysqlbinlog does not accept input from stdin)
2685
2686@@ -265,14 +268,17 @@
2687 select "--- Test 6 reading stdin --" as "";
2688 --enable_query_log
2689 let $MYSQLD_DATADIR= `select @@datadir;`;
2690+let $stop_pos= `select @binlog_start + 463`;
2691 --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
2692---exec $MYSQL_BINLOG --short-form --stop-position=569 - < $MYSQLD_DATADIR/master-bin.000001
2693+--exec $MYSQL_BINLOG --short-form --stop-position=$stop_pos - < $MYSQLD_DATADIR/master-bin.000001
2694
2695 --disable_query_log
2696 select "--- Test 7 reading stdin w/position --" as "";
2697 --enable_query_log
2698+let $start_pos= `select @binlog_start + 310`;
2699+let $stop_pos= `select @binlog_start + 463`;
2700 --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
2701---exec $MYSQL_BINLOG --short-form --position=416 --stop-position=569 - < $MYSQLD_DATADIR/master-bin.000001
2702+--exec $MYSQL_BINLOG --short-form --position=$start_pos --stop-position=$stop_pos - < $MYSQLD_DATADIR/master-bin.000001
2703
2704 # Bug#16217 (mysql client did not know how not switch its internal charset)
2705 --disable_query_log
2706
2707=== modified file 'Percona-Server/mysql-test/suite/rpl/t/rpl_stm_flsh_tbls.test'
2708--- Percona-Server/mysql-test/suite/rpl/t/rpl_stm_flsh_tbls.test 2010-12-19 17:07:28 +0000
2709+++ Percona-Server/mysql-test/suite/rpl/t/rpl_stm_flsh_tbls.test 2012-03-29 03:25:47 +0000
2710@@ -1,5 +1,6 @@
2711 # depends on the binlog output
2712 --source include/have_binlog_format_mixed_or_statement.inc
2713+--source include/binlog_start_pos.inc
2714
2715-let $rename_event_pos= 656;
2716+let $rename_event_pos= `select @binlog_start + 550`;
2717 -- source extra/rpl_tests/rpl_flsh_tbls.test
2718
2719=== modified file 'Percona-Server/mysql-test/t/ctype_cp932_binlog_stm.test'
2720--- Percona-Server/mysql-test/t/ctype_cp932_binlog_stm.test 2011-03-30 12:33:53 +0000
2721+++ Percona-Server/mysql-test/t/ctype_cp932_binlog_stm.test 2012-03-29 03:25:47 +0000
2722@@ -28,16 +28,6 @@
2723
2724 --echo End of 5.0 tests
2725
2726-#
2727-# #28436: Incorrect position in SHOW BINLOG EVENTS causes server coredump
2728-# Note: 364 is a magic position (found experimentally, depends on
2729-# the log's contents) that caused the server crash.
2730-
2731-call mtr.add_suppression("Error in Log_event::read_log_event\\\(\\\): 'Sanity check failed', data_len: 258, event_type: 49");
2732-
2733---error 1220
2734-SHOW BINLOG EVENTS FROM 365;
2735-
2736 --echo Bug#44352 UPPER/LOWER function doesn't work correctly on cp932 and sjis environment.
2737 CREATE TABLE t1 (a varchar(16)) character set cp932;
2738 INSERT INTO t1 VALUES (0x8372835E),(0x8352835E);
2739
2740=== modified file 'Percona-Server/mysql-test/t/mysqlbinlog-master.opt'
2741--- Percona-Server/mysql-test/t/mysqlbinlog-master.opt 2010-11-05 14:26:38 +0000
2742+++ Percona-Server/mysql-test/t/mysqlbinlog-master.opt 2012-03-29 03:25:47 +0000
2743@@ -1,2 +1,1 @@
2744---max-binlog-size=4096
2745 --force-restart
2746
2747=== modified file 'Percona-Server/mysql-test/t/mysqlbinlog.test'
2748--- Percona-Server/mysql-test/t/mysqlbinlog.test 2011-03-25 14:16:13 +0000
2749+++ Percona-Server/mysql-test/t/mysqlbinlog.test 2012-03-29 03:25:47 +0000
2750@@ -3,10 +3,18 @@
2751 -- source include/have_binlog_format_statement.inc
2752
2753 -- source include/have_log_bin.inc
2754+-- source include/binlog_start_pos.inc
2755
2756 # Deletes all the binary logs
2757 reset master;
2758
2759+# We need small binlog size to break the last LOAD DATA INFILE below so that
2760+# the corresponding Begin_load_query will be written to master-bin.000001
2761+# while the Execute_load_query will be written to master-bin.000002.
2762+
2763+SET @save_binlog_size= @@global.max_binlog_size;
2764+SET @@global.max_binlog_size= 4096;
2765+
2766 # we need this for getting fixed timestamps inside of this test
2767 set timestamp=1000000000;
2768
2769@@ -26,13 +34,15 @@
2770
2771 # test for load data and load data distributed among the several
2772 # files (we need to fill up first binlog)
2773-load data infile '../../std_data/words.dat' into table t1;
2774-load data infile '../../std_data/words.dat' into table t1;
2775-load data infile '../../std_data/words.dat' into table t1;
2776-load data infile '../../std_data/words.dat' into table t1;
2777-load data infile '../../std_data/words.dat' into table t1;
2778+load data infile '../../std_data/words3.dat' into table t1;
2779+load data infile '../../std_data/words3.dat' into table t1;
2780+load data infile '../../std_data/words3.dat' into table t1;
2781+load data infile '../../std_data/words3.dat' into table t1;
2782+load data infile '../../std_data/words3.dat' into table t1;
2783 # simple query to show more in second binlog
2784 insert into t1 values ("Alas");
2785+
2786+### Starting master-bin.000003
2787 flush logs;
2788
2789 # delimiters are for easier debugging in future
2790@@ -46,7 +56,7 @@
2791 #
2792 let $MYSQLD_DATADIR= `select @@datadir`;
2793 --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
2794---replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/
2795+--replace_regex /SQL_LOAD_MB-[0-9a-f]+-[0-9a-f]+/SQL_LOAD_MB-#-#/
2796 --exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLD_DATADIR/master-bin.000001
2797
2798 # this should not fail but shouldn't produce any working statements
2799@@ -54,7 +64,7 @@
2800 select "--- Broken LOAD DATA --" as "";
2801 --enable_query_log
2802 --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
2803---replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/
2804+--replace_regex /SQL_LOAD_MB-[0-9a-f]+-[0-9a-f]+/SQL_LOAD_MB-#-#/
2805 --exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLD_DATADIR/master-bin.000002 2> /dev/null
2806
2807 # this should show almost nothing
2808@@ -62,17 +72,17 @@
2809 select "--- --database --" as "";
2810 --enable_query_log
2811 --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
2812---replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/
2813+--replace_regex /SQL_LOAD_MB-[0-9a-f]+-[0-9a-f]+/SQL_LOAD_MB-#-#/
2814 --exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --database=nottest $MYSQLD_DATADIR/master-bin.000001 2> /dev/null
2815
2816 # this test for position option
2817 --disable_query_log
2818 select "--- --position --" as "";
2819 --enable_query_log
2820+let $start_pos= `select @binlog_start + 227`;
2821 --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
2822---replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/
2823---exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --position=332 $MYSQLD_DATADIR/master-bin.000002
2824-
2825+--replace_regex /SQL_LOAD_MB-[0-9a-f]+-[0-9a-f]+/SQL_LOAD_MB-#-#/
2826+--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --position=$start_pos $MYSQLD_DATADIR/master-bin.000002
2827
2828 # These are tests for remote binlog.
2829 # They should return the same as previous test.
2830@@ -83,7 +93,7 @@
2831
2832 # This is broken now
2833 --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
2834---replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/
2835+--replace_regex /SQL_LOAD_MB-[0-9a-f]+-[0-9a-f]+/SQL_LOAD_MB-#-#/
2836 --exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
2837
2838 # This is broken too
2839@@ -91,7 +101,7 @@
2840 select "--- Broken LOAD DATA --" as "";
2841 --enable_query_log
2842 --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
2843---replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/
2844+--replace_regex /SQL_LOAD_MB-[0-9a-f]+-[0-9a-f]+/SQL_LOAD_MB-#-#/
2845 --exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002 2> /dev/null
2846
2847 # And this too ! (altough it is documented)
2848@@ -99,34 +109,39 @@
2849 select "--- --database --" as "";
2850 --enable_query_log
2851 --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
2852---replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/
2853+--replace_regex /SQL_LOAD_MB-[0-9a-f]+-[0-9a-f]+/SQL_LOAD_MB-#-#/
2854 --exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT --database=nottest master-bin.000001 2> /dev/null
2855
2856 # Strangely but this works
2857 --disable_query_log
2858 select "--- --position --" as "";
2859 --enable_query_log
2860+let $start_pos= `select @binlog_start + 227`;
2861 --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
2862---replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/
2863---exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --read-from-remote-server --position=332 --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002
2864+--replace_regex /SQL_LOAD_MB-[0-9a-f]+-[0-9a-f]+/SQL_LOAD_MB-#-#/
2865+--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --read-from-remote-server --position=$start_pos --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002
2866
2867 # Bug#7853 mysqlbinlog does not accept input from stdin
2868 --disable_query_log
2869 select "--- reading stdin --" as "";
2870 --enable_query_log
2871 --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
2872---replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/
2873+--replace_regex /SQL_LOAD_MB-[0-9a-f]+-[0-9a-f]+/SQL_LOAD_MB-#-#/
2874 --exec $MYSQL_BINLOG --short-form - < $MYSQL_TEST_DIR/std_data/trunc_binlog.000001
2875
2876 --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
2877---replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/
2878+--replace_regex /SQL_LOAD_MB-[0-9a-f]+-[0-9a-f]+/SQL_LOAD_MB-#-#/
2879 --exec $MYSQL_BINLOG --short-form --position=79 - < $MYSQL_TEST_DIR/std_data/trunc_binlog.000001
2880 drop table t1,t2;
2881
2882+SET @@global.max_binlog_size= @save_binlog_size;
2883+
2884 #
2885 # Bug#14157 utf8 encoding in binlog without set character_set_client
2886 #
2887+### Starting master-bin.000004
2888 flush logs;
2889+
2890 --write_file $MYSQLTEST_VARDIR/tmp/bug14157.sql
2891 create table if not exists t5 (a int);
2892 set names latin1;
2893@@ -140,6 +155,8 @@
2894 # resulted binlog, parly consisting of multi-byte utf8 chars,
2895 # must be digestable for both client and server. In 4.1 the client
2896 # should use default-character-set same as the server.
2897+
2898+### Starting master-bin.000005
2899 flush logs;
2900 --exec $MYSQL_BINLOG --short-form $MYSQLD_DATADIR/master-bin.000004 | $MYSQL
2901 select * from t5 /* must be (1),(1) */;
2902@@ -150,6 +167,8 @@
2903 # Check that a dump created by mysqlbinlog reproduces
2904 # lc_time_names dependent values correctly
2905 #
2906+
2907+### Starting master-bin.000006
2908 flush logs;
2909 create table t5 (c1 int, c2 varchar(128) character set latin1 not null);
2910 insert into t5 values (1, date_format('2001-01-01','%W'));
2911@@ -158,7 +177,10 @@
2912 set lc_time_names=en_US;
2913 insert into t5 values (3, date_format('2001-01-01','%W'));
2914 select * from t5 order by c1;
2915+
2916+### Starting master-bin.000007
2917 flush logs;
2918+
2919 drop table t5;
2920 --exec $MYSQL_BINLOG --short-form $MYSQLD_DATADIR/master-bin.000006 | $MYSQL
2921 select * from t5 order by c1;
2922@@ -170,7 +192,10 @@
2923 --disable_warnings
2924 drop procedure if exists p1;
2925 --enable_warnings
2926+
2927+### Starting master-bin.000008
2928 flush logs;
2929+
2930 delimiter //;
2931 create procedure p1()
2932 begin
2933@@ -178,12 +203,15 @@
2934 end;
2935 //
2936 delimiter ;//
2937+
2938+### Starting master-bin.000009
2939 flush logs;
2940+
2941 call p1();
2942 drop procedure p1;
2943 --error ER_SP_DOES_NOT_EXIST
2944 call p1();
2945---replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/
2946+--replace_regex /SQL_LOAD_MB-[0-9a-f]+-[0-9a-f]+/SQL_LOAD_MB-#-#/
2947 --exec $MYSQL_BINLOG --short-form $MYSQLD_DATADIR/master-bin.000008
2948 --exec $MYSQL_BINLOG --short-form $MYSQLD_DATADIR/master-bin.000008 | $MYSQL
2949 call p1();
2950@@ -202,7 +230,9 @@
2951 # (LOAD DATA INFILE need it)
2952 #
2953
2954+### Starting master-bin.000010
2955 flush logs;
2956+
2957 create table t1 (a varchar(64) character set utf8);
2958 load data infile '../../std_data/loaddata6.dat' into table t1;
2959 set character_set_database=koi8r;
2960@@ -217,9 +247,12 @@
2961 load data infile '../../std_data/loaddata6.dat' into table t1 character set koi8r;
2962 select hex(a) from t1;
2963 drop table t1;
2964+
2965+### Starting master-bin.000011
2966 flush logs;
2967+
2968 --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
2969---replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/
2970+--replace_regex /SQL_LOAD_MB-[0-9a-f]+-[0-9a-f]+/SQL_LOAD_MB-#-#/
2971 --exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLD_DATADIR/master-bin.000010
2972
2973 #
2974@@ -229,9 +262,14 @@
2975
2976 CREATE TABLE t1 (c1 CHAR(10));
2977 # we need this for getting fixed timestamps inside of this test
2978+### Starting master-bin.000012
2979 FLUSH LOGS;
2980+
2981 INSERT INTO t1 VALUES ('0123456789');
2982+
2983+### Starting master-bin.000013
2984 FLUSH LOGS;
2985+
2986 DROP TABLE t1;
2987
2988 # We create a table, patch, and load the output into it
2989@@ -257,11 +295,16 @@
2990 #
2991 # Bug#29928 incorrect connection_id() restoring from mysqlbinlog out
2992 #
2993+### Starting master-bin.000014
2994 FLUSH LOGS;
2995+
2996 CREATE TABLE t1(a INT);
2997 INSERT INTO t1 VALUES(connection_id());
2998 let $a= `SELECT a FROM t1`;
2999+
3000+### Starting master-bin.000015
3001 FLUSH LOGS;
3002+
3003 let $outfile= $MYSQLTEST_VARDIR/tmp/bug29928.sql;
3004 --exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000014 > $outfile
3005 DROP TABLE t1;
3006@@ -281,11 +324,12 @@
3007 exec $MYSQL_BINLOG $MYSQL_TEST_DIR/std_data/corrupt-relay-bin.000624 > $MYSQLTEST_VARDIR/tmp/bug31793.sql;
3008 --remove_file $MYSQLTEST_VARDIR/tmp/bug31793.sql
3009
3010-
3011 #
3012 # Test --disable-force-if-open and --force-if-open
3013 #
3014+### Starting master-bin.000016
3015 FLUSH LOGS;
3016+
3017 --error 1
3018 --exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000016 >/dev/null 2>/dev/null
3019 --exec $MYSQL_BINLOG --force-if-open $MYSQLD_DATADIR/master-bin.000016 >/dev/null 2>/dev/null
3020@@ -300,9 +344,15 @@
3021 SHOW GRANTS FOR untrusted@localhost;
3022 USE mysqltest1;
3023 CREATE TABLE t1 (a INT, b CHAR(64));
3024+
3025+### Starting master-bin.000017
3026 flush logs;
3027+
3028 INSERT INTO t1 VALUES (1,USER());
3029+
3030+### Starting master-bin.000018
3031 flush logs;
3032+
3033 echo mysqlbinlog var/log/master-bin.000017 > var/tmp/bug31611.sql;
3034 exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000017 > $MYSQLTEST_VARDIR/tmp/bug31611.sql;
3035 connect (unsecure,localhost,untrusted,,mysqltest1);
3036@@ -326,14 +376,20 @@
3037 connection default;
3038 USE test;
3039 SET BINLOG_FORMAT = STATEMENT;
3040+
3041+### Starting master-bin.000019
3042 FLUSH LOGS;
3043+
3044 CREATE TABLE t1 (a_real FLOAT, an_int INT, a_decimal DECIMAL(5,2), a_string CHAR(32));
3045 SET @a_real = rand(20) * 1000;
3046 SET @an_int = 1000;
3047 SET @a_decimal = CAST(rand(19) * 999 AS DECIMAL(5,2));
3048 SET @a_string = 'Just a test';
3049 INSERT INTO t1 VALUES (@a_real, @an_int, @a_decimal, @a_string);
3050+
3051+### Starting master-bin.000020
3052 FLUSH LOGS;
3053+
3054 query_vertical SELECT * FROM t1;
3055 DROP TABLE t1;
3056
3057@@ -357,6 +413,7 @@
3058
3059 RESET MASTER;
3060 FLUSH LOGS;
3061+
3062 --exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 > $binlog_file
3063 --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
3064 eval SELECT
3065
3066=== modified file 'Percona-Server/mysql-test/t/mysqlbinlog2.test'
3067--- Percona-Server/mysql-test/t/mysqlbinlog2.test 2008-03-25 17:40:49 +0000
3068+++ Percona-Server/mysql-test/t/mysqlbinlog2.test 2012-03-29 03:25:47 +0000
3069@@ -3,7 +3,7 @@
3070
3071 # TODO: Need to look at making row based version once new binlog client is complete.
3072 -- source include/have_binlog_format_mixed_or_statement.inc
3073-
3074+-- source include/binlog_start_pos.inc
3075
3076 --disable_warnings
3077 drop table if exists t1;
3078@@ -50,15 +50,19 @@
3079 --disable_query_log
3080 select "--- start-position --" as "";
3081 --enable_query_log
3082---exec $MYSQL_BINLOG --short-form --start-position=608 $MYSQLD_DATADIR/master-bin.000001
3083+let $start_pos= `select @binlog_start + 502`;
3084+--exec $MYSQL_BINLOG --short-form --start-position=$start_pos $MYSQLD_DATADIR/master-bin.000001
3085 --disable_query_log
3086 select "--- stop-position --" as "";
3087 --enable_query_log
3088---exec $MYSQL_BINLOG --short-form --stop-position=608 $MYSQLD_DATADIR/master-bin.000001
3089+let $stop_pos= `select @binlog_start + 502`;
3090+--exec $MYSQL_BINLOG --short-form --stop-position=$stop_pos $MYSQLD_DATADIR/master-bin.000001
3091 --disable_query_log
3092 select "--- start and stop positions ---" as "";
3093 --enable_query_log
3094---exec $MYSQL_BINLOG --short-form --start-position=608 --stop-position 725 $MYSQLD_DATADIR/master-bin.000001
3095+let $start_pos= `select @binlog_start + 502`;
3096+let $stop_pos= `select @binlog_start + 619`;
3097+--exec $MYSQL_BINLOG --short-form --start-position=$start_pos --stop-position $stop_pos $MYSQLD_DATADIR/master-bin.000001
3098 --disable_query_log
3099 select "--- start-datetime --" as "";
3100 --enable_query_log
3101@@ -84,11 +88,13 @@
3102 --disable_query_log
3103 select "--- start-position --" as "";
3104 --enable_query_log
3105---exec $MYSQL_BINLOG --short-form --start-position=608 $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.000002
3106+let $start_pos= `select @binlog_start + 502`;
3107+--exec $MYSQL_BINLOG --short-form --start-position=$start_pos $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.000002
3108 --disable_query_log
3109 select "--- stop-position --" as "";
3110 --enable_query_log
3111---exec $MYSQL_BINLOG --short-form --stop-position=134 $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.000002
3112+let $stop_pos= `select @binlog_start + 28`;
3113+--exec $MYSQL_BINLOG --short-form --stop-position=$stop_pos $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.000002
3114 --disable_query_log
3115 select "--- start-datetime --" as "";
3116 --enable_query_log
3117@@ -111,15 +117,19 @@
3118 --disable_query_log
3119 select "--- start-position --" as "";
3120 --enable_query_log
3121---exec $MYSQL_BINLOG --short-form --start-position=608 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
3122+let $start_pos= `select @binlog_start + 502`;
3123+--exec $MYSQL_BINLOG --short-form --start-position=$start_pos --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
3124 --disable_query_log
3125 select "--- stop-position --" as "";
3126 --enable_query_log
3127---exec $MYSQL_BINLOG --short-form --stop-position=608 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
3128+let $stop_pos= `select @binlog_start + 502`;
3129+--exec $MYSQL_BINLOG --short-form --stop-position=$stop_pos --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
3130 --disable_query_log
3131 select "--- start and stop positions ---" as "";
3132 --enable_query_log
3133---exec $MYSQL_BINLOG --short-form --start-position=608 --stop-position 725 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
3134+let $start_pos= `select @binlog_start + 502`;
3135+let $stop_pos= `select @binlog_start + 619`;
3136+--exec $MYSQL_BINLOG --short-form --start-position=$start_pos --stop-position $stop_pos --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
3137 --disable_query_log
3138 select "--- start-datetime --" as "";
3139 --enable_query_log
3140@@ -142,11 +152,13 @@
3141 --disable_query_log
3142 select "--- start-position --" as "";
3143 --enable_query_log
3144---exec $MYSQL_BINLOG --short-form --start-position=608 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002
3145+let $start_pos= `select @binlog_start + 502`;
3146+--exec $MYSQL_BINLOG --short-form --start-position=$start_pos --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002
3147 --disable_query_log
3148 select "--- stop-position --" as "";
3149 --enable_query_log
3150---exec $MYSQL_BINLOG --short-form --stop-position=134 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002
3151+let $stop_pos= `select @binlog_start + 28`;
3152+--exec $MYSQL_BINLOG --short-form --stop-position=$stop_pos --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002
3153 --disable_query_log
3154 select "--- start-datetime --" as "";
3155 --enable_query_log
3156
3157=== modified file 'Percona-Server/sql/handler.cc'
3158--- Percona-Server/sql/handler.cc 2011-11-24 16:33:30 +0000
3159+++ Percona-Server/sql/handler.cc 2012-03-29 03:25:47 +0000
3160@@ -4631,7 +4631,8 @@
3161
3162 /** @brief
3163 Write table maps for all (manually or automatically) locked tables
3164- to the binary log.
3165+ to the binary log. Also, if binlog_annotate_rows_events is ON,
3166+ write Annotate_rows event before the first table map.
3167
3168 SYNOPSIS
3169 write_locked_table_maps()
3170@@ -4668,6 +4669,9 @@
3171 locks[0]= thd->extra_lock;
3172 locks[1]= thd->lock;
3173 locks[2]= thd->locked_tables;
3174+ my_bool with_annotate= thd->variables.binlog_annotate_rows_events &&
3175+ thd->query() && thd->query_length();
3176+
3177 for (uint i= 0 ; i < sizeof(locks)/sizeof(*locks) ; ++i )
3178 {
3179 MYSQL_LOCK const *const lock= locks[i];
3180@@ -4685,7 +4689,8 @@
3181 check_table_binlog_row_based(thd, table))
3182 {
3183 int const has_trans= table->file->has_transactions();
3184- int const error= thd->binlog_write_table_map(table, has_trans);
3185+ int const error= thd->binlog_write_table_map(table, has_trans,
3186+ &with_annotate);
3187 /*
3188 If an error occurs, it is the responsibility of the caller to
3189 roll back the transaction.
3190
3191=== modified file 'Percona-Server/sql/log.cc'
3192--- Percona-Server/sql/log.cc 2012-02-07 03:25:46 +0000
3193+++ Percona-Server/sql/log.cc 2012-03-29 03:25:47 +0000
3194@@ -4318,10 +4318,12 @@
3195
3196
3197 /*
3198- Write a table map to the binary log.
3199+ Write a table map to the binary log. If with_annotate != NULL and
3200+ *with_annotate = TRUE write also Annotate_rows before the table map.
3201 */
3202
3203-int THD::binlog_write_table_map(TABLE *table, bool is_trans)
3204+int THD::binlog_write_table_map(TABLE *table, bool is_trans,
3205+ my_bool *with_annotate)
3206 {
3207 int error;
3208 DBUG_ENTER("THD::binlog_write_table_map");
3209@@ -4339,7 +4341,7 @@
3210 if (is_trans && binlog_table_maps == 0)
3211 binlog_start_trans_and_stmt();
3212
3213- if ((error= mysql_bin_log.write(&the_event)))
3214+ if ((error= mysql_bin_log.write(&the_event, with_annotate)))
3215 DBUG_RETURN(error);
3216
3217 binlog_table_maps++;
3218@@ -4469,10 +4471,12 @@
3219 }
3220
3221 /**
3222- Write an event to the binary log.
3223+ Write an event to the binary log. If with_annotate != NULL and
3224+ *with_annotate = TRUE write also Annotate_rows before the event
3225+ (this should happen only if the event is a Table_map).
3226 */
3227
3228-bool MYSQL_BIN_LOG::write(Log_event *event_info)
3229+bool MYSQL_BIN_LOG::write(Log_event *event_info, my_bool *with_annotate)
3230 {
3231 THD *thd= event_info->thd;
3232 bool error= 1;
3233@@ -4653,6 +4657,16 @@
3234 }
3235 }
3236
3237+ if (with_annotate && *with_annotate)
3238+ {
3239+ DBUG_ASSERT(event_info->get_type_code() == TABLE_MAP_EVENT);
3240+ Annotate_rows_log_event anno(thd);
3241+ /* Annotate event should be written not more than once */
3242+ *with_annotate= FALSE;
3243+ if (anno.write(file))
3244+ goto err;
3245+ }
3246+
3247 /*
3248 Write the SQL command
3249 */
3250
3251=== modified file 'Percona-Server/sql/log.h'
3252--- Percona-Server/sql/log.h 2011-11-24 01:59:48 +0000
3253+++ Percona-Server/sql/log.h 2012-03-29 03:25:47 +0000
3254@@ -359,7 +359,7 @@
3255 int new_file();
3256
3257 void reset_gathered_updates(THD *thd);
3258- bool write(Log_event* event_info); // binary log write
3259+ bool write(Log_event *event_info, my_bool *with_annotate= FALSE); // binary log write
3260 bool write(THD *thd, IO_CACHE *cache, Log_event *commit_event, bool incident);
3261
3262 bool write_incident(THD *thd, bool lock);
3263
3264=== modified file 'Percona-Server/sql/log_event.cc'
3265--- Percona-Server/sql/log_event.cc 2012-02-09 15:03:59 +0000
3266+++ Percona-Server/sql/log_event.cc 2012-03-29 03:25:47 +0000
3267@@ -656,6 +656,7 @@
3268 case BEGIN_LOAD_QUERY_EVENT: return "Begin_load_query";
3269 case EXECUTE_LOAD_QUERY_EVENT: return "Execute_load_query";
3270 case INCIDENT_EVENT: return "Incident";
3271+ case ANNOTATE_ROWS_EVENT: return "Annotate_rows";
3272 default: return "Unknown"; /* impossible */
3273 }
3274 }
3275@@ -735,7 +736,7 @@
3276 logs are in 4.0 format, until it finds a Format_desc).
3277 */
3278 if (description_event->binlog_version==3 &&
3279- buf[EVENT_TYPE_OFFSET]<FORMAT_DESCRIPTION_EVENT && log_pos)
3280+ (uchar)buf[EVENT_TYPE_OFFSET] < FORMAT_DESCRIPTION_EVENT && log_pos)
3281 {
3282 /*
3283 If log_pos=0, don't change it. log_pos==0 is a marker to mean
3284@@ -753,8 +754,8 @@
3285 DBUG_PRINT("info", ("log_pos: %lu", (ulong) log_pos));
3286
3287 flags= uint2korr(buf + FLAGS_OFFSET);
3288- if ((buf[EVENT_TYPE_OFFSET] == FORMAT_DESCRIPTION_EVENT) ||
3289- (buf[EVENT_TYPE_OFFSET] == ROTATE_EVENT))
3290+ if (((uchar)buf[EVENT_TYPE_OFFSET] == FORMAT_DESCRIPTION_EVENT) ||
3291+ ((uchar)buf[EVENT_TYPE_OFFSET] == ROTATE_EVENT))
3292 {
3293 /*
3294 These events always have a header which stops here (i.e. their
3295@@ -1176,14 +1177,14 @@
3296
3297 /* Check the integrity */
3298 if (event_len < EVENT_LEN_OFFSET ||
3299- buf[EVENT_TYPE_OFFSET] >= ENUM_END_EVENT ||
3300+ (uchar)buf[EVENT_TYPE_OFFSET] >= ENUM_END_EVENT ||
3301 (uint) event_len != uint4korr(buf+EVENT_LEN_OFFSET))
3302 {
3303 *error="Sanity check failed"; // Needed to free buffer
3304 DBUG_RETURN(NULL); // general sanity check - will fail on a partial read
3305 }
3306
3307- uint event_type= buf[EVENT_TYPE_OFFSET];
3308+ uint event_type= (uchar)buf[EVENT_TYPE_OFFSET];
3309 if (event_type > description_event->number_of_event_types &&
3310 event_type != FORMAT_DESCRIPTION_EVENT)
3311 {
3312@@ -1305,6 +1306,9 @@
3313 case INCIDENT_EVENT:
3314 ev = new Incident_log_event(buf, event_len, description_event);
3315 break;
3316+ case ANNOTATE_ROWS_EVENT:
3317+ ev = new Annotate_rows_log_event(buf, event_len, description_event);
3318+ break;
3319 default:
3320 DBUG_PRINT("error",("Unknown event code: %d",
3321 (int) buf[EVENT_TYPE_OFFSET]));
3322@@ -3851,6 +3855,13 @@
3323 post_header_len[DELETE_ROWS_EVENT-1]= 6;);
3324 post_header_len[INCIDENT_EVENT-1]= INCIDENT_HEADER_LEN;
3325
3326+ // Set header length of the reserved events to 0
3327+ memset(post_header_len + MYSQL_EVENTS_END - 1, 0,
3328+ (MARIA_EVENTS_BEGIN - MYSQL_EVENTS_END)*sizeof(uint8));
3329+
3330+ // Set header lengths of Maria events
3331+ post_header_len[ANNOTATE_ROWS_EVENT-1]= ANNOTATE_ROWS_HEADER_LEN;
3332+
3333 // Sanity-check that all post header lengths are initialized.
3334 IF_DBUG({
3335 int i;
3336@@ -4495,8 +4506,8 @@
3337 */
3338 if (event_len)
3339 copy_log_event(buf, event_len,
3340- ((buf[EVENT_TYPE_OFFSET] == LOAD_EVENT) ?
3341- LOAD_HEADER_LEN +
3342+ (((uchar)buf[EVENT_TYPE_OFFSET] == LOAD_EVENT) ?
3343+ LOAD_HEADER_LEN +
3344 description_event->common_header_len :
3345 LOAD_HEADER_LEN + LOG_EVENT_HEADER_LEN),
3346 description_event);
3347@@ -4533,7 +4544,7 @@
3348 */
3349 if (!(field_lens= (uchar*)sql_ex.init((char*)buf + body_offset,
3350 buf_end,
3351- buf[EVENT_TYPE_OFFSET] != LOAD_EVENT)))
3352+ (uchar)buf[EVENT_TYPE_OFFSET] != LOAD_EVENT)))
3353 DBUG_RETURN(1);
3354
3355 data_len = event_len - body_offset;
3356@@ -6224,7 +6235,7 @@
3357 uint8 create_file_header_len= description_event->post_header_len[CREATE_FILE_EVENT-1];
3358 if (!(event_buf= (char*) my_memdup(buf, len, MYF(MY_WME))) ||
3359 copy_log_event(event_buf,len,
3360- ((buf[EVENT_TYPE_OFFSET] == LOAD_EVENT) ?
3361+ (((uchar)buf[EVENT_TYPE_OFFSET] == LOAD_EVENT) ?
3362 load_header_len + header_len :
3363 (fake_base ? (header_len+load_header_len) :
3364 (header_len+load_header_len) +
3365@@ -7990,6 +8001,137 @@
3366 #endif
3367
3368 /**************************************************************************
3369+ Annotate_rows_log_event member functions
3370+**************************************************************************/
3371+
3372+#ifndef MYSQL_CLIENT
3373+Annotate_rows_log_event::Annotate_rows_log_event(THD *thd)
3374+ : Log_event(thd, 0, true),
3375+ m_query_txt(thd->query()),
3376+ m_query_len(thd->query_length()),
3377+ m_save_thd_query_txt(0),
3378+ m_save_thd_query_len(0) {}
3379+#endif
3380+
3381+Annotate_rows_log_event::Annotate_rows_log_event(const char *buf,
3382+ uint event_len,
3383+ const Format_description_log_event *desc)
3384+ : Log_event(buf, desc),
3385+ m_query_txt((char*) buf + desc->common_header_len),
3386+ m_query_len(event_len - desc->common_header_len),
3387+ m_save_thd_query_txt(0),
3388+ m_save_thd_query_len(0) {}
3389+
3390+Annotate_rows_log_event::~Annotate_rows_log_event()
3391+{
3392+#ifndef MYSQL_CLIENT
3393+ if (m_save_thd_query_txt)
3394+ thd->set_query(m_save_thd_query_txt, m_save_thd_query_len);
3395+#endif
3396+}
3397+
3398+int Annotate_rows_log_event::get_data_size()
3399+{
3400+ return m_query_len;
3401+}
3402+
3403+Log_event_type Annotate_rows_log_event::get_type_code()
3404+{
3405+ return ANNOTATE_ROWS_EVENT;
3406+}
3407+
3408+bool Annotate_rows_log_event::is_valid() const
3409+{
3410+ return (m_query_txt != NULL && m_query_len != 0);
3411+}
3412+
3413+#ifndef MYSQL_CLIENT
3414+bool Annotate_rows_log_event::write_data_header(IO_CACHE *file)
3415+{
3416+ return 0;
3417+}
3418+#endif
3419+
3420+#ifndef MYSQL_CLIENT
3421+bool Annotate_rows_log_event::write_data_body(IO_CACHE *file)
3422+{
3423+ return my_b_safe_write(file, (uchar*) m_query_txt, m_query_len);
3424+}
3425+#endif
3426+
3427+#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
3428+void Annotate_rows_log_event::pack_info(Protocol* protocol)
3429+{
3430+ if (m_query_txt && m_query_len)
3431+ protocol->store(m_query_txt, m_query_len, &my_charset_bin);
3432+}
3433+#endif
3434+
3435+#ifdef MYSQL_CLIENT
3436+void Annotate_rows_log_event::print(FILE *file, PRINT_EVENT_INFO *pinfo)
3437+{
3438+ if (pinfo->short_form)
3439+ return;
3440+
3441+ print_header(&pinfo->head_cache, pinfo, TRUE);
3442+ my_b_printf(&pinfo->head_cache, "\tAnnotate_rows:\n");
3443+
3444+ char *pbeg; // beginning of the next line
3445+ char *pend; // end of the next line
3446+ uint cnt= 0; // characters counter
3447+
3448+ for (pbeg= m_query_txt; ; pbeg= pend)
3449+ {
3450+ // skip all \r's and \n's at the beginning of the next line
3451+ for (;; pbeg++)
3452+ {
3453+ if (++cnt > m_query_len)
3454+ return;
3455+
3456+ if (*pbeg != '\r' && *pbeg != '\n')
3457+ break;
3458+ }
3459+
3460+ // find end of the next line
3461+ for (pend= pbeg + 1;
3462+ ++cnt <= m_query_len && *pend != '\r' && *pend != '\n';
3463+ pend++) {};
3464+
3465+ // print next line
3466+ my_b_write(&pinfo->head_cache, (const uchar*) "#Q> ", 4);
3467+ my_b_write(&pinfo->head_cache, (const uchar*) pbeg, pend - pbeg);
3468+ my_b_write(&pinfo->head_cache, (const uchar*) "\n", 1);
3469+ }
3470+}
3471+#endif
3472+
3473+#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
3474+int Annotate_rows_log_event::do_apply_event(Relay_log_info const *rli)
3475+{
3476+ m_save_thd_query_txt= thd->query();
3477+ m_save_thd_query_len= thd->query_length();
3478+ thd->set_query(m_query_txt, m_query_len);
3479+ return 0;
3480+}
3481+#endif
3482+
3483+#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
3484+int Annotate_rows_log_event::do_update_pos(Relay_log_info *rli)
3485+{
3486+ rli->inc_event_relay_log_pos();
3487+ return 0;
3488+}
3489+#endif
3490+
3491+#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
3492+Log_event::enum_skip_reason
3493+Annotate_rows_log_event::do_shall_skip(Relay_log_info *rli)
3494+{
3495+ return continue_group(rli);
3496+}
3497+#endif
3498+
3499+/**************************************************************************
3500 Table_map_log_event member functions and support functions
3501 **************************************************************************/
3502
3503
3504=== modified file 'Percona-Server/sql/log_event.h'
3505--- Percona-Server/sql/log_event.h 2012-02-09 15:03:59 +0000
3506+++ Percona-Server/sql/log_event.h 2012-03-29 03:25:47 +0000
3507@@ -252,6 +252,7 @@
3508 #define EXECUTE_LOAD_QUERY_EXTRA_HEADER_LEN (4 + 4 + 4 + 1)
3509 #define EXECUTE_LOAD_QUERY_HEADER_LEN (QUERY_HEADER_LEN + EXECUTE_LOAD_QUERY_EXTRA_HEADER_LEN)
3510 #define INCIDENT_HEADER_LEN 2
3511+#define ANNOTATE_ROWS_HEADER_LEN 0
3512 /*
3513 Max number of possible extra bytes in a replication event compared to a
3514 packet (i.e. a query) sent from client to master;
3515@@ -590,8 +591,14 @@
3516 */
3517 INCIDENT_EVENT= 26,
3518
3519+ /* New MySQL/Sun events are to be added right above this comment */
3520+ MYSQL_EVENTS_END,
3521+
3522+ MARIA_EVENTS_BEGIN= 160,
3523+ /* New Maria event numbers start from here */
3524+ ANNOTATE_ROWS_EVENT= 160,
3525+
3526 /*
3527- Add new events here - right above this comment!
3528 Existing events (except ENUM_END_EVENT) should never change their numbers
3529 */
3530
3531@@ -2996,6 +3003,59 @@
3532 char *str_to_hex(char *to, const char *from, uint len);
3533
3534 /**
3535+ @class Annotate_rows_log_event
3536+
3537+ In row-based mode, if binlog_annotate_rows_events = ON, each group of
3538+ Table_map_log_events is preceded by an Annotate_rows_log_event which
3539+ contains the query which caused the subsequent rows operations.
3540+
3541+ The Annotate_rows_log_event has no post-header and its body contains
3542+ the corresponding query (without trailing zero). Note. The query length
3543+ is to be calculated as a difference between the whole event length and
3544+ the common header length.
3545+*/
3546+class Annotate_rows_log_event: public Log_event
3547+{
3548+public:
3549+#ifndef MYSQL_CLIENT
3550+ Annotate_rows_log_event(THD*);
3551+#endif
3552+ Annotate_rows_log_event(const char *buf, uint event_len,
3553+ const Format_description_log_event*);
3554+ ~Annotate_rows_log_event();
3555+
3556+ virtual int get_data_size();
3557+ virtual Log_event_type get_type_code();
3558+ virtual bool is_valid() const;
3559+
3560+#ifndef MYSQL_CLIENT
3561+ virtual bool write_data_header(IO_CACHE*);
3562+ virtual bool write_data_body(IO_CACHE*);
3563+#endif
3564+
3565+#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
3566+ virtual void pack_info(Protocol*);
3567+#endif
3568+
3569+#ifdef MYSQL_CLIENT
3570+ virtual void print(FILE*, PRINT_EVENT_INFO*);
3571+#endif
3572+
3573+#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
3574+private:
3575+ virtual int do_apply_event(Relay_log_info const*);
3576+ virtual int do_update_pos(Relay_log_info*);
3577+ virtual enum_skip_reason do_shall_skip(Relay_log_info*);
3578+#endif
3579+
3580+private:
3581+ char *m_query_txt;
3582+ uint m_query_len;
3583+ char *m_save_thd_query_txt;
3584+ uint m_save_thd_query_len;
3585+};
3586+
3587+/**
3588 @class Table_map_log_event
3589
3590 In row-based mode, every row operation event is preceded by a
3591
3592=== modified file 'Percona-Server/sql/mysql_priv.h'
3593--- Percona-Server/sql/mysql_priv.h 2012-02-09 15:03:59 +0000
3594+++ Percona-Server/sql/mysql_priv.h 2012-03-29 03:25:47 +0000
3595@@ -615,7 +615,11 @@
3596 /* BINLOG_DUMP options */
3597
3598 #define BINLOG_DUMP_NON_BLOCK 1
3599-
3600+#endif /* !MYSQL_CLIENT */
3601+
3602+#define BINLOG_SEND_ANNOTATE_ROWS_EVENT 2
3603+
3604+#ifndef MYSQL_CLIENT
3605 /* sql_show.cc:show_log_files() */
3606 #define SHOW_LOG_STATUS_FREE "FREE"
3607 #define SHOW_LOG_STATUS_INUSE "IN USE"
3608
3609=== modified file 'Percona-Server/sql/mysqld.cc'
3610--- Percona-Server/sql/mysqld.cc 2012-03-16 09:07:44 +0000
3611+++ Percona-Server/sql/mysqld.cc 2012-03-29 03:25:47 +0000
3612@@ -509,6 +509,7 @@
3613 my_bool opt_safe_user_create = 0, opt_no_mix_types = 0;
3614 my_bool opt_show_slave_auth_info, opt_sql_bin_update = 0;
3615 my_bool opt_log_slave_updates= 0;
3616+my_bool opt_replicate_annotate_rows_events= 0;
3617 bool slave_warning_issued = false;
3618
3619 /*
3620@@ -5754,6 +5755,8 @@
3621 OPT_REPLICATE_IGNORE_DB, OPT_LOG_SLAVE_UPDATES,
3622 OPT_BINLOG_DO_DB, OPT_BINLOG_IGNORE_DB,
3623 OPT_BINLOG_FORMAT,
3624+ OPT_BINLOG_ANNOTATE_ROWS_EVENTS,
3625+ OPT_REPLICATE_ANNOTATE_ROWS_EVENTS,
3626 #ifndef DBUG_OFF
3627 OPT_BINLOG_SHOW_XID,
3628 #endif
3629@@ -5997,6 +6000,18 @@
3630 #endif
3631 , &opt_binlog_format, &opt_binlog_format,
3632 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
3633+ {"binlog-annotate-rows-events", OPT_BINLOG_ANNOTATE_ROWS_EVENTS,
3634+ "Tells the master to annotate RBR events with the statement that "
3635+ "caused these events.",
3636+ (uchar**) &global_system_variables.binlog_annotate_rows_events,
3637+ (uchar**) &max_system_variables.binlog_annotate_rows_events,
3638+ 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
3639+ {"replicate-annotate-rows-events", OPT_REPLICATE_ANNOTATE_ROWS_EVENTS,
3640+ "Tells the slave to write annotate rows events recieved from the master "
3641+ "to its own binary log. Sensible only in pair with log-slave-updates option.",
3642+ (uchar**) &opt_replicate_annotate_rows_events,
3643+ (uchar**) &opt_replicate_annotate_rows_events,
3644+ 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
3645 {"binlog-do-db", OPT_BINLOG_DO_DB,
3646 "Tells the master it should log updates for the specified database, "
3647 "and exclude all others not explicitly mentioned.",
3648
3649=== modified file 'Percona-Server/sql/rpl_rli.cc'
3650--- Percona-Server/sql/rpl_rli.cc 2011-06-30 15:37:13 +0000
3651+++ Percona-Server/sql/rpl_rli.cc 2012-03-29 03:25:47 +0000
3652@@ -45,7 +45,8 @@
3653 inited(0), abort_slave(0), slave_running(0), until_condition(UNTIL_NONE),
3654 until_log_pos(0), retried_trans(0),
3655 tables_to_lock(0), tables_to_lock_count(0),
3656- last_event_start_time(0), m_flags(0)
3657+ last_event_start_time(0), m_flags(0),
3658+ m_annotate_event(0)
3659 {
3660 DBUG_ENTER("Relay_log_info::Relay_log_info");
3661
3662@@ -79,6 +80,7 @@
3663 pthread_cond_destroy(&stop_cond);
3664 pthread_cond_destroy(&log_space_cond);
3665 relay_log.cleanup();
3666+ free_annotate_event();
3667 DBUG_VOID_RETURN;
3668 }
3669
3670
3671=== modified file 'Percona-Server/sql/rpl_rli.h'
3672--- Percona-Server/sql/rpl_rli.h 2011-08-26 09:57:29 +0000
3673+++ Percona-Server/sql/rpl_rli.h 2012-03-29 03:25:47 +0000
3674@@ -431,8 +431,46 @@
3675 (m_flags & (1UL << IN_STMT));
3676 }
3677
3678+ /**
3679+ Save pointer to Annotate_rows event and switch on the
3680+ binlog_annotate_rows_events for this sql thread.
3681+ To be called when sql thread recieves an Annotate_rows event.
3682+ */
3683+ inline void set_annotate_event(Annotate_rows_log_event *event)
3684+ {
3685+ free_annotate_event();
3686+ m_annotate_event= event;
3687+ sql_thd->variables.binlog_annotate_rows_events= 1;
3688+ }
3689+
3690+ /**
3691+ Returns pointer to the saved Annotate_rows event or NULL if there is
3692+ no saved event.
3693+ */
3694+ inline Annotate_rows_log_event* get_annotate_event()
3695+ {
3696+ return m_annotate_event;
3697+ }
3698+
3699+ /**
3700+ Delete saved Annotate_rows event (if any) and switch off the
3701+ binlog_annotate_rows_events for this sql thread.
3702+ To be called when sql thread has applied the last (i.e. with
3703+ STMT_END_F flag) rbr event.
3704+ */
3705+ inline void free_annotate_event()
3706+ {
3707+ if (m_annotate_event)
3708+ {
3709+ sql_thd->variables.binlog_annotate_rows_events= 0;
3710+ delete m_annotate_event;
3711+ m_annotate_event= 0;
3712+ }
3713+ }
3714+
3715 private:
3716 uint32 m_flags;
3717+ Annotate_rows_log_event *m_annotate_event;
3718 };
3719
3720
3721
3722=== modified file 'Percona-Server/sql/set_var.cc'
3723--- Percona-Server/sql/set_var.cc 2012-01-30 04:30:33 +0000
3724+++ Percona-Server/sql/set_var.cc 2012-03-29 03:25:47 +0000
3725@@ -250,6 +250,9 @@
3726 OPT_GLOBAL, SHOW_LONG,
3727 (uchar*) &back_log);
3728 static sys_var_const_os_str sys_basedir(&vars, "basedir", mysql_home);
3729+static sys_var_thd_bool
3730+sys_binlog_annotate_rows_events(&vars, "binlog_annotate_rows_events",
3731+ &SV::binlog_annotate_rows_events);
3732 static sys_var_long_ptr sys_binlog_cache_size(&vars, "binlog_cache_size",
3733 &binlog_cache_size);
3734 static sys_var_thd_binlog_format sys_binlog_format(&vars, "binlog_format",
3735
3736=== modified file 'Percona-Server/sql/slave.cc'
3737--- Percona-Server/sql/slave.cc 2011-11-24 16:33:30 +0000
3738+++ Percona-Server/sql/slave.cc 2012-03-29 03:25:47 +0000
3739@@ -1921,6 +1921,9 @@
3740
3741 *suppress_warnings= FALSE;
3742
3743+ if (opt_log_slave_updates && opt_replicate_annotate_rows_events)
3744+ binlog_flags|= BINLOG_SEND_ANNOTATE_ROWS_EVENT;
3745+
3746 // TODO if big log files: Change next to int8store()
3747 int4store(buf, (ulong) mi->master_log_pos);
3748 int2store(buf + 4, binlog_flags);
3749@@ -2315,15 +2318,39 @@
3750 }
3751 exec_res= apply_event_and_update_pos(ev, thd, rli);
3752
3753- /*
3754- Format_description_log_event should not be deleted because it will be
3755- used to read info about the relay log's format; it will be deleted when
3756- the SQL thread does not need it, i.e. when this thread terminates.
3757- */
3758- if (ev->get_type_code() != FORMAT_DESCRIPTION_EVENT)
3759+ switch (ev->get_type_code())
3760 {
3761- DBUG_PRINT("info", ("Deleting the event after it has been executed"));
3762- delete ev;
3763+ case FORMAT_DESCRIPTION_EVENT:
3764+ /*
3765+ Format_description_log_event should not be deleted because it
3766+ will be used to read info about the relay log's format;
3767+ it will be deleted when the SQL thread does not need it,
3768+ i.e. when this thread terminates.
3769+ */
3770+ break;
3771+ case ANNOTATE_ROWS_EVENT:
3772+ /*
3773+ Annotate_rows event should not be deleted because after it has
3774+ been applied, thd->query points to the string inside this event.
3775+ The thd->query will be used to generate new Annotate_rows event
3776+ during applying the subsequent Rows events.
3777+ */
3778+ rli->set_annotate_event((Annotate_rows_log_event*) ev);
3779+ break;
3780+ case DELETE_ROWS_EVENT:
3781+ case UPDATE_ROWS_EVENT:
3782+ case WRITE_ROWS_EVENT:
3783+ /*
3784+ After the last Rows event has been applied, the saved Annotate_rows
3785+ event (if any) is not needed anymore and can be deleted.
3786+ */
3787+ if (((Rows_log_event*)ev)->get_flags(Rows_log_event::STMT_END_F))
3788+ rli->free_annotate_event();
3789+ /* fall through */
3790+ default:
3791+ DBUG_PRINT("info", ("Deleting the event after it has been executed"));
3792+ delete ev;
3793+ break;
3794 }
3795
3796 /*
3797@@ -2952,6 +2979,12 @@
3798 thd->init_for_queries();
3799 thd->temporary_tables = rli->save_temporary_tables; // restore temp tables
3800 set_thd_in_use_temporary_tables(rli); // (re)set sql_thd in use for saved temp tables
3801+ /*
3802+ binlog_annotate_rows_events must be TRUE only after an Annotate_rows event
3803+ has been recieved and only till the last corresponding rbr event has been
3804+ applied. In all other cases it must be FALSE.
3805+ */
3806+ thd->variables.binlog_annotate_rows_events= 0;
3807 pthread_mutex_lock(&LOCK_thread_count);
3808 threads.append(thd);
3809 pthread_mutex_unlock(&LOCK_thread_count);
3810@@ -3434,7 +3467,7 @@
3811 If we get Load event, we need to pass a non-reusable buffer
3812 to read_log_event, so we do a trick
3813 */
3814- if (buf[EVENT_TYPE_OFFSET] == LOAD_EVENT)
3815+ if ((uchar)buf[EVENT_TYPE_OFFSET] == LOAD_EVENT)
3816 {
3817 if (unlikely(!(tmp_buf=(char*)my_malloc(event_len+1,MYF(MY_WME)))))
3818 {
3819@@ -3634,6 +3667,7 @@
3820 {
3821 int error= 0;
3822 ulong inc_pos;
3823+ ulong new_pos;
3824 Relay_log_info *rli= &mi->rli;
3825 pthread_mutex_t *log_lock= rli->relay_log.get_log_lock();
3826 DBUG_ENTER("queue_event");
3827@@ -3641,13 +3675,16 @@
3828 LINT_INIT(inc_pos);
3829
3830 if (mi->rli.relay_log.description_event_for_queue->binlog_version<4 &&
3831- buf[EVENT_TYPE_OFFSET] != FORMAT_DESCRIPTION_EVENT /* a way to escape */)
3832+ (uchar)buf[EVENT_TYPE_OFFSET] != FORMAT_DESCRIPTION_EVENT /* a way to escape */)
3833 DBUG_RETURN(queue_old_event(mi,buf,event_len));
3834
3835 LINT_INIT(inc_pos);
3836 pthread_mutex_lock(&mi->data_lock);
3837
3838- switch (buf[EVENT_TYPE_OFFSET]) {
3839+ new_pos= uint4korr(buf+LOG_POS_OFFSET);
3840+
3841+ switch ((uchar)buf[EVENT_TYPE_OFFSET])
3842+ {
3843 case STOP_EVENT:
3844 /*
3845 We needn't write this event to the relay log. Indeed, it just indicates a
3846@@ -3675,6 +3712,7 @@
3847 incrementing mi->master_log_pos is nonsense.
3848 */
3849 inc_pos= 0;
3850+ new_pos= 0;
3851 break;
3852 }
3853 case FORMAT_DESCRIPTION_EVENT:
3854@@ -3750,11 +3788,14 @@
3855 the master's binlog (i.e. Format_desc, Rotate & Stop) should not increment
3856 mi->master_log_pos.
3857 */
3858- if (buf[EVENT_TYPE_OFFSET]!=FORMAT_DESCRIPTION_EVENT &&
3859- buf[EVENT_TYPE_OFFSET]!=ROTATE_EVENT &&
3860- buf[EVENT_TYPE_OFFSET]!=STOP_EVENT)
3861+ if ((uchar)buf[EVENT_TYPE_OFFSET]!=FORMAT_DESCRIPTION_EVENT &&
3862+ (uchar)buf[EVENT_TYPE_OFFSET]!=ROTATE_EVENT &&
3863+ (uchar)buf[EVENT_TYPE_OFFSET]!=STOP_EVENT)
3864 {
3865- mi->master_log_pos+= inc_pos;
3866+ if (new_pos > 0)
3867+ mi->master_log_pos= new_pos;
3868+ else
3869+ mi->master_log_pos+= inc_pos;
3870 memcpy(rli->ign_master_log_name_end, mi->master_log_name, FN_REFLEN);
3871 DBUG_ASSERT(rli->ign_master_log_name_end[0]);
3872 rli->ign_master_log_pos_end= mi->master_log_pos;
3873@@ -3768,7 +3809,10 @@
3874 /* write the event to the relay log */
3875 if (likely(!(rli->relay_log.appendv(buf,event_len,0))))
3876 {
3877- mi->master_log_pos+= inc_pos;
3878+ if (new_pos > 0)
3879+ mi->master_log_pos= new_pos;
3880+ else
3881+ mi->master_log_pos+= inc_pos;
3882 DBUG_PRINT("info", ("master_log_pos: %lu", (ulong) mi->master_log_pos));
3883 rli->relay_log.harvest_bytes_written(&rli->log_space_total);
3884 }
3885
3886=== modified file 'Percona-Server/sql/slave.h'
3887--- Percona-Server/sql/slave.h 2011-06-30 15:37:13 +0000
3888+++ Percona-Server/sql/slave.h 2012-03-29 03:25:47 +0000
3889@@ -107,6 +107,7 @@
3890 extern char *opt_relay_logname, *opt_relaylog_index_name;
3891 extern my_bool opt_skip_slave_start, opt_reckless_slave;
3892 extern my_bool opt_log_slave_updates;
3893+extern my_bool opt_replicate_annotate_rows_events;
3894 extern ulonglong relay_log_space_limit;
3895
3896 /*
3897
3898=== modified file 'Percona-Server/sql/sql_binlog.cc'
3899--- Percona-Server/sql/sql_binlog.cc 2011-07-03 15:47:37 +0000
3900+++ Percona-Server/sql/sql_binlog.cc 2012-03-29 03:25:47 +0000
3901@@ -176,7 +176,7 @@
3902 */
3903 if (!have_fd_event)
3904 {
3905- int type = bufptr[EVENT_TYPE_OFFSET];
3906+ int type= (uchar)bufptr[EVENT_TYPE_OFFSET];
3907 if (type == FORMAT_DESCRIPTION_EVENT || type == START_EVENT_V3)
3908 have_fd_event= TRUE;
3909 else
3910
3911=== modified file 'Percona-Server/sql/sql_class.h'
3912--- Percona-Server/sql/sql_class.h 2012-01-30 04:30:33 +0000
3913+++ Percona-Server/sql/sql_class.h 2012-03-29 03:25:47 +0000
3914@@ -360,6 +360,7 @@
3915 ulong ndb_index_stat_cache_entries;
3916 ulong ndb_index_stat_update_freq;
3917 ulong binlog_format; // binlog format for this thd (see enum_binlog_format)
3918+ my_bool binlog_annotate_rows_events;
3919 my_bool binlog_direct_non_trans_update;
3920 /*
3921 In slave thread we need to know in behalf of which
3922@@ -1567,7 +1568,8 @@
3923 */
3924 void binlog_start_trans_and_stmt();
3925 void binlog_set_stmt_begin();
3926- int binlog_write_table_map(TABLE *table, bool is_transactional);
3927+ int binlog_write_table_map(TABLE *table, bool is_transactional,
3928+ my_bool *with_annotate= 0);
3929 int binlog_write_row(TABLE* table, bool is_transactional,
3930 MY_BITMAP const* cols, size_t colcnt,
3931 const uchar *buf);
3932
3933=== modified file 'Percona-Server/sql/sql_insert.cc'
3934--- Percona-Server/sql/sql_insert.cc 2012-02-07 03:25:46 +0000
3935+++ Percona-Server/sql/sql_insert.cc 2012-03-29 03:25:47 +0000
3936@@ -1947,6 +1947,11 @@
3937 pthread_mutex_lock(&LOCK_thread_count);
3938 thread_count++;
3939 pthread_mutex_unlock(&LOCK_thread_count);
3940+ /*
3941+ Annotating delayed inserts is not supported.
3942+ */
3943+ di->thd.variables.binlog_annotate_rows_events= 0;
3944+
3945 di->thd.set_db(table_list->db, (uint) strlen(table_list->db));
3946 di->thd.set_query(my_strdup(table_list->table_name, MYF(MY_WME)), 0);
3947 if (di->thd.db == NULL || di->thd.query() == NULL)
3948
3949=== modified file 'Percona-Server/sql/sql_repl.cc'
3950--- Percona-Server/sql/sql_repl.cc 2011-06-30 15:37:13 +0000
3951+++ Percona-Server/sql/sql_repl.cc 2012-03-29 03:25:47 +0000
3952@@ -492,7 +492,7 @@
3953 DBUG_PRINT("info",
3954 ("Looked for a Format_description_log_event, found event type %d",
3955 (*packet)[EVENT_TYPE_OFFSET+1]));
3956- if ((*packet)[EVENT_TYPE_OFFSET+1] == FORMAT_DESCRIPTION_EVENT)
3957+ if ((uchar)(*packet)[EVENT_TYPE_OFFSET+1] == FORMAT_DESCRIPTION_EVENT)
3958 {
3959 binlog_can_be_corrupted= test((*packet)[FLAGS_OFFSET+1] &
3960 LOG_EVENT_BINLOG_IN_USE_F);
3961@@ -575,40 +575,44 @@
3962 }
3963 });
3964
3965- if ((*packet)[EVENT_TYPE_OFFSET+1] == FORMAT_DESCRIPTION_EVENT)
3966+ if ((uchar)(*packet)[EVENT_TYPE_OFFSET+1] == FORMAT_DESCRIPTION_EVENT)
3967 {
3968 binlog_can_be_corrupted= test((*packet)[FLAGS_OFFSET+1] &
3969 LOG_EVENT_BINLOG_IN_USE_F);
3970 (*packet)[FLAGS_OFFSET+1] &= ~LOG_EVENT_BINLOG_IN_USE_F;
3971 }
3972- else if ((*packet)[EVENT_TYPE_OFFSET+1] == STOP_EVENT)
3973+ else if ((uchar)(*packet)[EVENT_TYPE_OFFSET+1] == STOP_EVENT)
3974 binlog_can_be_corrupted= FALSE;
3975
3976- if (my_net_write(net, (uchar*) packet->ptr(), packet->length()))
3977+ if ((uchar)(*packet)[EVENT_TYPE_OFFSET+1] != ANNOTATE_ROWS_EVENT ||
3978+ (flags & BINLOG_SEND_ANNOTATE_ROWS_EVENT))
3979 {
3980- errmsg = "Failed on my_net_write()";
3981- my_errno= ER_UNKNOWN_ERROR;
3982- goto err;
3983- }
3984+ if (my_net_write(net, (uchar*) packet->ptr(), packet->length()))
3985+ {
3986+ errmsg= "Failed on my_net_write()";
3987+ my_errno= ER_UNKNOWN_ERROR;
3988+ goto err;
3989+ }
3990
3991- DBUG_EXECUTE_IF("dump_thread_wait_before_send_xid",
3992- {
3993- if ((*packet)[EVENT_TYPE_OFFSET+1] == XID_EVENT)
3994+ DBUG_EXECUTE_IF("dump_thread_wait_before_send_xid",
3995 {
3996- net_flush(net);
3997- }
3998- });
3999+ if ((*packet)[EVENT_TYPE_OFFSET+1] == XID_EVENT)
4000+ {
4001+ net_flush(net);
4002+ }
4003+ });
4004
4005- DBUG_PRINT("info", ("log event code %d",
4006- (*packet)[LOG_EVENT_OFFSET+1] ));
4007- if ((*packet)[LOG_EVENT_OFFSET+1] == LOAD_EVENT)
4008- {
4009- if (send_file(thd))
4010- {
4011- errmsg = "failed in send_file()";
4012- my_errno= ER_UNKNOWN_ERROR;
4013- goto err;
4014- }
4015+ DBUG_PRINT("info", ("log event code %d",
4016+ (*packet)[LOG_EVENT_OFFSET+1]));
4017+ if ((uchar)(*packet)[LOG_EVENT_OFFSET+1] == LOAD_EVENT)
4018+ {
4019+ if (send_file(thd))
4020+ {
4021+ errmsg= "failed in send_file()";
4022+ my_errno= ER_UNKNOWN_ERROR;
4023+ goto err;
4024+ }
4025+ }
4026 }
4027 packet->set("\0", 1, &my_charset_bin);
4028 }
4029@@ -709,23 +713,27 @@
4030
4031 if (read_packet)
4032 {
4033- thd_proc_info(thd, "Sending binlog event to slave");
4034- if (my_net_write(net, (uchar*) packet->ptr(), packet->length()) )
4035- {
4036- errmsg = "Failed on my_net_write()";
4037- my_errno= ER_UNKNOWN_ERROR;
4038- goto err;
4039- }
4040-
4041- if ((*packet)[LOG_EVENT_OFFSET+1] == LOAD_EVENT)
4042- {
4043- if (send_file(thd))
4044+ if ((uchar)(*packet)[EVENT_TYPE_OFFSET+1] != ANNOTATE_ROWS_EVENT ||
4045+ (flags & BINLOG_SEND_ANNOTATE_ROWS_EVENT))
4046+ {
4047+ thd_proc_info(thd, "Sending binlog event to slave");
4048+ if (my_net_write(net, (uchar*) packet->ptr(), packet->length()) )
4049 {
4050- errmsg = "failed in send_file()";
4051+ errmsg = "Failed on my_net_write()";
4052 my_errno= ER_UNKNOWN_ERROR;
4053 goto err;
4054 }
4055- }
4056+
4057+ if ((uchar)(*packet)[LOG_EVENT_OFFSET+1] == LOAD_EVENT)
4058+ {
4059+ if (send_file(thd))
4060+ {
4061+ errmsg = "failed in send_file()";
4062+ my_errno= ER_UNKNOWN_ERROR;
4063+ goto err;
4064+ }
4065+ }
4066+ }
4067 packet->set("\0", 1, &my_charset_bin);
4068 /*
4069 No need to net_flush because we will get to flush later when
4070@@ -1806,6 +1814,11 @@
4071 static sys_var_const sys_log_slave_updates(&vars, "log_slave_updates",
4072 OPT_GLOBAL, SHOW_MY_BOOL,
4073 (uchar*) &opt_log_slave_updates);
4074+static sys_var_const
4075+sys_replicate_annotate_rows_events(&vars,
4076+ "replicate_annotate_rows_events",
4077+ OPT_GLOBAL, SHOW_MY_BOOL,
4078+ (uchar*) &opt_replicate_annotate_rows_events);
4079 static sys_var_const sys_relay_log(&vars, "relay_log",
4080 OPT_GLOBAL, SHOW_CHAR_PTR,
4081 (uchar*) &opt_relay_logname);
4082
4083=== added file 'doc/source/flexibility/annotate_rows_log_event.rst'
4084--- doc/source/flexibility/annotate_rows_log_event.rst 1970-01-01 00:00:00 +0000
4085+++ doc/source/flexibility/annotate_rows_log_event.rst 2012-03-29 03:25:47 +0000
4086@@ -0,0 +1,70 @@
4087+.. _annotate_rows_log_event:
4088+
4089+=========================
4090+Annotate rows log events
4091+=========================
4092+
4093+Store in binlog (and show in mysqlbinlog output) texts of statements that
4094+caused RBR events
4095+
4096+This is needed for (list from Monty):
4097+ * Easier to understand why updates happened
4098+ * Would make it easier to find out where in application things went
4099+ wrong (as you can search for exact strings)
4100+ * Allow one to filter things based on comments in the statement.
4101+
4102+The cost of this can be that the binlog will be approximately 2x in size
4103+(especially insert of big blob's would be a bit painful), so this should
4104+be an optional feature.
4105+
4106+Varible :variable:`skip-annotate-rows-events` of **mysqlbinlog** utility allows to do not print *Annotate Rows Events*.
4107+
4108+Variable :variable:`binlog-annotate-rows-events` of **mysqld** tells the master to annotate RBR events with the statement that caused these events.
4109+
4110+Variable :variable:`replicate-annotate-rows-events` of **mysqld** tells the slave to write annotate rows events recieved from the master to its own binary log. Sensible only in pair with log-slave-updates option..
4111+
4112+
4113+Version Specific Information
4114+============================
4115+
4116+ * 5.1.62-12.1
4117+ Full functionality.
4118+
4119+Client Command Line Parameter
4120+=============================
4121+
4122+.. variable:: skip-annotate-rows-events
4123+
4124+ :cli: Yes
4125+ :conf: Yes
4126+ :scope: Global
4127+ :dyn: No
4128+ :vartype: Boolean
4129+ :default: On
4130+
4131+System variables
4132+================
4133+
4134+.. variable:: binlog-annotate-rows-events
4135+
4136+ :cli: Yes
4137+ :conf: Yes
4138+ :scope: Global
4139+ :dyn: Yes
4140+ :vartype: Boolean
4141+ :default: Off
4142+
4143+.. variable:: replicate-annotate-rows-events
4144+
4145+ :cli: Yes
4146+ :conf: Yes
4147+ :scope: Global
4148+ :dyn: Yes
4149+ :vartype: Boolean
4150+ :default: Off
4151+
4152+Related Reading
4153+===============
4154+
4155+ * `MariaDB WL #47 <http://askmonty.org/worklog/Server-Sprint/?tid=47>`_
4156+
4157
4158=== modified file 'doc/source/index.rst'
4159--- doc/source/index.rst 2012-03-16 09:07:44 +0000
4160+++ doc/source/index.rst 2012-03-29 03:25:47 +0000
4161@@ -89,7 +89,12 @@
4162 flexibility/innodb_files_extend
4163 flexibility/log_warnings_suppress
4164 flexibility/mysql_remove_eol_carret
4165- flexibility/mysqlbinlog_change_db
4166+<<<<<<< TREE
4167+ flexibility/mysqlbinlog_change_db
4168+=======
4169+ flexibility/mysqlbinlog_change_db
4170+ flexibility/annotate_rows_log_event
4171+>>>>>>> MERGE-SOURCE
4172 flexibility/replication_skip_single_statement
4173 flexibility/buff_read_ahead_area
4174 flexibility/innodb_fast_shutdown
4175
4176=== modified file 'doc/source/scalability/innodb_io.rst'
4177--- doc/source/scalability/innodb_io.rst 2012-03-09 08:03:43 +0000
4178+++ doc/source/scalability/innodb_io.rst 2012-03-29 03:25:47 +0000
4179@@ -36,7 +36,11 @@
4180
4181 .. variable:: innodb_adaptive_checkpoint
4182
4183+<<<<<<< TREE
4184 :version: 5.1.54-12.5 Added
4185+=======
4186+ :version 5.1.54-12.5 Added
4187+>>>>>>> MERGE-SOURCE
4188 :cli: Yes
4189 :conf: Yes
4190 :scope: Global
4191@@ -109,7 +113,11 @@
4192
4193 .. variable:: innodb_flush_log_at_trx_commit_session
4194
4195+<<<<<<< TREE
4196 :version: 5.1.49-13 Added
4197+=======
4198+ :version 5.1.49-13 Added
4199+>>>>>>> MERGE-SOURCE
4200 :cli: Yes
4201 :conf: Yes
4202 :scope: Global

Subscribers

People subscribed via source and target branches