[Commits] Rev 2832: Fix for LP BUG#606013. in file:///home/bell/maria/bzr/work-maria-5.3-lp606013/

sanja at askmonty.org sanja at askmonty.org
Mon Nov 1 00:01:05 EET 2010


At file:///home/bell/maria/bzr/work-maria-5.3-lp606013/

------------------------------------------------------------
revno: 2832
revision-id: sanja at askmonty.org-20101031220104-xrcm18fgqas9wf90
parent: psergey at askmonty.org-20101018122305-iall1tv8ndmsebvh
committer: sanja at askmonty.org
branch nick: work-maria-5.3-lp606013
timestamp: Mon 2010-11-01 00:01:04 +0200
message:
  Fix for LP BUG#606013.
  
  If we have bit fields in some temporary table where number of bits is not multiple of bytes we should initialize record.
-------------- next part --------------
=== modified file 'sql/sql_select.cc'
--- a/sql/sql_select.cc	2010-10-18 08:55:26 +0000
+++ b/sql/sql_select.cc	2010-10-31 22:01:04 +0000
@@ -11538,6 +11538,19 @@ create_tmp_table(THD *thd,TMP_TABLE_PARA
     if (!(table->record[0]= (uchar*)
                             alloc_root(&table->mem_root, alloc_length*3)))
       goto err;
+#ifdef HAVE_valgrind
+    if (total_uneven_bit_length || hidden_uneven_bit_length)
+    {
+      /*
+        For normal table table->record[0] and table->record[1] copied from
+        share->default_values which set to zero, then to default
+        values in make_empty_rec(). Here we do not have share->default_values
+        yet. It works OK for most types except bit which do not fill
+        whole byte so uninitialized bits could be left.
+      */
+      bzero(table->record[0], alloc_length * 3);
+    }
+#endif
     table->record[1]= table->record[0]+alloc_length;
     share->default_values= table->record[1]+alloc_length;
   }



More information about the commits mailing list