List:Commits« Previous MessageNext Message »
From:Alexander Nozdrin Date:December 22 2010 7:31am
Subject:bzr commit into mysql-trunk-bugfixing branch (alexander.nozdrin:3465)
Bug#59022
View as plain text  
#At file:///home/alik/MySQL/bzr/00.build/mysql-trunk-bugfixing/ based on revid:tor.didriksen@stripped

 3465 Alexander Nozdrin	2010-12-22
      A patch for Bug#59022 (Valgrind warning in write_delayed() after InnoDB merge).
      
      Free allocated bitmap.

    modified:
      sql/sql_insert.cc
=== modified file 'sql/sql_insert.cc'
--- a/sql/sql_insert.cc	2010-11-29 16:27:58 +0000
+++ b/sql/sql_insert.cc	2010-12-22 07:31:25 +0000
@@ -2423,6 +2423,12 @@ int write_delayed(THD *thd, TABLE *table
   */
   bitmaps= (my_bitmap_map*) my_malloc(bitmap_buffer_size(table->write_set->n_bits), MYF(0));
   bitmap_init(&row->write_set, bitmaps, table->write_set->n_bits, FALSE);
+  /*
+    bitmap_init() does not touch MY_BITMAP::mutex if my_bitmap_map instance
+    is provided. It needs to be reset, otherwise bitmap_free() will try to
+    destroy uninitialized mutex and crash.
+  */
+  row->write_set.mutex= NULL;
   bitmap_clear_all(&row->write_set);
   bitmap_union(&row->write_set, table->write_set);
 
@@ -2916,6 +2922,7 @@ bool Delayed_insert::handle_inserts(void
     bitmap_clear_all(table->write_set);
     bitmap_union(table->write_set, &row->write_set);
     table->file->column_bitmaps_signal();
+    bitmap_free(&row->write_set);
 
     /*
       To get the exact auto_inc interval to store in the binlog we must not


Attachment: [text/bzr-bundle] bzr/alexander.nozdrin@oracle.com-20101222073125-73ww6z6ivu53sy0g.bundle
Thread
bzr commit into mysql-trunk-bugfixing branch (alexander.nozdrin:3465)Bug#59022Alexander Nozdrin22 Dec