MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Sergey Vojtovich Date:February 28 2007 2:34pm
Subject:bk commit into 5.0 tree (svoj:1.2418) BUG#26238
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of svoj. When svoj 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-02-28 18:34:35+04:00, svoj@stripped +3 -0
  BUG#26238 - inserted delayed always inserts 0 for BIT columns
  
  INSERT DELAYED inserts garbage for BIT columns.
  
  When delayed thread clones TABLE object, it didn't adjusted bit_ptr
  to newly created record (though it correctly adjusts ptr and null_ptr).
  
  This is fixed by correctly adjusting bit_ptr when performing a clone.
  With this fix BIT values are stored correctly by INSERT DELAYED.

  mysql-test/r/delayed.result@stripped, 2007-02-28 18:34:33+04:00, svoj@stripped +7 -0
    A test case for BUG#26238.

  mysql-test/t/delayed.test@stripped, 2007-02-28 18:34:33+04:00, svoj@stripped +8 -0
    A test case for BUG#26238.

  sql/field.h@stripped, 2007-02-28 18:34:34+04:00, svoj@stripped +6 -1
    Added move_field() to Field_bit class. When moving a field, adjust
    bit_ptr also, which is specific to Field_bit class.

# 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:	svoj
# Host:	june.mysql.com
# Root:	/home/svoj/devel/mysql/BUG26238/mysql-5.0-engines

--- 1.200/sql/field.h	2007-02-14 02:25:05 +04:00
+++ 1.201/sql/field.h	2007-02-28 18:34:34 +04:00
@@ -225,7 +225,7 @@ public:
     ptr=ptr_arg; null_ptr=null_ptr_arg; null_bit=null_bit_arg;
   }
   inline void move_field(char *ptr_arg) { ptr=ptr_arg; }
-  inline void move_field(my_ptrdiff_t ptr_diff)
+  virtual inline void move_field(my_ptrdiff_t ptr_diff)
   {
     ptr=ADD_TO_PTR(ptr,ptr_diff,char*);
     if (null_ptr)
@@ -1407,6 +1407,11 @@ public:
   Field *new_key_field(MEM_ROOT *root, struct st_table *new_table,
                        char *new_ptr, uchar *new_null_ptr,
                        uint new_null_bit);
+  inline void move_field(my_ptrdiff_t ptr_diff)
+  {
+    Field::move_field(ptr_diff);
+    bit_ptr= ADD_TO_PTR(bit_ptr, ptr_diff, uchar*);
+  }
   void set_bit_ptr(uchar *bit_ptr_arg, uchar bit_ofs_arg)
   {
     bit_ptr= bit_ptr_arg;

--- 1.12/mysql-test/r/delayed.result	2006-09-20 14:05:07 +05:00
+++ 1.13/mysql-test/r/delayed.result	2007-02-28 18:34:33 +04:00
@@ -243,3 +243,10 @@ SET             @@session.auto_increment
 @bug20830_old_session_auto_increment_offset;
 SET             @@session.auto_increment_increment=
 @bug20830_old_session_auto_increment_increment;
+CREATE TABLE t1(a BIT);
+INSERT DELAYED INTO t1 VALUES(1);
+FLUSH TABLE t1;
+SELECT HEX(a) FROM t1;
+HEX(a)
+1
+DROP TABLE t1;

--- 1.16/mysql-test/t/delayed.test	2006-11-13 20:06:41 +04:00
+++ 1.17/mysql-test/t/delayed.test	2007-02-28 18:34:33 +04:00
@@ -234,3 +234,11 @@ SET             @@session.auto_increment
 SET             @@session.auto_increment_increment=
     @bug20830_old_session_auto_increment_increment;
 
+#
+# BUG#26238 - inserted delayed always inserts 0 for BIT columns
+#
+CREATE TABLE t1(a BIT);
+INSERT DELAYED INTO t1 VALUES(1);
+FLUSH TABLE t1;
+SELECT HEX(a) FROM t1;
+DROP TABLE t1;
Thread
bk commit into 5.0 tree (svoj:1.2418) BUG#26238Sergey Vojtovich28 Feb