| Bug #3739 | create table .. select, the same column name, unexpected error | ||
|---|---|---|---|
| Submitted: | 13 May 2004 10:03 | Modified: | 13 May 2004 13:15 |
| Reporter: | Matthias Leich | Email Updates: | |
| Status: | Not a Bug | Impact on me: | |
| Category: | MySQL Server | Severity: | S3 (Non-critical) |
| Version: | 4.0 | OS: | |
| Assigned to: | CPU Architecture: | Any | |
[13 May 2004 13:15]
Sergei Golubchik
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: From the manual (CREATE TABLE section): ... Notice that the columns from the `SELECT' statement are appended to the right side of the table, not overlapped onto it. ... so create table t2 ( a int ) select 1 as a; results in create table t2 (a int, a int) with the following "Duplicate column name" error

Description: If a column of a table to be created and a column of a query table are equal, the MySQL gives the wrong response 1060: Duplicate column name ... simple examples: create table t2 ( a int ) select 1 ; works OK create table t2 ( a int ) select 1 as a; fails create table t2 ( a int ) select 1 as b; works OK create table t2 ( a int ) select a from t1; fails This error occurs in version 4.0 only. The behaviour of version 4.1 and 5.0 is correct. My environment: Linux(SuSE 9.0), MySQL 4.0 source distrib (last bkpull ~7.5.2004) How to repeat: Please have a look at the examples above.