db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kathey Marsden (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-4712) Complex nested joins problems
Date Mon, 07 Feb 2011 20:18:57 GMT

    [ https://issues.apache.org/jira/browse/DERBY-4712?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12991572#comment-12991572
] 

Kathey Marsden commented on DERBY-4712:
---------------------------------------

In porting this fix to 10.5 I noticed the final query in the reproduction gives an assertion
even with the fix on both trunk and 10.5, although the NullPointerExceptions are fixed.  Has
another issue already been filed for this or should I file one?

Below is the trace for trunk.

2011-02-07 20:15:47.640 GMT Thread[main,5,main] (XID = 325), (SESSIONID = 1), (DATABASE =
wombat), (DRDAID = null), Cleanup action starting

2011-02-07 20:15:47.640 GMT Thread[main,5,main] (XID = 325), (SESSIONID = 1), (DATABASE =
wombat), (DRDAID = null), Failed Statement is: select t0.x , t1.x , t2.x , t3.x , t4.x , t5.x
, t6.x from ((t0 right outer join (t1 right outer join (t2 left outer join (t3 left outer
join t4 on t3.x = t4.x ) on t2.x = t3.x ) on t1.x = t3.x ) on t0.x = t1.x ) left outer join
(t5 inner join t6 on t5.x = t6.x ) on t2.x = t5.x )

org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED sourceResultSetNumber expected
to be >= 0 for T2.X

	at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:162)

	at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:147)

	at org.apache.derby.impl.sql.compile.ColumnReference.generateExpression(ColumnReference.java:941)

	at org.apache.derby.impl.sql.compile.BinaryOperatorNode.generateExpression(BinaryOperatorNode.java:600)

	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1529)

	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1341)

	at org.apache.derby.impl.sql.compile.JoinNode.getJoinArguments(JoinNode.java:1604)

	at org.apache.derby.impl.sql.compile.JoinNode.generateCore(JoinNode.java:1580)

	at org.apache.derby.impl.sql.compile.JoinNode.generateCore(JoinNode.java:1517)

	at org.apache.derby.impl.sql.compile.HalfOuterJoinNode.generate(HalfOuterJoinNode.java:691)

	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1390)

	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1341)

	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1485)

	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1341)

	at org.apache.derby.impl.sql.compile.ScrollInsensitiveResultSetNode.generate(ScrollInsensitiveResultSetNode.java:109)

	at org.apache.derby.impl.sql.compile.CursorNode.generate(CursorNode.java:629)

	at org.apache.derby.impl.sql.compile.StatementNode.generate(StatementNode.java:347)

	at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:449)

	at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:88)

	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:909)

	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:606)

	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:555)

	at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:329)

	at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:505)

	at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:347)

	at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:245)

	at org.apache.derby.impl.tools.ij.Main.go(Main.java:217)

	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:184)

	at org.apache.derby.impl.tools.ij.Main.main(Main.java:75)

	at org.apache.derby.tools.ij.main(ij.java:59)

---------------


