db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-4380) SOME not allowed in ON clause
Date Mon, 16 Nov 2009 13:55:39 GMT

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

Knut Anders Hatlen commented on DERBY-4380:
-------------------------------------------

JoinNode.deferredBindExpressions() binds the expression in the ON
clause twice, and after the second time it's bound, some parts of the
tree use the BaseColumnNodes generated the first time, and others use
those generated the second time. I believe this is the inconsistency
that leads to a NullPointerException when the statement is executed.

The double binding is done in order to raise the correct/expected
exceptions, it seems. If I remove one of them, the NPE goes away, but
some statements that are supposed to fail change behaviour (either
they stop failing, or they fail with a different error message,
depending on which of the two calls to bindExpression() is commented
out). It seems like the double binding is partly there to harmonize SQL
states with those raised by DB2.

> SOME not allowed in ON clause
> -----------------------------
>
>                 Key: DERBY-4380
>                 URL: https://issues.apache.org/jira/browse/DERBY-4380
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>            Reporter: Bernt M. Johnsen
>         Attachments: on_subquery.diff
>
>
> SOME is not allowed in ON-clause:
> ij> create table t1 (i integer);
> 0 rows inserted/updated/deleted
> ij> create table t2 (i integer);
> 0 rows inserted/updated/deleted
> ij> create table t3 (i integer);
> 0 rows inserted/updated/deleted
> ij> insert into t1 values (1);
> 1 row inserted/updated/deleted
> ij> insert into t2 values (2);
> 1 row inserted/updated/deleted
> ij> insert into t3 values 2,3,4;
> 3 rows inserted/updated/deleted
> ij> select * from t1 where t1.i = some (select i from t3);
> I          
> -----------
> 0 rows selected
> ij> select * from t1 inner join t2 on  t1.i = some (select i from t3);
> ERROR 42972: An ON clause associated with a JOIN operator is not valid.
> ij> 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message