Fix false-positive syntax error detection when using UNION
I recently upgraded to dbForge 7.3 and discovered that the SQL syntax highlighter is incorrectly highlighting valid SQL (per MySQL 5.6) as if there is an error. Example SQL is below.
The effect is that the word "UNION" in the SELECT statement will display the red error underline (hover text: 'Identifier' expected) and the closing parenthesis will be similarly highlighted (hover text: Unexpected symbol ')'). If you run the query, the error highlighting will disappear until the SQL is edited, at which point it will immediately return.
-- SQL syntax highlighter bug in dbForge for MySQL 7.3.137
DROP TEMPORARY TABLE IF EXISTS a;
DROP TEMPORARY TABLE IF EXISTS b;
CREATE TEMPORARY TABLE a (
id INT(10) UNSIGNED NOT NULL AUTOINCREMENT,
PRIMARY KEY (id)
)
CHARACTER SET utf8
COLLATE utf8general_ci
;
CREATE TEMPORARY TABLE b (
id INT(10) UNSIGNED NOT NULL AUTOINCREMENT,
PRIMARY KEY (id)
)
CHARACTER SET utf8
COLLATE utf8general_ci
;
INSERT INTO a (id) VALUES(1),(2),(3);
INSERT INTO b (id) VALUES(1),(2),(3);
SELECT *
FROM (
(
SELECT 'A'
)
UNION (
SELECT 'B'
FROM a
JOIN b ON a.id=b.id
)
) AS foo
;
DROP TEMPORARY TABLE IF EXISTS a;
DROP TEMPORARY TABLE IF EXISTS b;
-
Eric Rasmussen commented
I upgraded to dbForge Studio for MySQL 7.4.201 and this issue is now resolved. Thanks!