> Complex nested joins problems
> -----------------------------
>
>                 Key: DERBY-4712
>                 URL: https://issues.apache.org/jira/browse/DERBY-4712
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.0.2.1, 10.1.1.0, 10.1.2.1, 10.1.3.1, 10.2.1.6, 10.2.2.0, 10.3.1.4,
10.3.2.1, 10.3.3.0, 10.4.1.3, 10.4.2.0, 10.5.1.1, 10.5.2.0, 10.5.3.0, 10.6.1.0
>            Reporter: Thomas Mueller
>            Assignee: Kathey Marsden
>            Priority: Minor
>             Fix For: 10.6.2.1, 10.7.1.1
>
>         Attachments: assert-bind-opt-trees.log, assert-bind-opt-trees.txt, derby.log.analyzed,
derby.log.simpler, derby4712a.diff, derby4712a.stat, derby4712b.diff, drawing.txt
>
>
> I ran a randomized test for nested joins against PostgreSQL, Derby, and H2, and found
some problems with Derby. The queries below throw NullPointerExceptions; the last query an
assertion. The test case is here: http://code.google.com/p/h2database/source/browse/trunk/h2/src/test/org/h2/test/db/TestNestedJoins.java
. There are probably shorter queries that are problematic, but I can't test it because Derby
closes the connection after the assertion.
> create table t0(x int);
> create table t1(x int);
> create table t2(x int);
> create table t3(x int);
> create table t4(x int);
> insert into t4 values(0);
> insert into t4 values(1);
> insert into t4 values(2);
> insert into t4 values(3);
> create table t5(x int);
> insert into t5 values(0);
> insert into t5 values(1);
> insert into t5 values(2);
> insert into t5 values(3);
> insert into t5 values(4);
> create table t6(x int);
> insert into t6 values(0);
> insert into t6 values(1);
> insert into t6 values(2);
> insert into t6 values(3);
> insert into t6 values(4);
> insert into t6 values(5);
> create table t7(x int);
> insert into t7 values(0);
> insert into t7 values(1);
> insert into t7 values(2);
> insert into t7 values(3);
> insert into t7 values(4);
> insert into t7 values(5);
> insert into t7 values(6);
> create table t8(x int);
> insert into t8 values(0);
> insert into t8 values(1);
> insert into t8 values(2);
> insert into t8 values(3);
> insert into t8 values(4);
> insert into t8 values(5);
> insert into t8 values(6);
> insert into t8 values(7);
> create table t9(x int);
> insert into t9 values(0);
> insert into t9 values(1);
> insert into t9 values(2);
> insert into t9 values(3);
> insert into t9 values(4);
> insert into t9 values(5);
> insert into t9 values(6);
> insert into t9 values(7);
> insert into t9 values(8);
> insert into t0 values(1);
> insert into t1 values(2);
> insert into t0 values(3);
> insert into t1 values(3);
> insert into t2 values(4);
> insert into t0 values(5);
> insert into t2 values(5);
> insert into t1 values(6);
> insert into t2 values(6);
> insert into t0 values(7);
> insert into t1 values(7);
> insert into t2 values(7);
> insert into t3 values(8);
> insert into t0 values(9);
> insert into t3 values(9);
> insert into t1 values(10);
> insert into t3 values(10);
> insert into t0 values(11);
> insert into t1 values(11);
> insert into t3 values(11);
> insert into t2 values(12);
> insert into t3 values(12);
> insert into t0 values(13);
> insert into t2 values(13);
> insert into t3 values(13);
> insert into t1 values(14);
> insert into t2 values(14);
> insert into t3 values(14);
> insert into t0 values(15);
> insert into t1 values(15);
> insert into t2 values(15);
> insert into t3 values(15);
> select t0.x , t1.x , t2.x , t3.x , t4.x , t5.x , t6.x , t7.x , t8.x from (((t0 inner
join ((t1 right outer join (t2 inner join t3 on t2.x = t3.x ) on t1.x = t2.x ) left outer
join (t4 inner join t5 on t4.x = t5.x ) on t1.x = t4.x ) on t0.x = t2.x ) left outer join
(t6 inner join t7 on t6.x = t7.x ) on t1.x = t6.x ) inner join t8 on t5.x = t8.x );
> select t0.x , t1.x , t2.x , t3.x , t4.x , t5.x , t6.x , t7.x from ((t0 right outer join
t1 on t0.x = t1.x ) inner join (((t2 inner join (t3 left outer join t4 on t3.x = t4.x ) on
t2.x = t3.x ) right outer join t5 on t2.x = t5.x ) left outer join (t6 inner join t7 on t6.x
= t7.x ) on t4.x = t6.x ) on t0.x = t5.x );
> select t0.x , t1.x , t2.x , t3.x , t4.x , t5.x , t6.x , t7.x from ((((t0 left outer join
t1 on t0.x = t1.x ) right outer join t2 on t0.x = t2.x ) right outer join t3 on t0.x = t3.x
) inner join ((t4 inner join t5 on t4.x = t5.x ) right outer join (t6 right outer join t7
on t6.x = t7.x ) on t4.x = t6.x ) on t1.x = t4.x );
> select t0.x , t1.x , t2.x , t3.x , t4.x , t5.x from (((t0 inner join t1 on t0.x = t1.x
) right outer join (t2 right outer join t3 on t2.x = t3.x ) on t0.x = t2.x ) inner join (t4
left outer join t5 on t4.x = t5.x ) on t1.x = t4.x );
> select t0.x , t1.x , t2.x , t3.x , t4.x , t5.x , t6.x from ((t0 right outer join (t1
right outer join (t2 left outer join (t3 left outer join t4 on t3.x = t4.x ) on t2.x = t3.x
) on t1.x = t3.x ) on t0.x = t1.x ) left outer join (t5 inner join t6 on t5.x = t6.x ) on
t2.x = t5.x );

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message