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 7AE2711ABC for ; Mon, 28 Jul 2014 20:53:40 +0000 (UTC) Received: (qmail 8720 invoked by uid 500); 28 Jul 2014 20:53:40 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 8693 invoked by uid 500); 28 Jul 2014 20:53:40 -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 8681 invoked by uid 99); 28 Jul 2014 20:53:40 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Jul 2014 20:53:40 +0000 Date: Mon, 28 Jul 2014 20:53:40 +0000 (UTC) From: "Dag H. Wanvik (JIRA)" To: derby-dev@db.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (DERBY-6665) Violation of deferred constraints not detected when conglomerates are erroneously shared 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-6665?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Dag H. Wanvik updated DERBY-6665: --------------------------------- Summary: Violation of deferred constraints not detected when conglomerates are erroneously shared (was: Violation of deferred constraints not detected when conglomerates are shared) > Violation of deferred constraints not detected when conglomerates are erroneously shared > ---------------------------------------------------------------------------------------- > > Key: DERBY-6665 > URL: https://issues.apache.org/jira/browse/DERBY-6665 > Project: Derby > Issue Type: Bug > Components: SQL > Affects Versions: 10.11.0.0 > Reporter: Knut Anders Hatlen > Attachments: braindump.diff, derby-6665-01-aa-remove-uniquePKConstraintModes.diff, derby-6665-01-ab-useTableUUIDforCheckConstraints.diff, derby-6665-01-ac-unpositionedScan.diff, derby-6665-01-ad-import-and-unique.diff, derby-6665-01-ae-deferredCheckAndDroppedFK.diff, derby-6665-dhw-dont-share.diff, junit.diff > > > See the following script: > {noformat} > ij version 10.11 > ij> connect 'jdbc:derby:memory:db;create=true'; > ij> create table t1(x int primary key); > 0 rows inserted/updated/deleted > ij> create table t2(x int primary key); > 0 rows inserted/updated/deleted > ij> create table t3(x int, constraint fk1 foreign key (x) references t1 initially deferred, constraint fk2 foreign key (x) references t2 initially deferred); > 0 rows inserted/updated/deleted > ij> insert into t1 values 1; > 1 row inserted/updated/deleted > ij> autocommit off; > ij> insert into t3 values 1; > 1 row inserted/updated/deleted > ij> insert into t2 values 1; > 1 row inserted/updated/deleted > ij> delete from t1; > 1 row inserted/updated/deleted > ij> commit; > ij> select * from t1; > X > ----------- > 0 rows selected > ij> select * from t2; > X > ----------- > 1 > 1 row selected > ij> select * from t3; > X > ----------- > 1 > 1 row selected > {noformat} > Since T3.X contains a value (1) that is not present in T1, the foreign key FK1 is violated, and the COMMIT statement should have failed. -- This message was sent by Atlassian JIRA (v6.2#6252)