~percona-dev/percona-server/release-5.1.52-12-rnt

132.1.1 by Oleg Tsarev
just add patches and tests from 5.1.49-rnt
1
# name       : mysqlbinlog_fix.patch
2
# introduced : 12
3
# maintainer : Oleg
4
#
5
#!!! notice !!!
6
# Any small change to this file in the main branch
7
# should be done or reviewed by the maintainer!
8
diff -Nur a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc
9
--- a/client/mysqlbinlog.cc	2010-08-08 11:58:55.458112142 +0400
10
+++ b/client/mysqlbinlog.cc	2010-08-08 12:31:03.858088787 +0400
11
@@ -730,9 +730,17 @@
12
 
13
     switch (ev_type) {
14
     case QUERY_EVENT:
15
-      if (!((Query_log_event*)ev)->is_trans_keyword() &&
16
-          shall_skip_database(((Query_log_event*)ev)->db))
17
-        goto end;
18
+      if (!((Query_log_event*)ev)->is_trans_keyword())
19
+      {
20
+        if (shall_skip_database(((Query_log_event*)ev)->db))
21
+          goto end;
22
+      }
23
+      else
24
+      {
25
+        // In case the event for one of these statements is obtained
26
+        // from binary log 5.0, make it compatible with 5.1
27
+        ev->flags|= LOG_EVENT_SUPPRESS_USE_F;
28
+      }
29
       if (opt_base64_output_mode == BASE64_OUTPUT_ALWAYS)
30
       {
31
         if ((retval= write_event_header_and_base64(ev, result_file,
32
@@ -1382,6 +1390,10 @@
33
 */
34
 static Exit_status safe_connect()
35
 {
36
+  /* Close and old connections to MySQL */
37
+  if (mysql)
38
+    mysql_close(mysql);
39
+
40
   mysql= mysql_init(NULL);
41
 
42
   if (!mysql)