Bug #88456 False error on UNION inside EXISTS (unexpected parenthesis)
Submitted: 13 Nov 2017 6:45 Modified: 20 Mar 2018 15:24
Reporter: Josh Bjelovuk Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S1 (Critical)
Version:6.3.9 OS:MacOS
Assigned to: CPU Architecture:Any
Tags: DDL, parsing, syntax

[13 Nov 2017 6:45] Josh Bjelovuk
Description:
SELECT EXISTS ((SELECT 1 LIMIT 1)
                            UNION
                            (SELECT 1 LIMIT 1));

The above statement produces a false syntax error at second union select.

Removing the brackets and limits produces "unexpected SELECT":

SELECT EXISTS (SELECT 1
                            UNION
                            SELECT 1 );

How to repeat:
Open new query tab, paste following statement:

SELECT EXISTS ((SELECT 1 LIMIT 1)
			   UNION
			   (SELECT 1 LIMIT 1));
[13 Nov 2017 6:47] Josh Bjelovuk
Delimit tags
[14 Nov 2017 7:01] MySQL Verification Team
Hello Josh Bjelovuk,

Thank you for the bug report
Verified as described on macOS 10.12.x Sierra x86_64 with Workbench Community (GPL) for Mac OS X version 6.3.9 CE build 10690321 (64 bit).

Thanks,
Umesh
[14 Nov 2017 7:02] MySQL Verification Team
Screenshot

Attachment: Screen Shot 2017-11-14 at 12.27.21 PM.png (image/png, text), 31.36 KiB.

[20 Mar 2018 15:24] Christine Cole
Posted by developer:
 
Fixed as of the upcoming MySQL Workbench 8.0.11 release, and here's the changelog entry:

A UNION query with valid syntax produced an error message.

Thank you for the bug report.