db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From banda...@apache.org
Subject svn commit: r411398 - in /db/derby/code/branches/10.1/java: engine/org/apache/derby/impl/sql/execute/ testing/org/apache/derbyTesting/functionTests/master/ testing/org/apache/derbyTesting/functionTests/master/DerbyNet/ testing/org/apache/derbyTesting/f...
Date Sat, 03 Jun 2006 07:20:23 GMT
Author: bandaram
Date: Sat Jun  3 00:20:22 2006
New Revision: 411398

URL: http://svn.apache.org/viewvc?rev=411398&view=rev
Log:
DERBY-655: Generate unique logical conglomerateId for duplicate indexes, instead of just reusing
existing conglomerateId.

Submitted by Mamta A. Satoor(msatoor@gmail.com)


Modified:
    db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/CreateIndexConstantAction.java
    db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/metadata.out
    db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/odbc_metadata.out
    db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/metadata.out
    db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/odbc_metadata.out
    db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/metadata.out
    db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/odbc_metadata.out
    db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/metadata_test.java

Modified: db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/CreateIndexConstantAction.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/CreateIndexConstantAction.java?rev=411398&r1=411397&r2=411398&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/CreateIndexConstantAction.java
(original)
+++ db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/CreateIndexConstantAction.java
Sat Jun  3 00:20:22 2006
@@ -353,9 +353,12 @@
 					return;
 				}
 
+				//Duplicate indexes share the physical conglomerate underneath
 				conglomId = cd.getConglomerateNumber();
 				indexRowGenerator = cd.getIndexDescriptor();
-				conglomerateUUID = cd.getUUID();
+				//DERBY-655 and DERBY-1343  
+				//Duplicate indexes will have unqiue logical conglomerate UUIDs.  
+				conglomerateUUID = dd.getUUIDFactory().createUUID();
 				duplicate = true;
 				break;
 			}

Modified: db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/metadata.out
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/metadata.out?rev=411398&r1=411397&r2=411398&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/metadata.out
(original)
+++ db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/metadata.out
Sat Jun  3 00:20:22 2006
@@ -476,4 +476,7 @@
 defval for col C5 type CHAR DEFAULT 'NULL' wasnull false
 defval for col C6 type CHAR DEFAULT ''NULL'' wasnull false
 defval for col C7 type INTEGER DEFAULT '88' wasnull false
+getImportedKeys('',null,null,'','APP','Derby655t1' ):
+PKTABLE_CAT[VARCHAR],PKTABLE_SCHEM[VARCHAR],PKTABLE_NAME[VARCHAR],PKCOLUMN_NAME[VARCHAR],FKTABLE_CAT[VARCHAR],FKTABLE_SCHEM[VARCHAR],FKTABLE_NAME[VARCHAR],FKCOLUMN_NAME[VARCHAR],KEY_SEQ[SMALLINT],UPDATE_RULE[SMALLINT],DELETE_RULE[SMALLINT],FK_NAME[VARCHAR],PK_NAME[VARCHAR],DEFERRABILITY[SMALLINT]
+,APP,DERBY655T2,C21_ID,,APP,DERBY655T1,C11_ID,1,3,0,F_12,xxxxGENERATED-IDxxxx,7
 Test metadata finished

Modified: db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/odbc_metadata.out
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/odbc_metadata.out?rev=411398&r1=411397&r2=411398&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/odbc_metadata.out
(original)
+++ db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/odbc_metadata.out
Sat Jun  3 00:20:22 2006
@@ -507,4 +507,7 @@
 defval for col C5 type CHAR DEFAULT 'NULL' wasnull false
 defval for col C6 type CHAR DEFAULT ''NULL'' wasnull false
 defval for col C7 type INTEGER DEFAULT '88' wasnull false
