Commit 89936f11 authored by Aleksey Midenkov's avatar Aleksey Midenkov

MDEV-18278 Misleading error message in error log upon failed table creation

If error_reported is not set upper caller open_table_from_share()
throws error ER_NOT_FORM_FILE itself via open_table_error().
parent 275e7d23
...@@ -3396,4 +3396,12 @@ CREATE OR REPLACE TABLE t1(i int); ...@@ -3396,4 +3396,12 @@ CREATE OR REPLACE TABLE t1(i int);
ALTER TABLE t1 ADD b CHAR(255) DEFAULT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa`; ALTER TABLE t1 ADD b CHAR(255) DEFAULT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa`;
ERROR 42S22: Unknown column 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' in 'DEFAULT' ERROR 42S22: Unknown column 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' in 'DEFAULT'
DROP TABLE t1; DROP TABLE t1;
#
# MDEV-18278 Misleading error message in error log upon failed table creation
#
create table t1 (a int as (a));
ERROR 01000: Expression for field `a` is referring to uninitialized field `a`
show warnings;
Level Code Message
Error 4029 Expression for field `a` is referring to uninitialized field `a`
# end of 10.2 test # end of 10.2 test
...@@ -2109,5 +2109,11 @@ CREATE OR REPLACE TABLE t1(i int); ...@@ -2109,5 +2109,11 @@ CREATE OR REPLACE TABLE t1(i int);
ALTER TABLE t1 ADD b CHAR(255) DEFAULT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa`; ALTER TABLE t1 ADD b CHAR(255) DEFAULT `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa`;
DROP TABLE t1; DROP TABLE t1;
--echo #
--echo # MDEV-18278 Misleading error message in error log upon failed table creation
--echo #
--error ER_EXPRESSION_REFERS_TO_UNINIT_FIELD
create table t1 (a int as (a));
show warnings;
--echo # end of 10.2 test --echo # end of 10.2 test
...@@ -1157,7 +1157,10 @@ bool parse_vcol_defs(THD *thd, MEM_ROOT *mem_root, TABLE *table, ...@@ -1157,7 +1157,10 @@ bool parse_vcol_defs(THD *thd, MEM_ROOT *mem_root, TABLE *table,
if (check_vcol_forward_refs(field, field->vcol_info) || if (check_vcol_forward_refs(field, field->vcol_info) ||
check_vcol_forward_refs(field, field->check_constraint) || check_vcol_forward_refs(field, field->check_constraint) ||
check_vcol_forward_refs(field, field->default_value)) check_vcol_forward_refs(field, field->default_value))
{
*error_reported= true;
goto end; goto end;
}
} }
res=0; res=0;
......
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