From 5ffa6904d2a187d78a9adc4eaf077f7cc4e5946b Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sun, 10 Nov 2013 17:51:20 +0100 Subject: [PATCH] MDEV-4880 Attempt to create a table without columns produces ER_ILLEGAL_HA instead of ER_TABLE_MUST_HAVE_COLUMNS --- mysql-test/r/create.result | 2 ++ mysql-test/t/create.test | 7 +++++++ sql/sql_table.cc | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index 4f4cd9ed4d6..7eba25d8ea3 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -2607,3 +2607,5 @@ a b 1 1 unlock tables; drop table t1,t2; +create table t1; +ERROR 42000: A table must have at least 1 column diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test index a1152045dd9..ebcad5f4af4 100644 --- a/mysql-test/t/create.test +++ b/mysql-test/t/create.test @@ -2019,3 +2019,10 @@ connection default; select * from t1; unlock tables; drop table t1,t2; + +# +# MDEV-4880 Attempt to create a table without columns produces ER_ILLEGAL_HA instead of ER_TABLE_MUST_HAVE_COLUMNS +# +--error ER_TABLE_MUST_HAVE_COLUMNS +create table t1; + diff --git a/sql/sql_table.cc b/sql/sql_table.cc index f78f1b56489..887aef643d2 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -4579,7 +4579,7 @@ bool create_table_impl(THD *thd, if (!hton->discover_table_structure) { - my_error(ER_ILLEGAL_HA, MYF(0), hton_name(hton)->str, db, table_name); + my_error(ER_TABLE_MUST_HAVE_COLUMNS, MYF(0)); goto err; }