MERGE statement using joined table reference causes internal server error

Details

Detail name Value
Changelog Number 6356
Type Bug
Status Open
Affected Versions Exasol 6.1.0, EXASOL 6.0.5, Exasol 6.2.0, Exasol 7.0.0, Exasol 7.1.0, Exasol 8.0.0

Some MERGE statements cause an internal server error. This happens, if the statement contains a JOIN between USING and ON which is not part of a subquery.

Example

MERGE INTO t1
USING (t2 JOIN t3 ON t2.c = t3.c) ON t1.c = t2.c
WHEN NOT MATCHED THEN INSERT VALUES (1)

Rewrite the statement by replacing the joined table reference behind "USING" with a subselect:

MERGE INTO t1
USING (SELECT t2.c FROM t2 JOIN t3 ON t2.c = t3.c) AS sub ON t1.c = sub.c
WHEN NOT MATCHED THEN INSERT VALUES (1)