Analytic function with IF ... ENDIF causes Engine crash

Details

Detail name Value
Changelog Number 17899
Type Bug
Status Resolved
Affected Versions Exasol 7.1.0, Exasol 8.0.0
Fix Versions Exasol 8.25.0, Exasol 7.1.26
Resolution Date 2024-02-15

Description

IF … ENDIF crashes with an internal server error when IF condition clause contains analytic function.

Preparation

create schema S;
create table A (A1 varchar(100));
insert into A values ('x');

Example

-- Expected: 1 row, values (NULL)
-- Observed: Internal Server Error
select
    if
        sum(count(*)) over () >= 5
    then
        A1
    endif
from A
group by A1;

Workaround

Replace the IF/ENDIF statement with CASE…END

-- Expected/Observed: 1 row, values (NULL)
select
    case when
        sum(count(*)) over () >= 5
    then
        A1
    end
from A
group by A1;

Fix

Query runs as expected.