+getImportedKeys('',null,null,'','APP','Derby655t1' ):
+PKTABLE_CAT[VARCHAR],PKTABLE_SCHEM[VARCHAR],PKTABLE_NAME[VARCHAR],PKCOLUMN_NAME[VARCHAR],FKTABLE_CAT[VARCHAR],FKTABLE_SCHEM[VARCHAR],FKTABLE_NAME[VARCHAR],FKCOLUMN_NAME[VARCHAR],KEY_SEQ[SMALLINT],UPDATE_RULE[SMALLINT],DELETE_RULE[SMALLINT],FK_NAME[VARCHAR],PK_NAME[VARCHAR],DEFERRABILITY[SMALLINT]
+,APP,DERBY655T2,C21_ID,,APP,DERBY655T1,C11_ID,1,3,0,F_12,xxxxGENERATED-IDxxxx,7
 Test metadata finished

Modified: db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/metadata.out
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/metadata.out?rev=411398&r1=411397&r2=411398&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/metadata.out
(original)
+++ db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/metadata.out
Sat Jun  3 00:20:22 2006
@@ -476,4 +476,7 @@
 defval for col C5 type CHAR DEFAULT 'NULL' wasnull false
 defval for col C6 type CHAR DEFAULT ''NULL'' wasnull false
 defval for col C7 type INTEGER DEFAULT '88' wasnull false
+getImportedKeys('',null,null,'','APP','Derby655t1' ):
+PKTABLE_CAT[VARCHAR],PKTABLE_SCHEM[VARCHAR],PKTABLE_NAME[VARCHAR],PKCOLUMN_NAME[VARCHAR],FKTABLE_CAT[VARCHAR],FKTABLE_SCHEM[VARCHAR],FKTABLE_NAME[VARCHAR],FKCOLUMN_NAME[VARCHAR],KEY_SEQ[SMALLINT],UPDATE_RULE[SMALLINT],DELETE_RULE[SMALLINT],FK_NAME[VARCHAR],PK_NAME[VARCHAR],DEFERRABILITY[SMALLINT]
+,APP,DERBY655T2,C21_ID,,APP,DERBY655T1,C11_ID,1,3,0,F_12,xxxxGENERATED-IDxxxx,7
 Test metadata finished

Modified: db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/odbc_metadata.out
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/odbc_metadata.out?rev=411398&r1=411397&r2=411398&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/odbc_metadata.out
(original)
+++ db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/odbc_metadata.out
Sat Jun  3 00:20:22 2006
@@ -507,4 +507,7 @@
 defval for col C5 type CHAR DEFAULT 'NULL' wasnull false
 defval for col C6 type CHAR DEFAULT ''NULL'' wasnull false
 defval for col C7 type INTEGER DEFAULT '88' wasnull false
+getImportedKeys('',null,null,'','APP','Derby655t1' ):
+PKTABLE_CAT[VARCHAR],PKTABLE_SCHEM[VARCHAR],PKTABLE_NAME[VARCHAR],PKCOLUMN_NAME[VARCHAR],FKTABLE_CAT[VARCHAR],FKTABLE_SCHEM[VARCHAR],FKTABLE_NAME[VARCHAR],FKCOLUMN_NAME[VARCHAR],KEY_SEQ[SMALLINT],UPDATE_RULE[SMALLINT],DELETE_RULE[SMALLINT],FK_NAME[VARCHAR],PK_NAME[VARCHAR],DEFERRABILITY[SMALLINT]
+,APP,DERBY655T2,C21_ID,,APP,DERBY655T1,C11_ID,1,3,0,F_12,xxxxGENERATED-IDxxxx,7
 Test metadata finished

Modified: db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/metadata.out
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/metadata.out?rev=411398&r1=411397&r2=411398&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/metadata.out
(original)
+++ db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/metadata.out
Sat Jun  3 00:20:22 2006
@@ -476,4 +476,7 @@
 defval for col C5 type CHAR DEFAULT 'NULL' wasnull false
 defval for col C6 type CHAR DEFAULT ''NULL'' wasnull false
 defval for col C7 type INTEGER DEFAULT '88' wasnull false
