Bug #10355 Incorrect error displayed if view is used in like clause when creating a table.
Submitted: 4 May 2005 11:10 Modified: 19 Aug 2008 5:07
Reporter: Disha Email Updates:
Status: Duplicate Impact on me:
Category:MySQL Server: Errors Severity:S3 (Non-critical)
Version:5.0.4 Beta OS:Microsoft Windows (Windows 2003)
Assigned to: CPU Architecture:Any

[4 May 2005 11:10] Disha
If, in a create table statement with like clause, view is used instated of a table then incorrect error is displayed.

How to repeat:
1. Start the MySQL client and connect to the database with valid user and password.
2. Set the delimiter to //
3. Run the following commands to create a table and a view from it.

   drop table if exists t1//
   create table t1(f1 char(100))//

   drop view if exists v1//
   create view v1 as select * from t1//

4. Now createt a new table with like clause using a view as follows:

   create table t2 like v1//

Expected Results: 
1. Appropriate error should be displayed as the LIKE clause only accepts a table.

Actual Results: 
1. Incorrect error is displayed as:
"ERROR 1033 (HY000): Incorrect information in file: '.\test\t2.frm'"
[1 Jun 2005 13:37] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

[19 Aug 2008 5:07] Dmitry Lenev

This bug is duplicate of bug #6859 "Bogus error message on attempt to CREATE TABLE t LIKE view" which was fixed in MySQL 5.0.11. So I am marking this bug as such.