dynamobi/dynamobi — Issue #759: [FRG-111] cast for index join should not cause error on overflow
Author: dynamobi-build
Created: 2011-12-30 03:47:27+00:00
State: open
Labels: FRG

[reporter="jvs", created="Fri, 21 Apr 2006 18:41:36 -0500 (GMT-05:00)"]

Here's a simple test in FTRS. If you do the same thing in LCS, it'll use semijoins and hit the same problem.

create table f1(a int primary key, b int);

create table f2(a smallint primary key, b smallint);

create index if2 on f2(b);

insert into f1 values(1, 100000);

insert into f2 values(1, 1);

select * from f2, f1 where f2.b = f1.b;

Here's the error and the stack:

Error: could not calculate results for the following row:

[ 1, 100000 ]

Messages:

[0]:PC=0 Code=22003 (state=,code=0)

net.sf.farrago.jdbc.FarragoJdbcUtil$FarragoSqlException: could not calculate results for the following row:

[ 1, 100000 ]

Messages:

[0]:PC=0 Code=22003

at net.sf.farrago.resource.FarragoResource$_Def0.ex(FarragoResource.java:1232)

at net.sf.farrago.fennel.FennelDbHandle.handleNativeException(FennelDbHandle.java:321)

at net.sf.farrago.fennel.FennelStreamGraph.fetch(FennelStreamGraph.java:179)

at net.sf.farrago.runtime.FennelTupleIter.populateBuffer(FennelTupleIter.java:110)

at net.sf.farrago.runtime.FennelAbstractTupleIter.fetchNext(FennelAbstractTupleIter.java:99)

at org.eigenbase.runtime.TupleIterResultSet.next(TupleIterResultSet.java:90)

at net.sf.farrago.runtime.FarragoTupleIterResultSet.next(FarragoTupleIterResultSet.java:97)

at sqlline.SqlLine$BufferedRows.(Unknown Source)

at sqlline.SqlLine.print(Unknown Source)

at sqlline.SqlLine$Commands.execute(Unknown Source)

at sqlline.SqlLine$Commands.sql(Unknown Source)

at sqlline.SqlLine.dispatch(Unknown Source)

at sqlline.SqlLine.begin(Unknown Source)

at sqlline.SqlLine.mainWithInputRedirection(Unknown Source)

at sqlline.SqlLine.main(Unknown Source)

If you drop the index if2, then the select works. Note there seems to be some non-deterministic behavior in Volcano, as sometimes, I had to reverse the order of the tables in the from clause to get it to pick the index scan for the join.