Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 16202 invoked from network); 28 May 2010 19:38:02 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 28 May 2010 19:38:02 -0000 Received: (qmail 54134 invoked by uid 500); 28 May 2010 19:38:01 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 54025 invoked by uid 500); 28 May 2010 19:38:01 -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 54010 invoked by uid 99); 28 May 2010 19:38:01 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 May 2010 19:38:01 +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.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 May 2010 19:37:58 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o4SJbaYw012781 for ; Fri, 28 May 2010 19:37:37 GMT Message-ID: <15205099.56911275075456870.JavaMail.jira@thor> Date: Fri, 28 May 2010 15:37:36 -0400 (EDT) From: "Mamta A. Satoor (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Commented: (DERBY-4677) SYSCS_COMPRESS_TABLE disables unique constraints In-Reply-To: <10523012.25771274756844851.JavaMail.jira@thor> 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-4677?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12873123#action_12873123 ] Mamta A. Satoor commented on DERBY-4677: ---------------------------------------- I see that this fails even with 10.4.2.1 Prior to 10.4, it was to define a unique constraint, one also was required to define it not null column. So, the above test case does not work prior to 10.4 unless the create table is defined as CREATE TABLE TABLE1(NAME1 INT UNIQUE NOT NULL); But starting with 10.4, the above test case indeed fails. It has something to do with allow a column to be unique without requiring it to be non-null. Haven't looked at the cause of failure in the code yet. > SYSCS_COMPRESS_TABLE disables unique constraints > ------------------------------------------------ > > Key: DERBY-4677 > URL: https://issues.apache.org/jira/browse/DERBY-4677 > Project: Derby > Issue Type: Bug > Affects Versions: 10.4.2.1, 10.5.1.1, 10.5.3.0, 10.6.1.0 > Environment: Output of sysinfo: > ------------------ Java Information ------------------ > Java Version: 1.6.0_20 > Java Vendor: Sun Microsystems Inc. > Java home: C:\Program Files (x86)\Java\jre6 > Java classpath: .;C:\Program Files (x86)\Java\jre6\lib\ext\QTJava.zip;C:\Users\BMASON\Sandbox\libs\db-derby-10.6.1.0-bin\bin\../lib/derby.jar;C:\Users\BMASON\Sandbox\libs\db-derby-10.6.1.0-bin\bin\../lib/derbynet.jar;C:\Users\BMASON\Sandbox\libs\db-derby-10.6.1.0-bin\bin\../lib/derbyclient.jar;C:\Users\BMASON\Sandbox\libs\db-derby-10.6.1.0-bin\bin\../lib/derbytools.jar > OS name: Windows 7 > OS architecture: x86 > OS version: 6.1 > Java user name: bmason > Java user home: C:\Users\BMASON > Java user dir: C:\Users\BMASON\Sandbox\libs\db-derby-10.6.1.0-bin\bin > java.specification.name: Java Platform API Specification > java.specification.version: 1.6 > java.runtime.version: 1.6.0_20-b02 > --------- Derby Information -------- > JRE - JDBC: Java SE 6 - JDBC 4.0 > [C:\Users\BMASON\Sandbox\libs\db-derby-10.6.1.0-bin\lib\derby.jar] 10.6.1.0 - (938214) > [C:\Users\BMASON\Sandbox\libs\db-derby-10.6.1.0-bin\lib\derbytools.jar] 10.6.1.0 - (938214) > [C:\Users\BMASON\Sandbox\libs\db-derby-10.6.1.0-bin\lib\derbynet.jar] 10.6.1.0 - (938214) > [C:\Users\BMASON\Sandbox\libs\db-derby-10.6.1.0-bin\lib\derbyclient.jar] 10.6.1.0 - (938214) > ------------------------------------------------------ > ----------------- Locale Information ----------------- > Current Locale : [English/New Zealand [en_NZ]] > Found support for locale: [cs] > version: 10.6.1.0 - (938214) > Found support for locale: [de_DE] > version: 10.6.1.0 - (938214) > Found support for locale: [es] > version: 10.6.1.0 - (938214) > Found support for locale: [fr] > version: 10.6.1.0 - (938214) > Found support for locale: [hu] > version: 10.6.1.0 - (938214) > Found support for locale: [it] > version: 10.6.1.0 - (938214) > Found support for locale: [ja_JP] > version: 10.6.1.0 - (938214) > Found support for locale: [ko_KR] > version: 10.6.1.0 - (938214) > Found support for locale: [pl] > version: 10.6.1.0 - (938214) > Found support for locale: [pt_BR] > version: 10.6.1.0 - (938214) > Found support for locale: [ru] > version: 10.6.1.0 - (938214) > Found support for locale: [zh_CN] > version: 10.6.1.0 - (938214) > Found support for locale: [zh_TW] > version: 10.6.1.0 - (938214) > ------------------------------------------------------ > Reporter: Brett Mason > > It appears that running SYSCS_UTIL.SYSCS_COMPRESS_TABLE on a table with a null-able unique constraint will disable the unique constraint. The script > below should reproduce the problem. The expected behaviour is for the second insert to fail due to the unique constraint but instead it is allowed. The second insert will fail as expected if either the call to SYSCS_COMPRESS_TABLE is skipped or if the column is declared NOT NULL. > I have reproduced the problem using embedded Derby 10.5.1.1, 10.5.3.0 and 10.6.1.0 using ij. > CREATE TABLE TABLE1(NAME1 INT UNIQUE); > CALL SYSCS_UTIL.SYSCS_COMPRESS_TABLE('APP', 'TABLE1', 1); > INSERT INTO TABLE1(NAME1) VALUES(1); > INSERT INTO TABLE1(NAME1) VALUES(1); > SELECT * FROM TABLE1; > DROP TABLE TABLE1; -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.