Hi,
we are having issues with H2 SQL parser. It appears that it is having problems understanding queries that contain
inline views, together with normal tables and JOIN/LEFT JOIN combined in the same query.
The error appears only when there are all these things combined (first a table, then an inline view with both, another inline view and a JOIN or LEFT JOIN).
It would also seems its only a parsing error.
We include the minimal cases to reproduce it. We tested with Postgres, MySQL and DB2 and the query is valid in all of them.
Is there any chance to get this one fixed? Is it a hard one?
Thank you in advance
CREATE TABLE "TABLE1" (
"ID" integer NOT NULL
);
-- THIS DOESNT WORK
SELECT *
FROM
"TABLE1" QVIEW1,
(
(
SELECT *
FROM
"TABLE1" QVIEW2
) QVIEW4
JOIN
"TABLE1" QVIEW5
ON ( 1= 1)
) v1
-- THIS DOESNT WORK
SELECT *
FROM
"TABLE1" QVIEW1,
(
(
(
SELECT *
FROM
"TABLE1" QVIEW2
)
UNION ALL
(
SELECT *
FROM
"TABLE1" QVIEW3
)
) QVIEW4
LEFT OUTER JOIN
"TABLE1" QVIEW5
ON ( 1= 1)
)
-- THIS DOESNT WORK
SELECT *
FROM
"TABLE1" QVIEW1,
(
(
(
SELECT *
FROM
"TABLE1" QVIEW2
)
UNION ALL
(
SELECT *
FROM
"TABLE1" QVIEW3
)
) QVIEW4
JOIN
"TABLE1" QVIEW5
ON ( 1= 1)
)
-- THIS WORKS
SELECT *
FROM
"TABLE1" QVIEW1,
(
(
(
SELECT *
FROM
"TABLE1" QVIEW2
)
UNION ALL
(
SELECT *
FROM
"TABLE1" QVIEW3
)
)
) V1