From ac88687dcdef2453c74c48edd7a35a3d53321a46 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 3 Aug 2005 07:29:48 +0200 Subject: Fix for bug #6859 (after Sanja's review) Added check which throws ER_WRONG_OBJECT error in case the .frm doesn't contain a valid table type (e.g. view or trigger) mysql-test/r/create.result: Added test case for bug #6859 mysql-test/t/create.test: Add testcase for bug #6850 --- sql/sql_table.cc | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'sql/sql_table.cc') diff --git a/sql/sql_table.cc b/sql/sql_table.cc index b5d48f3dc3b..1437c1d382c 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -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 -- cgit v1.2.1