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 4F81D90DB for ; Fri, 24 Feb 2012 20:34:12 +0000 (UTC) Received: (qmail 66804 invoked by uid 500); 24 Feb 2012 20:34:12 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 66779 invoked by uid 500); 24 Feb 2012 20:34:12 -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 66772 invoked by uid 99); 24 Feb 2012 20:34:12 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Feb 2012 20:34:12 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Feb 2012 20:34:09 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id EE719338F8C for ; Fri, 24 Feb 2012 20:33:48 +0000 (UTC) Date: Fri, 24 Feb 2012 20:33:48 +0000 (UTC) From: "Mamta A. Satoor (Updated) (JIRA)" To: derby-dev@db.apache.org Message-ID: <1510552044.16638.1330115628977.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <737112476.5962.1299615419598.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Updated] (DERBY-5111) NullPointerException on unique constraint violation with unique index 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-5111?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Mamta A. Satoor updated DERBY-5111: ----------------------------------- Urgency: Normal Labels: derby_triage10_9 (was: ) > NullPointerException on unique constraint violation with unique index > --------------------------------------------------------------------- > > Key: DERBY-5111 > URL: https://issues.apache.org/jira/browse/DERBY-5111 > Project: Derby > Issue Type: Bug > Components: SQL > Affects Versions: 10.1.3.1, 10.2.2.0, 10.3.3.0, 10.4.2.0, 10.5.3.0, 10.6.1.0, 10.6.2.1, 10.7.1.1 > Reporter: Mark La Rue > Labels: derby_triage10_9 > > Given the below DDL, violations of the unique constraint (an example follows the DDL) specified on table t1 will result in a NullPointerException that terminates the active connection. The root cause appears to be related to the unique indexes; removing them results in the correct constraint violation. > CREATE TABLE s.t0 (t0_id INTEGER NOT NULL, value VARCHAR(75) NOT NULL); > ALTER TABLE s.t0 ADD CONSTRAINT pk_1 PRIMARY KEY (t0_id); > CREATE TABLE s.t1 (t1_id INTEGER NOT NULL, t0_id INTEGER NOT NULL, value VARCHAR(75) NOT NULL); > CREATE UNIQUE INDEX s.ui_1 ON s.t1 (t1_id); > ALTER TABLE s.t1 ADD CONSTRAINT pk_2 PRIMARY KEY (t1_id); > ALTER TABLE s.t1 ADD CONSTRAINT fk_1 FOREIGN KEY (t0_id) REFERENCES s.t0 (t0_id) ON DELETE CASCADE; > CREATE UNIQUE INDEX s.ui_2 ON s.t1 (t0_id, value); > ALTER TABLE s.t1 ADD CONSTRAINT uc_1 UNIQUE (t0_id, value); > Minimal DML to trigger the constraint violation: > INSERT INTO s.t0 VALUES (0, 'foobar'); > INSERT INTO s.t1 VALUES(0, 0, 'Test'); > INSERT INTO s.t1 VALUES(1, 0, 'Test'); -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira