Return-Path: X-Original-To: apmail-db-derby-dev-archive@www.apache.org Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id ED9A210E8F for ; Tue, 15 Oct 2013 14:06:42 +0000 (UTC) Received: (qmail 55423 invoked by uid 500); 15 Oct 2013 14:06:42 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 55392 invoked by uid 500); 15 Oct 2013 14:06:42 -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 55366 invoked by uid 99); 15 Oct 2013 14:06:42 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Oct 2013 14:06:42 +0000 Date: Tue, 15 Oct 2013 14:06:42 +0000 (UTC) From: "Knut Anders Hatlen (JIRA)" To: derby-dev@db.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (DERBY-534) Support use of the WHEN clause in CREATE TRIGGER statements MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DERBY-534?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Knut Anders Hatlen updated DERBY-534: ------------------------------------- Attachment: derby-534-12-a-subquery-npe.diff Attaching derby-534-12-a-subquery-npe.diff which fixes the NPE exposed by the 03 patch. The NPE happened in GenericStatementContext.setTopResultSet() while copying materialized subqueries over to the new subquery tracking array in a for loop. As far as I can tell, the intention of the for loop is to copy every non-null element in the materializedSubqueries array to the new subquery tracking array. However, instead of checking that the element in materializedSubqueries is non-null, it checks that the element at the given index position on the old subquery tracking array is non-null. The NPE is thrown because the old subquery tracking array is null. This is old code, so it may be possible to construct a test case that makes it fail even without a WHEN clause. I haven't been able to do that so far, though. According to the test coverage reports, the line that fails with an NPE is only partially covered: https://builds.apache.org/job/Derby-JaCoCo/lastSuccessfulBuild/artifact/coverage-report/org.apache.derby.impl.sql.conn/GenericStatementContext.java.html#L356 The patch enables the previously disabled test case added by the 03 patch. It also adds some more test cases with scalar subqueries in the WHEN clause. All regression tests ran cleanly with the patch. > Support use of the WHEN clause in CREATE TRIGGER statements > ----------------------------------------------------------- > > Key: DERBY-534 > URL: https://issues.apache.org/jira/browse/DERBY-534 > Project: Derby > Issue Type: Improvement > Components: SQL > Reporter: Kristian Waagan > Assignee: Knut Anders Hatlen > Priority: Minor > Labels: derby_triage10_11 > Attachments: derby-534-01-a-syntax.diff, derby-534-02-a-refactor.diff, derby-534-03-a-npe-testcase.diff, derby-534-04-a-referencing.diff, derby-534-05-a-generated-cols.diff, derby-534-06-a-temptables.diff, derby-534-07-a-more-restrictions.diff, derby-534-08-a-test-invalidation.diff, derby-534-09-a-drop-column-deps.diff, derby-534-09-b-drop-column-deps.diff, derby-534-10-a-get-sps.diff, derby-534-11-a-more-tests.diff, derby-534-12-a-subquery-npe.diff, parser.diff, WhenClause.html, WhenClause.html, WhenClause.html, WhenClause.html > > > Support use of the WHEN clause in CREATE TRIGGER statements. The clause is described in the SQL standard (2003) in chapter "11.39 " under "". > There are traces in the code that suggests some work has been done on this earlier. If anyone knows something about this, please add a comment to this issue. -- This message was sent by Atlassian JIRA (v6.1#6144)