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] Updated: (DERBY-4370) Implement JOIN ... USING syntax
Date Mon, 14 Sep 2009 11:38:57 GMT

     [ https://issues.apache.org/jira/browse/DERBY-4370?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Knut Anders Hatlen updated DERBY-4370:
--------------------------------------

    Attachment: using_v2.stat
                using_v2.diff

Uploading an updated patch (v2). Changes from the previous revision:

- Fixed the NPE when referencing non-common columns in the USING clause. This condition was
probably detected earlier originally when the USING code was written and thereby preventing
that the code that threw NPE was reached. Now columns out of scope are detected very late
in the bind phase (in JoinNode.deferredBindExpressions(), see also DERBY-4284 and DERBY-2916
for other issues related to late binding in JoinNode). The fix was simple: just check the
value returned by getResultColumn(columnName) in ResultColumnList.getJoinColumns() and raise
a StandardException if it's null.

- Added various test cases for USING in JoinTest. Verified that PostgreSQL gave the same results
(except for the case with asterisks with table qualifiers, as discussed above).

- Removed negative test case from lang/db2Compatibility.sql.

- Updated canon for lang/innerjoin.sql because the message (not the SQLState) for a syntax
error was changed for a negative test case because of the grammar changes.

All the regression tests ran cleanly with the patch.

> Implement JOIN ... USING syntax
> -------------------------------
>
>                 Key: DERBY-4370
>                 URL: https://issues.apache.org/jira/browse/DERBY-4370
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 10.6.0.0
>            Reporter: Knut Anders Hatlen
>            Priority: Minor
>         Attachments: using.diff, using_v2.diff, using_v2.stat
>
>
> The SQL standard defines two ways to specify the join condition in an INNER JOIN or a
(LEFT/RIGHT/FULL) OUTER JOIN: with an ON clause or with a USING clause. Derby currently only
accepts joins with an ON clause. Internally, Derby has code that supports USING. This code
should be enabled to ease the migration to Derby. We must also verify that the implementation
adheres to the standard before we enable it.
> Since USING is already a reserved keyword in Derby's parser, enabling the USING syntax
should not cause any compatibility issues for existing queries.

-- 
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