List:Commits« Previous MessageNext Message »
From:Alfranio Correia Date:May 5 2010 7:38am
Subject:bzr push into mysql-5.1-rep+3 branch (alfranio.correia:3140 to 3141)
WL#5125
View as plain text  
 3141 Alfranio Correia	2010-05-05
      Post-merge fix for WL#5125.
      
      The variable "cursor" was incremented in different places:
      rpl_info_file.cc and rpl_info_handler.cc. We removed the
      increment from rpl_info_file.cc and kept it in the
      rpl_info_handler.cc.

    modified:
      sql/rpl_info_file.cc
 3140 Alfranio Correia	2010-04-29
      Post-merge fix for WL#5125.
      
      Updated the copyright information.

    modified:
      sql/rpl_info.h
      sql/rpl_info_factory.h
      sql/rpl_info_file.h
      sql/rpl_info_handler.h
      sql/rpl_mi.h
      sql/rpl_rli.h
      sql/slave.h
      sql/sql_repl.h
=== modified file 'sql/rpl_info_file.cc'
--- a/sql/rpl_info_file.cc	2010-04-28 14:47:32 +0000
+++ b/sql/rpl_info_file.cc	2010-05-05 00:34:48 +0000
@@ -171,29 +171,24 @@ int Rpl_info_file::do_reset_info()
 
 bool Rpl_info_file::do_set_info(const int pos, const char *value)
 {
-  bool error= FALSE;
-  if (pos >= ninfo && pos != cursor && !prv_error)
+  if (pos >= ninfo || pos != cursor || prv_error)
     return TRUE;
-  if (!(error= 
-      (my_b_printf(&info_file, "%s\n", value) > (size_t) 0 ? FALSE : TRUE)))
-    cursor++;
-  return error;
+  
+  return (my_b_printf(&info_file, "%s\n", value) > (size_t) 0 ?
+          FALSE : TRUE);
 }
 
 bool Rpl_info_file::do_set_info(const int pos, const int value)
 {
-  bool error= FALSE;
   if (pos >= ninfo || pos != cursor || prv_error)
     return TRUE;
-  if (!(error= 
-      (my_b_printf(&info_file, "%d\n", value) > (size_t) 0 ? FALSE : TRUE)))
-    cursor++;
-  return error;
+ 
+  return (my_b_printf(&info_file, "%d\n", value) > (size_t) 0 ?
+          FALSE : TRUE);
 }
 
 bool Rpl_info_file::do_set_info(const int pos, const float value)
 {
-  bool error= FALSE;
   /* This is enough to handle the float conversion */
   char buffer[sizeof(value) * 4];
 
@@ -202,15 +197,12 @@ bool Rpl_info_file::do_set_info(const in
 
   my_sprintf(buffer, (buffer, "%.3f", value));
 
-  if (!(error=
-      (my_b_printf(&info_file, "%s\n", buffer) > (size_t) 0 ? FALSE : TRUE)))
-    cursor++;
-  return error;
+  return (my_b_printf(&info_file, "%s\n", buffer) > (size_t) 0 ?
+          FALSE : TRUE);
 }
 
 bool Rpl_info_file::do_set_info(const int pos, const my_off_t value)
 {
-  bool error= FALSE;
   /* This is enough to handle the my_off_t conversion */
   char buffer[22];
 
@@ -219,20 +211,17 @@ bool Rpl_info_file::do_set_info(const in
 
   llstr(value, buffer);
 
-  if (!(error= 
-      (my_b_printf(&info_file, "%s\n", buffer) > (size_t) 0 ? FALSE : TRUE)))
-    cursor++;
-  return error;
+  return (my_b_printf(&info_file, "%s\n", buffer) > (size_t) 0 ?
+          FALSE : TRUE);
 }
 
 bool Rpl_info_file::do_set_info(const int pos, const Server_ids *value)
 {
-  bool error;
+  bool error= TRUE;
 
   if (pos >= ninfo || pos != cursor || prv_error)
     return TRUE;
 
-  error= prv_error = TRUE;
   /*
     produce a line listing the total number and all the server_ids
   */
@@ -240,9 +229,8 @@ bool Rpl_info_file::do_set_info(const in
 
   if (server_ids_buffer)
   {
-    if (!(error= (my_b_printf(&info_file, "%s\n", server_ids_buffer) >
-                 (size_t) 0 ? FALSE : TRUE)))
-      cursor++;
+    error= (my_b_printf(&info_file, "%s\n", server_ids_buffer) >
+            (size_t) 0 ? FALSE : TRUE);
     my_free((void *)const_cast<const char*>(server_ids_buffer), MYF(0));
   }
 
@@ -252,48 +240,41 @@ bool Rpl_info_file::do_set_info(const in
 bool Rpl_info_file::do_get_info(const int pos, char *value, const size_t size,
                                 const char *default_value)
 {
-  bool error= FALSE;
   if (pos >= ninfo || pos != cursor || prv_error)
     return TRUE;
-  if (!(error= 
-      init_strvar_from_file(value, size, &info_file, default_value)))
-    cursor++;
-  return error;
+      
+  return (init_strvar_from_file(value, size, &info_file,
+                                default_value));
 }
 
 bool Rpl_info_file::do_get_info(const int pos, int *value,
                                 const int default_value)
 {
-  bool error= FALSE;
   if (pos >= ninfo || pos != cursor || prv_error)
     return TRUE;
-  if (!(error= init_intvar_from_file(value, &info_file, default_value)))
-    cursor++;
-  return error;
+
+  return (init_intvar_from_file(value, &info_file, 
+                                default_value));
 }
 
 bool Rpl_info_file::do_get_info(const int pos, float *value,
                                 const float default_value)
 {
-  bool error= FALSE;
   if (pos >= ninfo || pos != cursor || prv_error)
     return TRUE;
-  if (!(error= 
-       init_floatvar_from_file(value, &info_file, default_value)))
-    cursor++;
-  return error;
+
+  return (init_floatvar_from_file(value, &info_file,
+                                  default_value));
 }
 
 bool Rpl_info_file::do_get_info(const int pos, my_off_t *value,
                                 const my_off_t default_value)
 {
-  bool error= FALSE;
   if (pos >= ninfo || pos != cursor || prv_error)
     return TRUE;
-  if (!(error= 
-      init_intvar_from_file((int *)value, &info_file, (int) default_value)))
-    cursor++;
-  return error;
+
+  return (init_intvar_from_file((int *)value, &info_file,
+                                (int) default_value));
 }
 
 bool Rpl_info_file::do_get_info(const int pos, Server_ids *value,
@@ -311,10 +292,7 @@ bool Rpl_info_file::do_get_info(const in
   bool error= init_dynarray_intvar_from_file(buffer, &buffer_act,
                                                        &info_file);
   if (!error)
-  {
     value->unpack_server_ids(buffer_act);
-    cursor++;
-  }
 
   if (buffer != buffer_act)
   {


Attachment: [text/bzr-bundle]
Thread
bzr push into mysql-5.1-rep+3 branch (alfranio.correia:3140 to 3141)WL#5125Alfranio Correia5 May