Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 52209 invoked from network); 14 Sep 2009 11:39:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 14 Sep 2009 11:39:21 -0000 Received: (qmail 45487 invoked by uid 500); 14 Sep 2009 11:39:20 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 45381 invoked by uid 500); 14 Sep 2009 11:39:20 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 45178 invoked by uid 99); 14 Sep 2009 11:39:20 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Sep 2009 11:39:19 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Sep 2009 11:39:17 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 87E2A234C045 for ; Mon, 14 Sep 2009 04:38:57 -0700 (PDT) Message-ID: <1712708862.1252928337542.JavaMail.jira@brutus> Date: Mon, 14 Sep 2009 04:38:57 -0700 (PDT) From: "Knut Anders Hatlen (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Updated: (DERBY-4370) Implement JOIN ... USING syntax In-Reply-To: <2069271087.1252317358238.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ 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.