diff options
author | svoj@mysql.com/june.mysql.com <> | 2007-02-28 18:34:35 +0400 |
---|---|---|
committer | svoj@mysql.com/june.mysql.com <> | 2007-02-28 18:34:35 +0400 |
commit | aae6e1aba44e2d8353ccb111633bc3631eefaf7a (patch) | |
tree | c71e3a8227be82a70c99397a2e2270c208e6b430 /sql/field.h | |
parent | 37cedb7efad7568b496eb981e40a0910c0e22494 (diff) | |
download | mariadb-git-aae6e1aba44e2d8353ccb111633bc3631eefaf7a.tar.gz |
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.
Diffstat (limited to 'sql/field.h')
-rw-r--r-- | sql/field.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sql/field.h b/sql/field.h index fe3c59c89f5..d46f5f699af 100644 --- a/sql/field.h +++ b/sql/field.h @@ -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; |