Bug #3721 | create table .. select <constant> ... gives wrong table content | ||
---|---|---|---|
Submitted: | 12 May 2004 0:12 | Modified: | 14 May 2004 20:23 |
Reporter: | Matthias Leich | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server | Severity: | S3 (Non-critical) |
Version: | 5.0 4.1 4.0 | OS: | |
Assigned to: | CPU Architecture: | Any |
[12 May 2004 0:12]
Matthias Leich
[12 May 2004 0:14]
Matthias Leich
test case for mysql/mysqltest
Attachment: ml_err1.test (application/octet-stream, text), 1.73 KiB.
[12 May 2004 0:16]
Matthias Leich
my (wrong) result with version 5.0
Attachment: ml_err1.result (application/octet-stream, text), 1.09 KiB.
[12 May 2004 0:17]
Matthias Leich
the results I expect
Attachment: ml_err1.result.expected (application/octet-stream, text), 1.08 KiB.
[14 May 2004 20:23]
Alexander Keremidarski
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: mysql> create table t2 ( a int ) select 1 ; Query OK, 1 row affected (0.02 sec) Records: 1 Duplicates: 0 Warnings: 0 mysql> show create table t2; +-------+---------------------------------------------------------------------------------------------------------------------------+ | Table | Create Table | +-------+---------------------------------------------------------------------------------------------------------------------------+ | t2 | CREATE TABLE `t2` ( `a` int(11) default NULL, `1` bigint(1) NOT NULL default '0' ) ENGINE=MyISAM DEFAULT CHARSET=utf8 | +-------+---------------------------------------------------------------------------------------------------------------------------+ 1 row in set (0.00 sec) mysql> select * from t2; +------+---+ | a | 1 | +------+---+ | NULL | 1 | +------+---+ 1 row in set (0.00 sec) This exactly the same as an example in the manual at: http://dev.mysql.com/doc/mysql/en/CREATE_TABLE.html mysql> CREATE TABLE bar (m INT) SELECT n FROM foo; Query OK, 1 row affected (0.02 sec) Records: 1 Duplicates: 0 Warnings: 0 mysql> SELECT * FROM bar; +------+---+ | m | n | +------+---+ | NULL | 1 | +------+---+ 1 row in set (0.00 sec) For each row in table foo, a row is inserted in bar with the values from foo and default values for the new columns.