MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Sergei Golubchik Date:April 10 2007 1:26pm
Subject:bk commit into 5.0 tree (serg:1.2428) BUG#27171
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of serg. When serg does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-04-10 15:26:35+02:00, serg@stripped +1 -0
  Bug#27171 mysqlbinlog produces different output depends from option -R
  a better fix, that works with 4.1 servers which don't send a fake
  Format_description_log_event.

  client/mysqlbinlog.cc@stripped, 2007-04-10 15:26:33+02:00, serg@stripped +17 -12
    Bug#27171 mysqlbinlog produces different output depends from option -R
    a better fix, that works with 4.1 servers which don't send a fake
    Format_description_log_event.

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	serg
# Host:	janus.mylan
# Root:	/usr/home/serg/Abk/mysql-5.0

--- 1.138/client/mysqlbinlog.cc	2007-04-10 15:26:40 +02:00
+++ 1.139/client/mysqlbinlog.cc	2007-04-10 15:26:40 +02:00
@@ -1042,7 +1042,7 @@
   uint logname_len;
   NET* net;
   int error= 0;
-  my_off_t old_off= min(start_position_mot, BIN_LOG_HEADER_SIZE);
+  my_off_t old_off= start_position_mot;
   char fname[FN_REFLEN+1];
   DBUG_ENTER("dump_remote_log_entries");
 
@@ -1160,6 +1160,18 @@
           len= 1; // fake Rotate, so don't increment old_off
         }
       }
+      else if (type == FORMAT_DESCRIPTION_EVENT)
+      {
+        /*
+          This could be an fake Format_description_log_event that server
+          (5.0+) automatically sends to a slave on connect, before sending
+          a first event at the requested position.  If this is the case,
+          don't increment old_off. Real Format_description_log_event always
+          starts from BIN_LOG_HEADER_SIZE position.
+        */
+        if (old_off != BIN_LOG_HEADER_SIZE)
+          len= 1;         // fake event, don't increment old_off
+      }
       if ((error= process_event(print_event_info, ev, old_off)))
       {
 	error= ((error < 0) ? 0 : 1);
@@ -1172,16 +1184,16 @@
       const char *old_fname= le->fname;
       uint old_len= le->fname_len;
       File file;
-      
+
       if ((file= load_processor.prepare_new_file_for_old_format(le,fname)) < 0)
       {
         error= 1;
         goto err;
       }
-      
+
       if ((error= process_event(print_event_info, ev, old_off)))
       {
- 	my_close(file,MYF(MY_WME));
+        my_close(file,MYF(MY_WME));
 	error= ((error < 0) ? 0 : 1);
         goto err;
       }
@@ -1196,15 +1208,8 @@
     /*
       Let's adjust offset for remote log as for local log to produce
       similar text and to have --stop-position to work identically.
-
-      Exception - the server sends Format_description_log_event
-      in the beginning of the dump, and only after it the event from
-      start_position. Let the old_off reflect it.
     */
-    if (old_off < start_position_mot)
-      old_off= start_position_mot;
-    else
-      old_off+= len-1;
+    old_off+= len-1;
   }
 
 err:
Thread
bk commit into 5.0 tree (serg:1.2428) BUG#27171Sergei Golubchik10 Apr