diff --git a/mysql-test/r/delayed.result b/mysql-test/r/delayed.result index 6295fceec2b..82a308c63e7 100644 --- a/mysql-test/r/delayed.result +++ b/mysql-test/r/delayed.result @@ -243,3 +243,10 @@ SET @@session.auto_increment_offset= @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; diff --git a/mysql-test/t/delayed.test b/mysql-test/t/delayed.test index fe8bc167e0f..773927f6015 100644 --- a/mysql-test/t/delayed.test +++ b/mysql-test/t/delayed.test @@ -234,3 +234,11 @@ SET @@session.auto_increment_offset= 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; 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;