MDEV-10274 Bundling insert with create statement for table with unsigned Decimal primary key issues warning 1194.
Flags are important for key_length calculations, so them should be set before it, not after.
This commit is contained in:
parent
2f6fede8d5
commit
19896d4b3a
@ -2498,4 +2498,11 @@ end|
|
|||||||
create table t1 as select f1();
|
create table t1 as select f1();
|
||||||
ERROR 42S02: Table 'test.t1' doesn't exist
|
ERROR 42S02: Table 'test.t1' doesn't exist
|
||||||
drop function f1;
|
drop function f1;
|
||||||
|
#
|
||||||
|
# MDEV-10274 Bundling insert with create statement
|
||||||
|
# for table with unsigned Decimal primary key issues warning 1194
|
||||||
|
#
|
||||||
|
create table t1(ID decimal(2,1) unsigned NOT NULL, PRIMARY KEY (ID))engine=memory
|
||||||
|
select 2.1 ID;
|
||||||
|
drop table t1;
|
||||||
End of 5.5 tests
|
End of 5.5 tests
|
||||||
|
@ -2081,4 +2081,13 @@ DELIMITER ;|
|
|||||||
create table t1 as select f1();
|
create table t1 as select f1();
|
||||||
drop function f1;
|
drop function f1;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-10274 Bundling insert with create statement
|
||||||
|
--echo # for table with unsigned Decimal primary key issues warning 1194
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
create table t1(ID decimal(2,1) unsigned NOT NULL, PRIMARY KEY (ID))engine=memory
|
||||||
|
select 2.1 ID;
|
||||||
|
drop table t1;
|
||||||
|
|
||||||
--echo End of 5.5 tests
|
--echo End of 5.5 tests
|
||||||
|
@ -3167,7 +3167,6 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
|
|||||||
sql_field->pack_length= dup_field->pack_length;
|
sql_field->pack_length= dup_field->pack_length;
|
||||||
sql_field->key_length= dup_field->key_length;
|
sql_field->key_length= dup_field->key_length;
|
||||||
sql_field->decimals= dup_field->decimals;
|
sql_field->decimals= dup_field->decimals;
|
||||||
sql_field->create_length_to_internal_length();
|
|
||||||
sql_field->unireg_check= dup_field->unireg_check;
|
sql_field->unireg_check= dup_field->unireg_check;
|
||||||
/*
|
/*
|
||||||
We're making one field from two, the result field will have
|
We're making one field from two, the result field will have
|
||||||
@ -3177,6 +3176,7 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
|
|||||||
if (!(sql_field->flags & NOT_NULL_FLAG))
|
if (!(sql_field->flags & NOT_NULL_FLAG))
|
||||||
null_fields--;
|
null_fields--;
|
||||||
sql_field->flags= dup_field->flags;
|
sql_field->flags= dup_field->flags;
|
||||||
|
sql_field->create_length_to_internal_length();
|
||||||
sql_field->interval= dup_field->interval;
|
sql_field->interval= dup_field->interval;
|
||||||
sql_field->vcol_info= dup_field->vcol_info;
|
sql_field->vcol_info= dup_field->vcol_info;
|
||||||
sql_field->stored_in_db= dup_field->stored_in_db;
|
sql_field->stored_in_db= dup_field->stored_in_db;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user