Bug #5776 create table with the "like" statement not working
Submitted: 27 Sep 2004 21:52 Modified: 27 Sep 2004 22:31
Reporter: Carle Denis Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.1.4 OS:Windows (windows XP)
Assigned to: CPU Architecture:Any

[27 Sep 2004 21:52] Carle Denis
Description:
I am trying to create temporary tables with the like statement but it does not seem to be working.

When I do the select for aa1 , I get: 1
When I do the select for aa2 , I get: "empty"

Is my query wrong or what?

How to repeat:
drop temporary table aa1 if exists;
drop  temporary  table aa2 if exists;
create temporary table aa1 select 1;
create temporary table  aa2 like aa1;
select * from aa2
[27 Sep 2004 22:31] Paul DuBois
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.mysql.com/documentation/ and the instructions on
how to report a bug at http://bugs.mysql.com/how-to-report.php

Additional info:

That's how CREATE TABLE ... LIKE works.  It copies table
structure, not table contents, and thus creates an empty
table.

http://dev.mysql.com/doc/mysql/en/CREATE_TABLE.html