Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Duplicate
-
10.4.8, 10.4(EOL)
-
None
-
linux (ubuntu 18.04 64-bit, mariadb 10.4.8-MariaDB-1:10.4.8)
Description
Although issue is closed and marked as resolved for 10.4, I am experiencing a very similar bug using mariadb 10.4.8.
Union with parentheses: https://jira.mariadb.org/browse/MDEV-11953
MySQL bug, recently fixed for 8.0: https://bugs.mysql.com/bug.php?id=25734
To replicate:
create table `users` (`id` integer not null primary key auto_increment, `username` text not null); |
insert into `users` (`username`) values ('a'), ('b'), ('c'); |
|
select * from `users` where (`id` IN ( |
(select `id` from `users` where `username` = 'a') |
UNION |
(select `id` from `users` where `username` = 'c'))); |
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'UNION (select `id` from `users` where `username` = 'c')))' at line 1 |
Removing the parentheses around the left-hand side of the compound query "fixes" it:
select * from `users` where (`id` IN ( |
select `id` from `users` where `username` = 'a' |
UNION |
(select `id` from `users` where `username` = 'c'))); |
|
+----+----------+ |
| id | username |
|
+----+----------+ |
| 1 | a |
|
| 3 | c |
|
+----+----------+ |
Attachments
Issue Links
- relates to
-
MDEV-11953 support of brackets (parentheses) in UNION/EXCEPT/INTERSECT operations
- Closed