From: Date: August 3 2005 7:29am Subject: bk commit into 5.0 tree (georg:1.1912) BUG#6859 List-Archive: http://lists.mysql.com/internals/27837 X-Bug: 6859 Message-Id: <20050803052957.C836617AFA3@lmy002.wdf.sap.corp> Below is the list of changes that have just been committed into a local 5.0 repository of georg. When georg does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository. For information on how to access the public repository see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html ChangeSet 1.1912 05/08/03 07:29:48 georg@stripped +3 -0 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) sql/sql_table.cc 1.266 05/08/03 07:29:41 georg@stripped +9 -0 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/t/create.test 1.58 05/08/03 07:29:41 georg@stripped +10 -0 Add testcase for bug #6850 mysql-test/r/create.result 1.95 05/08/03 07:29:41 georg@stripped +7 -0 Added test case for bug #6859 # This is a BitKeeper patch. What follows are the unified diffs for the # set of deltas contained in the patch. The rest of the patch, the part # that BitKeeper cares about, is below these diffs. # User: georg # Host: lmy002.wdf.sap.corp # Root: /home/georg/work/mysql/prod/mysql-5.0 --- 1.265/sql/sql_table.cc 2005-07-28 16:09:49 +02:00 +++ 1.266/sql/sql_table.cc 2005-08-03 07:29:41 +02:00 @@ -2629,6 +2629,15 @@ } } + /* + 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 --- 1.94/mysql-test/r/create.result 2005-07-22 21:32:27 +02:00 +++ 1.95/mysql-test/r/create.result 2005-08-03 07:29:41 +02:00 @@ -602,3 +602,10 @@ 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; --- 1.57/mysql-test/t/create.test 2005-07-28 15:12:32 +02:00 +++ 1.58/mysql-test/t/create.test 2005-08-03 07:29:41 +02:00 @@ -515,4 +515,14 @@ 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