Loading mysql-test/r/type_bit.result +3 −0 Original line number Diff line number Diff line Loading @@ -377,3 +377,6 @@ hex(concat(a)) hex(concat(b)) 07 0FFE 01 01FF drop table t1; create table t1(a int, b bit not null); alter table t1 add primary key (a); drop table t1; mysql-test/t/type_bit.test +8 −0 Original line number Diff line number Diff line Loading @@ -112,3 +112,11 @@ insert into t1 values (7,(1<<12)-2), (0x01,0x01ff); select hex(a),hex(b) from t1; select hex(concat(a)),hex(concat(b)) from t1; drop table t1; # # Bug #9571: problem with primary key creation # create table t1(a int, b bit not null); alter table t1 add primary key (a); drop table t1; sql/unireg.cc +2 −3 Original line number Diff line number Diff line Loading @@ -679,15 +679,14 @@ static bool make_empty_rec(THD *thd, File file,enum db_type table_type, null_count++; } bfill(buff,(null_length=(null_fields+7)/8),255); null_pos=buff; null_pos= buff + null_count / 8; List_iterator<create_field> it(create_fields); thd->count_cuted_fields= CHECK_FIELD_WARN; // To find wrong default values while ((field=it++)) { Field *regfield=make_field((char*) buff+field->offset,field->length, field->flags & NOT_NULL_FLAG ? 0: null_pos+null_count/8, null_pos, null_count & 7, field->pack_flag, field->sql_type, Loading Loading
mysql-test/r/type_bit.result +3 −0 Original line number Diff line number Diff line Loading @@ -377,3 +377,6 @@ hex(concat(a)) hex(concat(b)) 07 0FFE 01 01FF drop table t1; create table t1(a int, b bit not null); alter table t1 add primary key (a); drop table t1;
mysql-test/t/type_bit.test +8 −0 Original line number Diff line number Diff line Loading @@ -112,3 +112,11 @@ insert into t1 values (7,(1<<12)-2), (0x01,0x01ff); select hex(a),hex(b) from t1; select hex(concat(a)),hex(concat(b)) from t1; drop table t1; # # Bug #9571: problem with primary key creation # create table t1(a int, b bit not null); alter table t1 add primary key (a); drop table t1;
sql/unireg.cc +2 −3 Original line number Diff line number Diff line Loading @@ -679,15 +679,14 @@ static bool make_empty_rec(THD *thd, File file,enum db_type table_type, null_count++; } bfill(buff,(null_length=(null_fields+7)/8),255); null_pos=buff; null_pos= buff + null_count / 8; List_iterator<create_field> it(create_fields); thd->count_cuted_fields= CHECK_FIELD_WARN; // To find wrong default values while ((field=it++)) { Field *regfield=make_field((char*) buff+field->offset,field->length, field->flags & NOT_NULL_FLAG ? 0: null_pos+null_count/8, null_pos, null_count & 7, field->pack_flag, field->sql_type, Loading