+getImportedKeys('',null,null,'','APP','Derby655t1' ):
+PKTABLE_CAT[VARCHAR],PKTABLE_SCHEM[VARCHAR],PKTABLE_NAME[VARCHAR],PKCOLUMN_NAME[VARCHAR],FKTABLE_CAT[VARCHAR],FKTABLE_SCHEM[VARCHAR],FKTABLE_NAME[VARCHAR],FKCOLUMN_NAME[VARCHAR],KEY_SEQ[SMALLINT],UPDATE_RULE[SMALLINT],DELETE_RULE[SMALLINT],FK_NAME[VARCHAR],PK_NAME[VARCHAR],DEFERRABILITY[SMALLINT]
+,APP,DERBY655T2,C21_ID,,APP,DERBY655T1,C11_ID,1,3,0,F_12,xxxxGENERATED-IDxxxx,7
 Test metadata finished

Modified: db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/odbc_metadata.out
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/odbc_metadata.out?rev=411398&r1=411397&r2=411398&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/odbc_metadata.out
(original)
+++ db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/odbc_metadata.out
Sat Jun  3 00:20:22 2006
@@ -507,4 +507,7 @@
 defval for col C5 type CHAR DEFAULT 'NULL' wasnull false
 defval for col C6 type CHAR DEFAULT ''NULL'' wasnull false
 defval for col C7 type INTEGER DEFAULT '88' wasnull false
+getImportedKeys('',null,null,'','APP','Derby655t1' ):
+PKTABLE_CAT[VARCHAR],PKTABLE_SCHEM[VARCHAR],PKTABLE_NAME[VARCHAR],PKCOLUMN_NAME[VARCHAR],FKTABLE_CAT[VARCHAR],FKTABLE_SCHEM[VARCHAR],FKTABLE_NAME[VARCHAR],FKCOLUMN_NAME[VARCHAR],KEY_SEQ[SMALLINT],UPDATE_RULE[SMALLINT],DELETE_RULE[SMALLINT],FK_NAME[VARCHAR],PK_NAME[VARCHAR],DEFERRABILITY[SMALLINT]
+,APP,DERBY655T2,C21_ID,,APP,DERBY655T1,C11_ID,1,3,0,F_12,xxxxGENERATED-IDxxxx,7
 Test metadata finished

Modified: db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/metadata_test.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/metadata_test.java?rev=411398&r1=411397&r2=411398&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/metadata_test.java
(original)
+++ db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/metadata_test.java
Sat Jun  3 00:20:22 2006
@@ -900,6 +900,24 @@
 			}
 			s.execute("drop table t1");
 
+			// test DERBY-655, DERBY-1343
+			// If a table has duplicate backing index, then it will share the 
+			// physical conglomerate with the existing index, but the duplicate
+			// indexes should have their own unique logical congomerates 
+			// associated with them. That way, it will be possible to 
+			// distinguish the 2 indexes in SYSCONGLOMERATES from each other.
+			s.execute("CREATE TABLE Derby655t1(c11_ID BIGINT NOT NULL)");
+			s.execute("CREATE TABLE Derby655t2 (c21_ID BIGINT NOT NULL primary key)");
+			s.execute("ALTER TABLE Derby655t1 ADD CONSTRAINT F_12 Foreign Key (c11_ID) REFERENCES
Derby655t2 (c21_ID) ON DELETE CASCADE ON UPDATE NO ACTION");
+			s.execute("CREATE TABLE Derby655t3(c31_ID BIGINT NOT NULL primary key)");
+			s.execute("ALTER TABLE Derby655t2 ADD CONSTRAINT F_443 Foreign Key (c21_ID) REFERENCES
Derby655t3(c31_ID) ON DELETE CASCADE ON UPDATE NO ACTION");
+			dmd = con.getMetaData();
+			System.out.println("\ngetImportedKeys('',null,null,'','APP','Derby655t1' ):");
+			dumpRS(met.getImportedKeys("", "APP", "DERBY655T1"));
+			s.execute("drop table Derby655t1");
+			s.execute("drop table Derby655t2");
+			s.execute("drop table Derby655t3");
+
 			// tiny test moved over from no longer used metadata2.sql
 			// This checks for a bug where you get incorrect behavior on a nested connection.
 			// if you do not get an error, the bug does not occur.			



Mime
View raw message