Bug #60299 | Create Table as SELECT with expression doesn't work right | ||
---|---|---|---|
Submitted: | 2 Mar 2011 0:21 | Modified: | 2 Apr 2011 4:11 |
Reporter: | Greg Kemnitz | Email Updates: | |
Status: | No Feedback | Impact on me: | |
Category: | MySQL Server: DML | Severity: | S3 (Non-critical) |
Version: | 5.1.43sp1-enterprise-gpl-advanced-log | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[2 Mar 2011 0:21]
Greg Kemnitz
[2 Mar 2011 4:11]
Valeriy Kravchuk
This is clearly documented in the manual (http://dev.mysql.com/doc/refman/5.1/en/create-table-select.html): "You can create one table from another by adding a SELECT statement at the end of the CREATE TABLE statement: CREATE TABLE new_tbl SELECT * FROM orig_tbl; MySQL creates new columns for all elements in the SELECT. For example: mysql> CREATE TABLE test (a INT NOT NULL AUTO_INCREMENT, -> PRIMARY KEY (a), KEY(b)) -> ENGINE=MyISAM SELECT b,c FROM test2; This creates a MyISAM table with three columns, a, b, and c. Notice that the columns from the SELECT statement are appended to the right side of the table, not overlapped onto it. " So, formally this is not a bug.
[2 Apr 2011 23:00]
Bugs System
No feedback was provided for this bug for over a month, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open".