Bug #1821 | parentheses after insert into | ||
---|---|---|---|
Submitted: | 12 Nov 2003 15:09 | Modified: | 13 Nov 2003 11:05 |
Reporter: | Jan-Peter Wilhelms | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server | Severity: | S2 (Serious) |
Version: | 4.1.0-alpha | OS: | Windows (Windows XP) |
Assigned to: | CPU Architecture: | Any |
[12 Nov 2003 15:09]
Jan-Peter Wilhelms
[13 Nov 2003 8:02]
Georg Richter
Your Syntax is wrong, correct would be INSERT INTO T1 (SELECT ID FROM T2 UNION SELECT ID FROM T3); but this fails also in 4.1.1 INSERT INTO T1 (SELECT ID FROM T2) works correct in 4.1.1
[13 Nov 2003 11:05]
Sergei Golubchik
actually INSERT INTO T1 (SELECT ID FROM T2) UNION (SELECT ID FROM T3); is correct. The reason it's not supported in 4.1.0 is because it wasn't trivial for the parser to distinguish it from INSERT INTO T1 (column-list) VALUES ... after reading the first '('. But it's all solved in 4.1.1 and this syntax is correctly recognised and supported.