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 5CD3617D97 for ; Wed, 1 Oct 2014 20:09:36 +0000 (UTC) Received: (qmail 18057 invoked by uid 500); 1 Oct 2014 20:09:36 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 18035 invoked by uid 500); 1 Oct 2014 20:09:36 -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 18022 invoked by uid 99); 1 Oct 2014 20:09:36 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Oct 2014 20:09:36 +0000 Date: Wed, 1 Oct 2014 20:09:36 +0000 (UTC) From: "Mamta A. Satoor (JIRA)" To: derby-dev@db.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (DERBY-6269) Misleading warning text if you create an index duplicating a constraint. 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-6269?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14155409#comment-14155409 ] Mamta A. Satoor commented on DERBY-6269: ---------------------------------------- I am planning on changing the warning from WARNING 01504: The new index is a duplicate of an existing index: SQL130618085719940. to WARNING 01504: T_1 index not created because it is a duplicate of an existing index: SQL141001124533460. > Misleading warning text if you create an index duplicating a constraint. > ------------------------------------------------------------------------ > > Key: DERBY-6269 > URL: https://issues.apache.org/jira/browse/DERBY-6269 > Project: Derby > Issue Type: Bug > Components: SQL > Affects Versions: 10.11.1.1 > Reporter: Rick Hillegas > Assignee: Mamta A. Satoor > Labels: derby_triage10_11 > > If you try to create an index on a column which defines a unique constraint, the index is not created. That's fine. But you get a misleading warning suggesting that the index was created. We should correct the warning text so that it says that an index was not created. We should also consider making this situation an error, not a warning. > This issue is probably related to DERBY-655 and DERBY-1343. > Here is a script which shows this problem: > ij version 10.11 > ij> connect 'jdbc:derby:memory:db;create=true'; > ij> create table t( a int unique, b int ); > 0 rows inserted/updated/deleted > ij> -- raises a warning suggesting that a new index has been created > create index t_1 on t( a ); > 0 rows inserted/updated/deleted > WARNING 01504: The new index is a duplicate of an existing index: SQL130618085719940. > ij> -- only the heap and the constraint exist > select isIndex, conglomerateName, conglomerateID from sys.sysconglomerates c, sys.systables t > where t.tableid = c.tableid and t.tablename = 'T'; > ISIN&|CONGLOMERATENAME |CONGLOMERATEID > --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- > false|45b300a8-013f-5801-226b-000003b53310 |0ddd00a9-013f-5801-226b-000003b53310 > true |SQL130618085719940 |f55fc0a6-013f-5801-226b-000003b53310 > 2 rows selected > ij> -- fails because a new index wasn't really created > drop index t_1; > ERROR 42X65: Index 'T_1' does not exist. > ij> select isIndex, conglomerateName, conglomerateID from sys.sysconglomerates c, sys.systables t > where t.tableid = c.tableid and t.tablename = 'T'; > ISIN&|CONGLOMERATENAME |CONGLOMERATEID > --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- > false|45b300a8-013f-5801-226b-000003b53310 |0ddd00a9-013f-5801-226b-000003b53310 > true |SQL130618085719940 |f55fc0a6-013f-5801-226b-000003b53310 > 2 rows selected -- This message was sent by Atlassian JIRA (v6.3.4#6332)