Skyline queries with joins crash if they contain a joined table that is not referenced.

Details

Detail name Value
Changelog Number 4916
Type Bug
Status Resolved
Affected Versions EXASOL 6.0.2
Fix Versions EXASOL 6.0.5
Resolution Date 2017-09-28

Problem
Queries using Skyline (preferring high|low) together with joins crash if they contain a joined table that is not referenced.

How to reproduce

-- create a schema
create schema sch;

-- create enough data to ensure to be above the replication border
create table h( i int);
insert into h values 1,2,3,4,5,6,7,8,9,0;

create or replace table a (x smallint);
create or replace table b (x smallint);

insert into a select  rownum from 
	(select x.i from h x, h, h, h, h, h, (select * from h where i<=4));
insert into b select  rownum from 
	(select x.i from h x, h, h, h, h, h, (select * from h where i<=8));

-- if no column of b is referenced preferring crashes
select a.x
from a
inner join b on a.x = b.x
preferring high a.x;

Workaround
The simplest workaround is to force materialization of the join by using a subselect with ORDER BY false:

For the example above:

select x
from (
    select a.x
    from a
    inner join b on a.x = b.x
    order by false
)
preferring high x;

However, this may lead to increased memory usage due to the unfiltered materialization.