Correlated scalar subselect using literal projected from outer select throws unexpected exception

Details

Detail name Value
Changelog Number 17738
Type Bug
Status Resolved
Affected Versions Exasol 8.0.0, Exasol 8.29.0, Exasol 2025.1.0, Exasol 2025.2.0
Fix Versions Exasol 2026.1.0, Exasol 2025.2.1, Exasol 2025.1.11
Resolution Date 2026-03-20

Description

Correlated subselects in select list or in where clause using literal projected from outer select throw unexpected exception.

Preparation

create schema s;
create table A (A1 int, A2 int);

Example

Following queries throw exception "tables are not allowed in this context"

select * from (select 100 as V1)
where 0 = (select count(*) from A where V1 = A1);

select (select A1 from A where A1 = V1) from (select 100 as V1);

Workaround

Add ORDER BY FALSE on the outer SELECT to trigger a materialization of the SELECT in the compiler.

select * from (select 100 as V1 order by false)
where 0 = (select count(*) from A where V1 = A1);

select (select A1 from A where A1 = V1) from (select 100 as V1 order by false);

Fix

Query runs as expected.