Commit 19896d4b authored by Alexey Botchkov's avatar Alexey Botchkov

MDEV-10274 Bundling insert with create statement for table with unsigned...

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.
parent 2f6fede8
......@@ -2498,4 +2498,11 @@ end|
create table t1 as select f1();
ERROR 42S02: Table 'test.t1' doesn't exist
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
......@@ -2081,4 +2081,13 @@ DELIMITER ;|
create table t1 as select 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
......@@ -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->key_length= dup_field->key_length;
sql_field->decimals= dup_field->decimals;
sql_field->create_length_to_internal_length();
sql_field->unireg_check= dup_field->unireg_check;
/*
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))
null_fields--;
sql_field->flags= dup_field->flags;
sql_field->create_length_to_internal_length();
sql_field->interval= dup_field->interval;
sql_field->vcol_info= dup_field->vcol_info;
sql_field->stored_in_db= dup_field->stored_in_db;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment