Internal server error for UNION ALL with constants in IN-subselect

Details

Detail name Value
Changelog Number 7964
Type Bug
Status Resolved
Affected Versions Exasol 6.1.0, Exasol 6.2.0, Exasol 7.0.0, Exasol 7.0.1, Exasol 7.0.2
Fix Versions Exasol 7.0.3
Resolution Date 2020-10-15

Description

An internal server error may be reported under the following circumstances:

  • The query contains an IN-subselect-clause
  • That IN-subselect-clause directly contains an UNION ALL
  • The UNION ALL only selects constants, no tables columns or similar

Example

SELECT * FROM (SELECT 1 v UNION ALL SELECT 2 v)
WHERE v IN (SELECT 1 UNION ALL SELECT 2);

Workaround

You can simply put a subselect around the UNION ALL within the IN clause:

SELECT 1 FROM (SELECT 1 v UNION ALL SELECT 2 v)
WHERE v IN (SELECT * FROM (SELECT 1 UNION ALL SELECT 2));

Fix

The query will run successfully.