Details
-
Bug
-
Status: Confirmed (View Workflow)
-
Minor
-
Resolution: Unresolved
-
10.5, 10.6, 10.11, 11.8
-
None
Description
Union sql returns an error when there are brackets and does not return an error when there are no brackets.
Preparing:
CREATE TABLE del (`id` bigint(20)); |
INSERT INTO del VALUES(1); |
Error "ERROR 1060 (42S21) Duplicate column name 'id'":
(
|
(select a.id, b.id from del a join del b on a.id=b.id) |
union all |
(select a.id, b.id from del a join del b on a.id=b.id) |
)
|
union all |
(select a.id, b.id from del a join del b on a.id=b.id); |
No error:
(select a.id, b.id from del a join del b on a.id=b.id) |
union all |
(select a.id, b.id from del a join del b on a.id=b.id) |
union all |
(select a.id, b.id from del a join del b on a.id=b.id); |
mysql does not return an error