summaryrefslogtreecommitdiff
path: root/sql/sql_table.cc
diff options
context:
space:
mode:
authorunknown <georg@lmy002.wdf.sap.corp>2005-08-03 07:29:48 +0200
committerunknown <georg@lmy002.wdf.sap.corp>2005-08-03 07:29:48 +0200
commitac88687dcdef2453c74c48edd7a35a3d53321a46 (patch)
treecf54575c4cbed3412e293f3715baef1cc35ceebc /sql/sql_table.cc
parenta0a71deeb3956d6f3af1fb29adb44076b016ec18 (diff)
downloadmariadb-git-ac88687dcdef2453c74c48edd7a35a3d53321a46.tar.gz
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
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r--sql/sql_table.cc9
1 files changed, 9 insertions, 0 deletions
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