Loading mysql-test/r/create.result +7 −0 Original line number Diff line number Diff line Loading @@ -602,3 +602,10 @@ drop database mysqltest; create table test.t1 like x; ERROR 42000: Incorrect database name 'NULL' drop table if exists test.t1; create database mysqltest; use mysqltest; create view v1 as select 'foo' from dual; create table t1 like v1; ERROR HY000: 'mysqltest.v1' is not a table drop view v1; drop database mysqltest; mysql-test/t/create.test +10 −0 Original line number Diff line number Diff line Loading @@ -515,4 +515,14 @@ create table test.t1 like x; drop table if exists test.t1; --enable_warnings # # Bug #6859: Bogus error message on attempt to CREATE TABLE t LIKE view # create database mysqltest; use mysqltest; create view v1 as select 'foo' from dual; --error 1347 create table t1 like v1; drop view v1; drop database mysqltest; # End of 4.1 tests sql/sql_table.cc +9 −0 Original line number Diff line number Diff line Loading @@ -2629,6 +2629,15 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, } } /* create like should be not allowed for Views, Triggers, ... */ if (mysql_frm_type(src_path) != FRMTYPE_TABLE) { my_error(ER_WRONG_OBJECT, MYF(0), src_db, src_table, "a table"); goto err; } /* Validate the destination table Loading Loading
mysql-test/r/create.result +7 −0 Original line number Diff line number Diff line Loading @@ -602,3 +602,10 @@ drop database mysqltest; create table test.t1 like x; ERROR 42000: Incorrect database name 'NULL' drop table if exists test.t1; create database mysqltest; use mysqltest; create view v1 as select 'foo' from dual; create table t1 like v1; ERROR HY000: 'mysqltest.v1' is not a table drop view v1; drop database mysqltest;
mysql-test/t/create.test +10 −0 Original line number Diff line number Diff line Loading @@ -515,4 +515,14 @@ create table test.t1 like x; drop table if exists test.t1; --enable_warnings # # Bug #6859: Bogus error message on attempt to CREATE TABLE t LIKE view # create database mysqltest; use mysqltest; create view v1 as select 'foo' from dual; --error 1347 create table t1 like v1; drop view v1; drop database mysqltest; # End of 4.1 tests
sql/sql_table.cc +9 −0 Original line number Diff line number Diff line Loading @@ -2629,6 +2629,15 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, } } /* create like should be not allowed for Views, Triggers, ... */ if (mysql_frm_type(src_path) != FRMTYPE_TABLE) { my_error(ER_WRONG_OBJECT, MYF(0), src_db, src_table, "a table"); goto err; } /* Validate the destination table Loading