Bug #22975 CREATE TABLE ... LIKE ... takes old table version
Submitted: 4 Oct 2006 7:38 Modified: 19 Dec 2006 19:40
Reporter: Oli Sennhauser Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:5.0.27-BK OS:Linux (Linux)
Assigned to: Paul DuBois CPU Architecture:Any

[4 Oct 2006 7:38] Oli Sennhauser
Description:
Creating and new table with CREATE TABLE ... LIKE ... takes the version of the original table. Instead of the actual MySQL version.

How to repeat:
show table status like '%';
+----------+--------+---------+
| Name     | Engine | Version |
+----------+--------+---------+
| bonus    | MyISAM |      10 |
| dept     | MyISAM |       7 |
+----------+--------+---------+

create table oli like dept;

show table status like '%';
+----------+--------+---------+
| Name     | Engine | Version |
+----------+--------+---------+
| bonus    | MyISAM |      10 |
| dept     | MyISAM |       7 |
| oli      | MyISAM |       7 |
+----------+--------+---------+

See also bug: http://bugs.mysql.com/bug.php?id=22909

Suggested fix:
I expect that new table is in the new table format. So table format should be taken over but some things have to be changed!

Or at least docutment it correctly under CREATE TABLE LIKE...
[4 Oct 2006 11:45] Valeriy Kravchuk
Thank you for a bug report. Verified just as described with 5.0.27-BK on Linux.
[18 Dec 2006 21:58] Sergei Golubchik
This should be documented. CREATE TABLE ... LIKE makes an exact copy of the table definition, this includes the version too
[19 Dec 2006 19:40] Paul DuBois
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly, and will be included in the next release of the relevant products.