List:Commits« Previous MessageNext Message »
From:Manish Kumar Date:January 10 2012 6:47am
Subject:bzr push into mysql-trunk branch (manish.4.kumar:3715 to 3716) Bug#11746146
View as plain text  
 3716 Manish Kumar	2012-01-10
      BUG#11746146 - 23894: MYSQLBINLOG OUTPUTS SET INSERT_ID=N STATEMENTS UNNECESARILY WITH --DATABA
      
      This is a post-push fix that addresses review comments. In particular, improves coding style 
      and ensures that all memory is freed.
     @ client/mysqlbinlog.cc
        Modified the file with improved coding style.

    modified:
      client/mysqlbinlog.cc
 3715 Sneha Modi	2012-01-10 [merge]
      Bug#11748572:
      
      Merging from mysql-5.5 -> mysql-trunk

    modified:
      mysql-test/collections/default.experimental
      mysql-test/suite/sys_vars/t/disabled.def
=== modified file 'client/mysqlbinlog.cc'
--- a/client/mysqlbinlog.cc	2011-12-14 05:03:54 +0000
+++ b/client/mysqlbinlog.cc	2012-01-10 06:46:14 +0000
@@ -757,21 +757,18 @@ Exit_status process_event(PRINT_EVENT_IN
           !((Query_log_event*) ev)->is_trans_keyword() &&
            shall_skip_database(((Query_log_event*) ev)->db);
            
-      for (uint dynamic_array_index= 0; dynamic_array_index < buff_ev.elements; 
-           dynamic_array_index++)
+      for (uint i= 0; i < buff_ev.elements; i++) 
       {
-        buff_event_info pop_event_array= *dynamic_element(&buff_ev, dynamic_array_index, buff_event_info *);
+        buff_event_info pop_event_array= *dynamic_element(&buff_ev, i, buff_event_info *);
         Log_event *temp_event= pop_event_array.event;
         my_off_t temp_log_pos= pop_event_array.event_pos;
-        (!opt_hexdump) ? print_event_info->hexdump_from= 0 : print_event_info->hexdump_from= temp_log_pos;
-
+        print_event_info->hexdump_from= (opt_hexdump ? temp_log_pos : 0); 
         if (!parent_query_skips)
           temp_event->print(result_file, print_event_info);
         delete temp_event;
       }
       
-      (!opt_hexdump) ? print_event_info->hexdump_from= 0 : print_event_info->hexdump_from= pos;      
-
+      print_event_info->hexdump_from= (opt_hexdump ? pos : 0);
       reset_dynamic(&buff_ev);
 
       if (parent_query_skips)
@@ -1344,6 +1341,14 @@ static void cleanup()
   my_free(host);
   my_free(user);
   my_free(dirname_for_local_load);
+  
+  for (uint i= 0; i < buff_ev.elements; i++)
+  {
+    buff_event_info pop_event_array= *dynamic_element(&buff_ev, i, buff_event_info *);
+    delete (pop_event_array.event);
+  }
+  delete_dynamic(&buff_ev);
+  
   delete glob_description_event;
   if (mysql)
     mysql_close(mysql);
@@ -2391,16 +2396,6 @@ int main(int argc, char** argv)
     my_fclose(result_file, MYF(0));
   cleanup();
 
-  if(buff_ev.elements)
-  {
-    for (uint i= 0; i < buff_ev.elements; i++)
-      {
-        buff_event_info pop_event_array= *dynamic_element(&buff_ev, i, buff_event_info *);
-        delete (pop_event_array.event);
-      }
-    delete_dynamic(&buff_ev);
-  }
-
   if (defaults_argv)
     free_defaults(defaults_argv);
   my_free_open_file_info();

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (manish.4.kumar:3715 to 3716) Bug#11746146Manish Kumar10 Jan