Query abort instead of error message when ROWNUM is used in GROUP BY along with EXISTS in WHERE clause

Details

Detail name Value
Changelog Number 4518
Type Bug
Status Resolved
Affected Versions EXASOL 6.0.0, EXASolution 5.0.17, Exasol 6.1.3
Fix Versions Exasol 6.2.0, Exasol 6.1.4
Resolution Date 2019-06-12

EXASOL does not support use of ROWNUM in GROUP BY clause in following cases,

  • when EXISTS predicate is used in the WHERE clause. 
  • when IN predicate with correlated subselect is used in the WHERE clause.

This condition was not checked and would lead to a query abort instead of an exception. 

How to reproduce

create or replace table a as (values(1) as t(x));
create or replace table b as (values(1) as t(x));

select 1 a from	a 
where exists(select * from b where a.x = b.x)
group by rownum;

select 1 a from a where 
1 in (select * from b where a.x = b.x) 
group by rownum;

As this query is unsupported, we do not offer a workaround here.

In the future we will create the exception instead of an internal server error.