[MDEV-6341] INSERT ... SELECT UNION with parenthesis Created: 2014-06-15 Updated: 2018-07-09 Resolved: 2018-07-09 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Parser |
| Affects Version/s: | 5.5.38, 10.0.12, 10.1, 10.3.4 |
| Fix Version/s: | 10.4.0 |
| Type: | Bug | Priority: | Major |
| Reporter: | Federico Razzoli | Assignee: | Oleksandr Byelkin |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | upstream-fixed | ||
| Issue Links: |
|
||||||||||||||||
| Description |
|
I never noticed this or never thought it is a problem, but please look at this post: The "problem" is that parenthesis are allowed for INSERT (SELECT), but not for INSERT (SELECT UNION), and someone can conclude that INSERT SELECT UNION is not supported:
|
| Comments |
| Comment by roberto spadim [ 2014-06-15 ] | |||
|
considering: https://mariadb.com/kb/en/insert-select/ MariaDB [test]> INSERT INTO t3 (SELECT a, NULL AS b FROM t2); MariaDB [test]> INSERT INTO t3 (SELECT a, NULL AS b FROM t1 UNION SELECT * FROM t2); MariaDB [test]> INSERT INTO t3 SELECT a, NULL AS b FROM t1 UNION SELECT * FROM t2; | |||
| Comment by Johannes Jordan [ 2016-03-18 ] | |||
|
This might be related to this bug: They claim they fixed it last month. How about MariaDB? | |||
| Comment by Sergei Golubchik [ 2016-04-17 ] | |||
|
Sorry, no parser changes in 5.5 — they tend to be too big and risky for GA versions. We'll fix it in the trunk, just as MySQL did. | |||
| Comment by Alexander Barkov [ 2017-01-24 ] | |||
|
The same problem is repeatable in CREATE .. SELECT:
The first and the second statements succeed, the third statement fails. | |||
| Comment by Federico Razzoli [ 2017-01-27 ] | |||
|
The same goes for CREATE VIEW:
1 and 2 work, 3 fails. | |||
| Comment by Daniel Black [ 2018-01-01 ] | |||
|
Fix in 8.0 as per mysql bug 25734 | |||
| Comment by Oleksandr Byelkin [ 2018-04-11 ] | |||
|
Duplicate of https://jira.mariadb.org/browse/MDEV-11953 . Test will be there. | |||
| Comment by Oleksandr Byelkin [ 2018-07-09 ] | |||
|
fixed in |