Return-Path: X-Original-To: apmail-db-derby-commits-archive@www.apache.org Delivered-To: apmail-db-derby-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2FC53659D for ; Fri, 3 Jun 2011 22:33:36 +0000 (UTC) Received: (qmail 91614 invoked by uid 500); 3 Jun 2011 22:33:36 -0000 Delivered-To: apmail-db-derby-commits-archive@db.apache.org Received: (qmail 91585 invoked by uid 500); 3 Jun 2011 22:33:36 -0000 Mailing-List: contact derby-commits-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Derby Development" List-Id: Delivered-To: mailing list derby-commits@db.apache.org Received: (qmail 91575 invoked by uid 99); 3 Jun 2011 22:33:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Jun 2011 22:33:35 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Jun 2011 22:33:34 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 7418A2388A6B; Fri, 3 Jun 2011 22:33:14 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1131272 - in /db/derby/code/trunk/java: engine/org/apache/derby/iapi/sql/dictionary/ConglomerateDescriptor.java testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/BasicSetup.java Date: Fri, 03 Jun 2011 22:33:14 -0000 To: derby-commits@db.apache.org From: kmarsden@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110603223314.7418A2388A6B@eris.apache.org> Author: kmarsden Date: Fri Jun 3 22:33:14 2011 New Revision: 1131272 URL: http://svn.apache.org/viewvc?rev=1131272&view=rev Log: DERBY-5249 A table created with 10.0.2.1 with constraints cannot be dropped with 10.5 due to NullPointerException with insane build or ASSERT FAILED Failed to find sharable conglomerate descriptor for index conglomerate with sane build Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/ConglomerateDescriptor.java db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/BasicSetup.java Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/ConglomerateDescriptor.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/ConglomerateDescriptor.java?rev=1131272&r1=1131271&r2=1131272&view=diff ============================================================================== --- db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/ConglomerateDescriptor.java (original) +++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/ConglomerateDescriptor.java Fri Jun 3 22:33:14 2011 @@ -598,8 +598,15 @@ public final class ConglomerateDescripto } // Skip if ignoreThis is true and it describes "this". + // DERBY-5249. We need to check both the UUID and the + // conglomerateName to see if this is a match, because + // databases prior to the DERBY-655 fix may have a + // duplicate conglomerateID if (ignoreThis && - getUUID().equals(descriptors[i].getUUID())) + getUUID().equals(descriptors[i].getUUID()) && + getConglomerateName().equals(descriptors[i]. + getConglomerateName()) + ) { continue; } Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/BasicSetup.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/BasicSetup.java?rev=1131272&r1=1131271&r2=1131272&view=diff ============================================================================== --- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/BasicSetup.java (original) +++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/BasicSetup.java Fri Jun 3 22:33:14 2011 @@ -268,7 +268,7 @@ public class BasicSetup extends UpgradeC * test once the bug is fixed. * */ - public void xtestDropTableAfterUpgradeWithConstraint() throws SQLException { + public void testDropTableAfterUpgradeWithConstraint() throws SQLException { final int phase = getPhase(); Statement s = createStatement(); @@ -291,18 +291,20 @@ public class BasicSetup extends UpgradeC /* * With 10.0 and early 10.1 releases a duplicate conglomerate entry * shows in sys.sysconglomerates for the primary key PK_RS. It can - * be seen with this query.Utilities.showResultSet(s.executeQuery( - * "select c.constraintname, c.constraintid, cong.conglomerateid, cong.conglomeratename from sys.sysconglomerates cong, sys.syskeys k, sys.sysconstraints c where c.constraintname = 'PK_RS' and c.constraintid =k.constraintid and k.conglomerateid = cong.conglomerateid " - * )); - */ + * be seen with this query. + + Utilities.showResultSet(s.executeQuery( + "select c.constraintname, c.constraintid, cong.conglomerateid, cong.conglomeratename from sys.sysconglomerates cong, sys.syskeys k, sys.sysconstraints c where c.constraintname = 'PK_RS' and c.constraintid =k.constraintid and k.conglomerateid = cong.conglomerateid " + )); + */ break; case PH_SOFT_UPGRADE: s.executeUpdate("ALTER TABLE S.RS DROP CONSTRAINT FK_RS_TYPEID"); - s.executeUpdate("ALTER TABLE S.R_TYPE_ID ADD CONSTRAINT " - + "PK_R_TYPE_ID PRIMARY KEY (R_TYPE_ID)"); + s.executeUpdate("ALTER TABLE S.R_TYPE_ID DROP CONSTRAINT " + + "PK_R_TYPE_ID"); s.executeUpdate("ALTER TABLE S.RS DROP CONSTRAINT PK_RS"); s.executeUpdate("DROP TABLE S.RS"); - s.executeUpdate("DROP TABLE S.R_TYPE"); + s.executeUpdate("DROP TABLE S.R_TYPE_ID"); s.executeUpdate("DROP SCHEMA S RESTRICT"); break; case PH_POST_SOFT_UPGRADE: