dynamobi/dynamobi — Issue #541: [FRG-331] when a UDX restarts, it should also be restarting any cursor inputs
Author: dynamobi-build
Created: 2011-12-30 03:34:22+00:00
State: open
Labels: FRG, UDF

[reporter="jvs", created="Wed, 13 Aug 2008 20:19:43 -0500 (GMT-05:00)"]
Repro...

create schema x;

set schema 'x';

set path 'x';

-- need one lead UDX

create function ramp(n int)

returns table(i int)

language java

parameter style system defined java

no sql

external name 'class net.sf.farrago.test.FarragoTestUDR.ramp';

-- also need a UDX which takes cursor input (any one will do)

create function uniq(c cursor)

returns table(c.*)

language java

parameter style system defined java

no sql

external name

'class net.sf.farrago.test.FarragoTestUDR.removeDupsFromPresortedCursor';

-- use LucidDB optimizer to avoid buffering on the cartesian join RHS

-- (since that would cover up the bug)

alter session implementation set jar sys_boot.sys_boot.luciddb_plugin;

-- this incorrectly returns 20 instead of 200, because the restart on the RHS fails to restart the sorter

select count(*) from

(select * from table(uniq(cursor(select * from table(ramp(10)) order by 1)))),

(select * from table(uniq(cursor(select * from table(ramp(20)) order by 1))));