db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhille...@apache.org
Subject svn commit: r436921 [1/5] - in /db/derby/code/branches/10.2: ./ java/engine/org/apache/derby/iapi/sql/depend/ java/engine/org/apache/derby/iapi/sql/dictionary/ java/engine/org/apache/derby/iapi/sql/execute/ java/engine/org/apache/derby/impl/sql/catalog...
Date Fri, 25 Aug 2006 20:02:11 GMT
Author: rhillegas
Date: Fri Aug 25 13:02:02 2006
New Revision: 436921

URL: http://svn.apache.org/viewvc?rev=436921&view=rev
Log:
DERBY-1725: Merge the following from the trunk to the 10.2 branch: No JIRA (434169, 433931), DERBY-1582 (434408), DERBY-1500 (434309), DERBY-1555 (434273, 434257, 434192), DERBY-1691 (434245), DERBY-1633 (434111), DERBY-1674 (434100), DERBY-1734 (434083), DERBY-1621 (434046), DERBY-1743 (434018).

Modified:
    db/derby/code/branches/10.2/BUILDING.txt
    db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/sql/depend/DependencyManager.java
    db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/sql/dictionary/CatalogRowFactory.java
    db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/sql/dictionary/DataDictionary.java
    db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/sql/dictionary/SPSDescriptor.java
    db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/sql/dictionary/TabInfo.java
    db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/sql/dictionary/TriggerDescriptor.java
    db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/sql/execute/RowChanger.java
    db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
    db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSALIASESRowFactory.java
    db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSCHECKSRowFactory.java
    db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSCOLPERMSRowFactory.java
    db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSCOLUMNSRowFactory.java
    db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSCONGLOMERATESRowFactory.java
    db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSCONSTRAINTSRowFactory.java
    db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSDEPENDSRowFactory.java
    db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSDUMMY1RowFactory.java
    db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSFILESRowFactory.java
    db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSFOREIGNKEYSRowFactory.java
    db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSKEYSRowFactory.java
    db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSROUTINEPERMSRowFactory.java
    db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSSCHEMASRowFactory.java
    db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSSTATEMENTSRowFactory.java
    db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSSTATISTICSRowFactory.java
    db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSTABLEPERMSRowFactory.java
    db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSTABLESRowFactory.java
    db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSTRIGGERSRowFactory.java
    db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSVIEWSRowFactory.java
    db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/TabInfoImpl.java
    db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/compile/BinaryRelationalOperatorNode.java
    db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/compile/ColumnReference.java
    db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/compile/OptimizerImpl.java
    db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/compile/Predicate.java
    db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/compile/ProjectRestrictNode.java
    db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/compile/ResultColumnList.java
    db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/compile/SelectNode.java
    db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/compile/SetOperatorNode.java
    db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/depend/BasicDependencyManager.java
    db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/execute/PrivilegeInfo.java
    db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/execute/RoutinePrivilegeInfo.java
    db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/execute/RowChangerImpl.java
    db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/execute/TablePrivilegeInfo.java
    db/derby/code/branches/10.2/java/engine/org/apache/derby/loc/messages_en.properties
    db/derby/code/branches/10.2/java/shared/org/apache/derby/shared/common/reference/SQLState.java
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/master/grantRevokeDDL.out
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/master/predicatePushdown.out
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/master/triggerGeneral.out
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNet.exclude
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/ShutDownDBWhenNSShutsDownTest.java
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/AutoloadBooting.java
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/AutoloadTest.java
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/BlobClobTestSetup.java
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/BlobTest.java
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/CallableStatementTest.java
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/CallableStatementTestSetup.java
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/ClobTest.java
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/ClosedObjectTest.java
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/ConnectionTest.java
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/JDBC40TranslationTest.java
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/ParameterMetaDataWrapperTest.java
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/PreparedStatementTest.java
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/ResultSetMetaDataTest.java
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/ResultSetTest.java
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/RowIdNotImplementedTest.java
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/SetObjectUnsupportedTest.java
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/StatementTest.java
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/StatementTestSetup.java
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/UnsupportedVetter.java
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/VerifySignatures.java
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/BLOBTest.java
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ConcurrencyTest.java
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/HoldabilityTest.java
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ProcedureTest.java
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ResultSetCloseTest.java
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SURBaseTest.java
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SURQueryMixTest.java
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ScrollResultSetTest.java
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/URCoveringIndexTest.java
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/UpdateXXXTest.java
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/lang/PrepareExecuteDDL.java
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/lang/grantRevokeDDL.sql
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/lang/largeCodeGen.java
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/lang/predicatePushdown.sql
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/lang/triggerGeneral.sql
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/store/BootAllTest.java
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/tools/IJRunScriptTest.java
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/tools/sysinfo_api.java
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/util/ScriptTestCase.java
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/junit/BaseJDBCTestCase.java
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/junit/BaseJDBCTestSetup.java
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/junit/BaseTestCase.java
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/junit/NetworkServerTestSetup.java
    db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/junit/TestConfiguration.java

Modified: db/derby/code/branches/10.2/BUILDING.txt
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/BUILDING.txt?rev=436921&r1=436920&r2=436921&view=diff
==============================================================================
--- db/derby/code/branches/10.2/BUILDING.txt (original)
+++ db/derby/code/branches/10.2/BUILDING.txt Fri Aug 25 13:02:02 2006
@@ -370,9 +370,16 @@
     On newer Windows systems, ${user.home} is often equivalent
     to the value of the environment variable %USERPROFILE%.
 
+    NOTE: It is not a requirement that ant.properties reside in your
+    user.home directory. The file can be placed anywhere accessible
+    on the local filesystem, but ant must then be invoked with the
+    -propertyfile option:
+
+    ant -propertyfile {path_to_propertyfile}
+
 (2) Create a file called "ant.properties" in your ${user.home} 
     directory and define the following variables in 
-    "ant.properties". 
+    "ant.properties".
 
     NOTE TO MAC OS X USERS: See section 5.
  

Modified: db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/sql/depend/DependencyManager.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/sql/depend/DependencyManager.java?rev=436921&r1=436920&r2=436921&view=diff
==============================================================================
--- db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/sql/depend/DependencyManager.java (original)
+++ db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/sql/depend/DependencyManager.java Fri Aug 25 13:02:02 2006
@@ -27,6 +27,7 @@
 
 import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;
 
+import org.apache.derby.iapi.store.access.TransactionController;
 
 /**
 	Dependency Manager Interface
@@ -491,4 +492,54 @@
 		@exception java.sql.SQLException thrown if something goes wrong
 	 */
 	public String dumpDependencies() throws StandardException, java.sql.SQLException;
+	
+	/**
+	 	Erases all of the dependencies the dependent has, be they
+	 	valid or invalid, of any dependency type.  This action is
+	 	usually performed as the first step in revalidating a
+	 	dependent; it first erases all the old dependencies, then
+	 	revalidates itself generating a list of new dependencies,
+	 	and then marks itself valid if all its new dependencies are
+	 	valid.
+	 	<p>
+	 	There might be a future want to clear all dependencies for
+	 	a particular provider, e.g. when destroying the provider.
+	 	However, at present, they are assumed to stick around and
+	 	it is the responsibility of the dependent to erase them when
+	 	revalidating against the new version of the provider.
+	 	<p>
+	 	clearDependencies will delete dependencies if they are
+	 	stored; the delete is finalized at the next commit.
+
+		@param lcc	Compiler state
+		@param d the dependent
+		@param tc transaction controller
+	
+		@exception StandardException		Thrown on failure
+	*/
+	public void clearDependencies(LanguageConnectionContext lcc, 
+									Dependent d, 
+									TransactionController tc) 
+		throws StandardException;
+
+
+	/**
+ 	 * Copy dependencies from one dependent to another.
+	 *
+	 * @param copy_From the dependent to copy from	
+	 * @param copyTo the dependent to copy to
+	 * @param persistentOnly only copy persistent dependencies
+	 * @param cm			Current ContextManager
+	 * @param tc            Transaction Controller
+	 *
+	 * @exception StandardException		Thrown on error.
+	 */
+	public void copyDependencies(
+									Dependent	copy_From, 
+									Dependent	copyTo,
+									boolean		persistentOnly,
+									ContextManager cm, 
+									TransactionController tc)
+			throws StandardException;
+	
 }

Modified: db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/sql/dictionary/CatalogRowFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/sql/dictionary/CatalogRowFactory.java?rev=436921&r1=436920&r2=436921&view=diff
==============================================================================
--- db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/sql/dictionary/CatalogRowFactory.java (original)
+++ db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/sql/dictionary/CatalogRowFactory.java Fri Aug 25 13:02:02 2006
@@ -349,14 +349,6 @@
 
 	/** builds a column list for the catalog */
 	public abstract SystemColumn[]	buildColumnList();
-    
-
-	/**
-	 * builds an empty row given for a given index number.
-	 */
-  	public abstract ExecIndexRow	buildEmptyIndexRow(int indexNumber,
-													   RowLocation rowLocation) 
-  		throws StandardException;
 
 	/** Return the column positions for a given index number */
 	public int[] getIndexColumnPositions(int indexNumber)

Modified: db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/sql/dictionary/DataDictionary.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/sql/dictionary/DataDictionary.java?rev=436921&r1=436920&r2=436921&view=diff
==============================================================================
--- db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/sql/dictionary/DataDictionary.java (original)
+++ db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/sql/dictionary/DataDictionary.java Fri Aug 25 13:02:02 2006
@@ -1687,4 +1687,52 @@
 	public String getVTIClass(TableDescriptor td)
 		throws StandardException;
 
+	
+	/**
+	 * Adds a descriptor to a system catalog identified by the catalogNumber. 
+	 *
+	 * @param tuple			   descriptor to insert.
+	 * @param parent           parent descriptor; e.g for a column parent is the
+	 * tabledescriptor to which the descriptor is beign inserted. for most other
+	 * objects it is the schema descriptor.
+	 * @param catalogNumber	   a value which identifies the catalog into which
+	 * the descriptor should be inserted. It is the users responsibility to
+	 * ensure that the catalogNumber is consistent with the tuple being
+	 * inserted. 
+	 * @see DataDictionary#SYSCONGLOMERATES_CATALOG_NUM
+	 * @param allowsDuplicates whether an exception should be thrown if the
+	 * insert results in a duplicate; if this parameter is FALSE then one
+	 * of the following exception will be thrown; LANG_OBJECT_ALREADY_EXISTS (if
+	 * parent is null) or LANG_OBJECT_ALREADY_EXISTS_IN_OBJECT (if parent is not
+	 * null). The error message is created by getting the name and type of the
+	 * tuple and parent.
+	 * @see org.apache.derby.impl.sql.catalog.DataDictionaryImpl#duplicateDescriptorException
+	 * @param 	tc	the transaction controller to use to do all of this.
+	 * @param wait  If true, then the caller wants to wait for locks. False will
+	 *	            be when we using a nested user xaction - we want to timeout 
+	 *              right away if the parent holds the lock. 
+	 * @see #addDescriptorArray
+	 */
+	public void addDescriptor(TupleDescriptor tuple, TupleDescriptor parent,
+							  int catalogNumber, boolean allowsDuplicates,
+							  TransactionController tc, boolean wait) 
+		throws StandardException;
+	
+	/** 
+	 * Remove all of the stored dependencies for a given dependent's ID 
+	 * from the data dictionary.
+	 * 
+	 * @param dependentsUUID	Dependent's uuid
+	 * @param tc				TransactionController for the transaction
+	 * @param wait  If true, then the caller wants to wait for locks. False will
+	 *	            be when we using a nested user xaction - we want to timeout 
+	 *              right away if the parent holds the lock. 
+	 *
+	 * @exception StandardException		Thrown on failure
+	 */
+	public void dropDependentsStoredDependencies(UUID dependentsUUID,
+									   TransactionController tc,
+									   boolean wait) 
+				throws StandardException;	
+
 }	

Modified: db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/sql/dictionary/SPSDescriptor.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/sql/dictionary/SPSDescriptor.java?rev=436921&r1=436920&r2=436921&view=diff
==============================================================================
--- db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/sql/dictionary/SPSDescriptor.java (original)
+++ db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/sql/dictionary/SPSDescriptor.java Fri Aug 25 13:02:02 2006
@@ -260,13 +260,15 @@
 	 * @param lcc the language connection context
 	 * @param triggerTable the table descriptor to bind against.  Had
 	 * 	better be null if this isn't a trigger sps.
+	 * @param tc the transaction controller
 	 *
 	 * @exception StandardException on error
 	 */
 	public final synchronized void prepareAndRelease
 	(
 		LanguageConnectionContext	lcc, 
-		TableDescriptor				triggerTable
+		TableDescriptor				triggerTable,
+		TransactionController       tc
 	) throws StandardException
 	{
 		if (SanityManager.DEBUG)
@@ -277,10 +279,36 @@
 			}
 		}
 		
-		compileStatement(lcc, triggerTable);
+		compileStatement(lcc, triggerTable, tc);
 	
 		preparedStatement.makeInvalid(DependencyManager.PREPARED_STATEMENT_RELEASE, lcc);
 	}
+	
+	/**
+	 * FOR TRIGGERS ONLY
+	 * <p>
+	 * Generate the class for this SPS and immediately
+	 * release it.  This is useful for cases where we
+	 * don't want to immediately execute the statement 
+	 * corresponding to this sps (e.g. CREATE STATEMENT).
+ 	 * <p>
+	 * <I>SIDE EFFECTS</I>: will update and SYSDEPENDS 
+	 * with the prepared statement dependency info.
+ 	 * 
+	 * @param lcc the language connection context
+	 * @param triggerTable the table descriptor to bind against.  Had
+	 * 	better be null if this isn't a trigger sps.
+	 *
+	 * @exception StandardException on error
+	 */
+	public final synchronized void prepareAndRelease
+	(
+		LanguageConnectionContext	lcc, 
+		TableDescriptor				triggerTable
+	) throws StandardException
+	{
+		prepareAndRelease(lcc, triggerTable, (TransactionController)null);
+	}
 
 	/**
 	 * Generate the class for this SPS and immediately
@@ -297,13 +325,14 @@
 	 */
 	public final synchronized void prepareAndRelease(LanguageConnectionContext lcc) throws StandardException
 	{
-		prepareAndRelease(lcc, (TableDescriptor)null);
+		prepareAndRelease(lcc, (TableDescriptor)null, (TransactionController)null);
 	}
 
 	private void compileStatement
 	(
 		LanguageConnectionContext	lcc,
-		TableDescriptor				triggerTable
+		TableDescriptor				triggerTable,
+		TransactionController       tc
 	)
 		throws StandardException
 	{
@@ -388,7 +417,7 @@
 			** before we recreate them so we don't grow
 			** SYS.SYSDEPENDS forever.
 			*/
-			dm.clearDependencies(lcc, this);
+			dm.clearDependencies(lcc, this, tc);
 
 			/*
 			** Copy over all the dependencies to me
@@ -396,7 +425,8 @@
 			dm.copyDependencies(preparedStatement, 	// from
 											this, 	// to
 											false,	// persistent only
-											cm);
+											cm,
+											tc);
 		}
 
 		// mark it as valid
@@ -673,7 +703,7 @@
 			*/
 			LanguageConnectionContext lcc = (LanguageConnectionContext)
 					cm.getContext(LanguageConnectionContext.CONTEXT_ID);
-			prepareAndRelease(lcc);
+			
 
 
 			if (!((org.apache.derby.impl.sql.catalog.DataDictionaryImpl) (lcc.getDataDictionary())).readOnlyUpgrade) {
@@ -697,6 +727,7 @@
 
 				try
 				{
+					prepareAndRelease(lcc, null, nestedTC);
 					updateSYSSTATEMENTS(lcc, RECOMPILE, nestedTC);
 				}
 				catch (StandardException se)
@@ -711,6 +742,7 @@
 						}
 						// if we couldn't do this with a nested xaction, retry with
 						// parent-- we need to wait this time!
+						prepareAndRelease(lcc, null, null);
 						updateSYSSTATEMENTS(lcc, RECOMPILE, null);
 					}
 					else throw se;

Modified: db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/sql/dictionary/TabInfo.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/sql/dictionary/TabInfo.java?rev=436921&r1=436920&r2=436921&view=diff
==============================================================================
--- db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/sql/dictionary/TabInfo.java (original)
+++ db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/sql/dictionary/TabInfo.java Fri Aug 25 13:02:02 2006
@@ -444,4 +444,64 @@
 	 * @return The Properties associated with creating the specified index.
 	 */
 	public Properties getCreateIndexProperties(int indexNumber);
+	
+	/**
+	  *	Given a key row, delete all matching heap rows and their index
+	  *	rows.
+	  * <p>
+	  * LOCKING: row locking if there is a key; otherwise, 
+	  * table locking.
+	  *
+	  *	@param	tc			transaction controller
+	  *	@param	key			key to delete by.
+	  *	@param	indexNumber	Key is appropriate for this index.
+	  * @param  wait        If true, then the caller wants to wait for locks. 
+	  *						False will be when we using a nested user xaction 
+	  *						- we want to timeout right away if the parent holds 
+	  *                     the lock.
+	  * @return the number of rows deleted. If key is not unique,
+	  *         this may be more than one.
+	  * @exception StandardException		Thrown on failure
+	  */
+	public int deleteRow( TransactionController tc,
+						  ExecIndexRow key,
+						  int indexNumber,
+						  boolean wait)
+		throws StandardException;
+	
+	/**
+	  *	Delete the set of rows defined by a scan on an index
+	  * from the table. Most of the parameters are simply passed
+	  * to TransactionController.openScan. Please refer to the
+	  * TransactionController documentation for details.
+	  * <p>
+	  * LOCKING: row locking if there is a start and a stop
+	  * key; otherwise, table locking
+	  *
+	  *	@param	tc			transaction controller
+	  *	@param	startKey	key to start the scan.
+	  * @param  startOp     operation to start the scan.
+	  *	@param	stopKey	    key to start the scan.
+	  * @param  qualifier   a qualifier for the scan.
+	  * @param  filter		filter on base rows
+	  * @param  stopOp      operation to start the scan.
+	  *	@param	indexNumber	Key is appropriate for this index.
+	  * @param  wait        If true, then the caller wants to wait for locks. 
+	  *						False will be when we using a nested user xaction 
+	  *						- we want to timeout right away if the parent holds 
+	  *                     the lock.
+	  * @return the number of rows deleted.
+	  * @exception StandardException		Thrown on failure
+	  * @see TransactionController#openScan
+	  */
+	public int deleteRows(TransactionController tc,
+						  ExecIndexRow startKey,
+						  int startOp,
+						  Qualifier[][] qualifier,
+						  TupleFilter filter,
+						  ExecIndexRow stopKey,
+						  int stopOp,
+						  int indexNumber,
+						  boolean wait)
+		 throws StandardException;
 }

Modified: db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/sql/dictionary/TriggerDescriptor.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/sql/dictionary/TriggerDescriptor.java?rev=436921&r1=436920&r2=436921&view=diff
==============================================================================
--- db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/sql/dictionary/TriggerDescriptor.java (original)
+++ db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/sql/dictionary/TriggerDescriptor.java Fri Aug 25 13:02:02 2006
@@ -689,17 +689,29 @@
 		// the trigger table, so there is a very large number of actions
 		// that we would have to check against. This is hard to maintain,
 		// so don't bother.
-		// When REVOKE_PRIVILEGE gets sent (this happens for privilege 
-		// types SELECT, UPDATE, DELETE, INSERT, REFERENCES, TRIGGER), we  
-		// make the TriggerDescriptor drop itself. 
-		if (action ==  DependencyManager.REVOKE_PRIVILEGE)
+
+		switch (action)
 		{
-		    DropTriggerConstantAction.dropTriggerDescriptor(
-				lcc,getDataDictionary().getDependencyManager(), 
-				getDataDictionary(), lcc.getTransactionExecute(), this,
-				null);
-		    return;
+			// invalidate this trigger descriptor
+			case DependencyManager.USER_RECOMPILE_REQUEST:
+				DependencyManager dm = getDataDictionary().getDependencyManager();
+				dm.invalidateFor(this, DependencyManager.PREPARED_STATEMENT_RELEASE, lcc);
+				break;
+
+			// When REVOKE_PRIVILEGE gets sent (this happens for privilege 
+			// types SELECT, UPDATE, DELETE, INSERT, REFERENCES, TRIGGER), we  
+			// make the TriggerDescriptor drop itself. 
+			case DependencyManager.REVOKE_PRIVILEGE:
+				DropTriggerConstantAction.dropTriggerDescriptor(
+					lcc, getDataDictionary().getDependencyManager(),
+					getDataDictionary(), lcc.getTransactionExecute(), this,
+					null);
+				break;
+
+			default:
+				break;
 		}
+		
 	}
 
 	/**

Modified: db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/sql/execute/RowChanger.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/sql/execute/RowChanger.java?rev=436921&r1=436920&r2=436921&view=diff
==============================================================================
--- db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/sql/execute/RowChanger.java (original)
+++ db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/sql/execute/RowChanger.java Fri Aug 25 13:02:02 2006
@@ -146,4 +146,19 @@
 	 */
 	public ConglomerateController getHeapConglomerateController();
 
+	/**
+	  Open this RowChanger.
+
+	  <P>Note to avoid the cost of fixing indexes that do not
+	  change during update operations use openForUpdate(). 
+	  @param lockMode	The lock mode to use
+							(row or table, see TransactionController)
+	  @param wait		If true, then the caller wants to wait for locks. False will be
+							when we using a nested user xaction - we want to timeout right away
+							if the parent holds the lock.  
+
+	  @exception StandardException thrown on failure to convert
+	  */
+	public void open(int lockMode, boolean wait)
+		 throws StandardException;
 }

Modified: db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java?rev=436921&r1=436920&r2=436921&view=diff
==============================================================================
--- db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java (original)
+++ db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java Fri Aug 25 13:02:02 2006
@@ -1636,10 +1636,13 @@
 							  TransactionController tc)
 		throws StandardException
 	{
-		addDescriptorNow(td, parent, catalogNumber, duplicatesAllowed, tc, true);
+		addDescriptor(td, parent, catalogNumber, duplicatesAllowed, tc, true);
 	}
 
-	private void addDescriptorNow(TupleDescriptor td, TupleDescriptor parent,
+	/**
+	 * @inheritDoc
+	 */
+	public void addDescriptor(TupleDescriptor td, TupleDescriptor parent,
 							  int catalogNumber, boolean duplicatesAllowed,
 							  TransactionController tc, boolean wait)
 		throws StandardException
@@ -3242,7 +3245,7 @@
                     uuid,
                     (UUID) null, 0, 0);
 										
-			addDescriptorNow(cd, null, SYSCOLUMNS_CATALOG_NUM, 
+			addDescriptor(cd, null, SYSCOLUMNS_CATALOG_NUM, 
 						  false, // no chance of duplicates here
 						  tc, wait);
 		}
@@ -5873,6 +5876,17 @@
 									   TransactionController tc) 
 				throws StandardException	
 	{
+		 dropDependentsStoredDependencies(dependentsUUID, tc, true);
+	}
+				
+	/** 
+	 * @inheritDoc
+	 */
+	public void dropDependentsStoredDependencies(UUID dependentsUUID,
+									   TransactionController tc,
+									   boolean wait) 
+				throws StandardException	
+	{
 		ExecIndexRow			keyRow1 = null;
 		DataValueDescriptor		dependentIDOrderable;
 		TabInfoImpl					ti = getNonCoreTI(SYSDEPENDS_CATALOG_NUM);
@@ -5886,7 +5900,8 @@
 		keyRow1 = (ExecIndexRow) exFactory.getIndexableRow(1);
 		keyRow1.setColumn(1, dependentIDOrderable);
 
-		ti.deleteRow( tc, keyRow1, SYSDEPENDSRowFactory.SYSDEPENDS_INDEX1_ID );
+		ti.deleteRow( tc, keyRow1, SYSDEPENDSRowFactory.SYSDEPENDS_INDEX1_ID, 
+				wait );
 
 	}
 
@@ -6710,7 +6725,7 @@
 		DataValueDescriptor		tableNameOrderable;
 		ScanController			scanController;
 		TabInfoImpl					ti = coreInfo[SYSTABLES_CORE_NUM];
-		CatalogRowFactory		rf = ti.getCatalogRowFactory();
+        SYSTABLESRowFactory		rf = (SYSTABLESRowFactory) ti.getCatalogRowFactory();
 
 		// We only want the 1st column from the heap
 		row = exFactory.getValueRow(1);

Modified: db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSALIASESRowFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSALIASESRowFactory.java?rev=436921&r1=436920&r2=436921&view=diff
==============================================================================
--- db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSALIASESRowFactory.java (original)
+++ db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSALIASESRowFactory.java Fri Aug 25 13:02:02 2006
@@ -243,57 +243,6 @@
 		return row;
 	}
 
-	/**
-	 * Builds an empty index row.
-	 *
-	 *	@param	indexNumber	Index to build empty row for.
-	 *  @param  rowLocation	Row location for last column of index row
-	 *
-	 * @return corresponding empty index row
-	 * @exception   StandardException thrown on failure
-	 */
-	public ExecIndexRow	buildEmptyIndexRow( int indexNumber,
-											RowLocation rowLocation) 
-			throws StandardException
-	{
-		int ncols = getIndexColumnCount(indexNumber);
-		ExecIndexRow row = getExecutionFactory().getIndexableRow(ncols + 1);
-
-		row.setColumn(ncols + 1, rowLocation);		
-
-		switch( indexNumber )
-		{
-		    case SYSALIASES_INDEX1_ID:
-				/* 1st column is SCHEMAID (char(36)) */
-				row.setColumn(1, getDataValueFactory().getCharDataValue((String) null));
-
-				/* 2nd column is ALIAS (varchar(128)) */
-				row.setColumn(2, getDataValueFactory().getVarcharDataValue((String) null));
-
-				/* 3rd column is NAMESPACE (char(1)) */
-				row.setColumn(3, getDataValueFactory().getCharDataValue((String) null));
-
-				break;
-
-		    case SYSALIASES_INDEX2_ID:
-				/* 1st column is ALIASID (UUID - char(36)) */
-				row.setColumn(1, getDataValueFactory().getCharDataValue((String) null));
-
-				break;
-
-		    case SYSALIASES_INDEX3_ID:
-				/* 1st column is SCHEMAID (char(36)) */
-				row.setColumn(1, getDataValueFactory().getCharDataValue((String) null));
-
-				/* 2nd column is SPECIFICNAME (varchar(128)) */
-				row.setColumn(2, getDataValueFactory().getVarcharDataValue((String) null));
-
-				break;
-		}	// end switch
-
-		return	row;
-	}
-
 	///////////////////////////////////////////////////////////////////////////
 	//
 	//	ABSTRACT METHODS TO BE IMPLEMENTED BY CHILDREN OF CatalogRowFactory

Modified: db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSCHECKSRowFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSCHECKSRowFactory.java?rev=436921&r1=436920&r2=436921&view=diff
==============================================================================
--- db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSCHECKSRowFactory.java (original)
+++ db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSCHECKSRowFactory.java Fri Aug 25 13:02:02 2006
@@ -55,6 +55,7 @@
 import org.apache.derby.iapi.services.uuid.UUIDFactory;
 import org.apache.derby.catalog.UUID;
 
+import java.sql.Types;
 import java.util.Properties;
 
 /**
@@ -63,18 +64,16 @@
  * @author jerry
  */
 
-public class SYSCHECKSRowFactory extends CatalogRowFactory
+class SYSCHECKSRowFactory extends CatalogRowFactory
 {
 	private  static final String	TABLENAME_STRING = "SYSCHECKS";
 
-	protected static final int		SYSCHECKS_COLUMN_COUNT = 3;
-	protected static final int		SYSCHECKS_CONSTRAINTID = 1;
-	protected static final int		SYSCHECKS_CHECKDEFINITION = 2;
-	protected static final int		SYSCHECKS_REFERENCEDCOLUMNS = 3;
-
-	// Column widths
-	protected static final int		SYSCHECKS_CONSTRAINTID_WIDTH = 36;
-	protected static final int		SYSCHECKS_INDEX1_ID = 0;
+	private static final int		SYSCHECKS_COLUMN_COUNT = 3;
+	private static final int		SYSCHECKS_CONSTRAINTID = 1;
+	private static final int		SYSCHECKS_CHECKDEFINITION = 2;
+	private static final int		SYSCHECKS_REFERENCEDCOLUMNS = 3;
+
+	static final int		SYSCHECKS_INDEX1_ID = 0;
 
 	// index is unique.
     private	static	final	boolean[]	uniqueness = null;
@@ -99,7 +98,6 @@
 	//
 	/////////////////////////////////////////////////////////////////////////////
 
-    public
 	SYSCHECKSRowFactory(UUIDFactory uuidf, ExecutionFactory ef, DataValueFactory dvf,
                                  boolean convertIdToLower)
 	{
@@ -164,35 +162,6 @@
 		return row;
 	}
 
-	/**
-	 * Builds an empty index row.
-	 *
-	 *	@param	indexNumber	Index to build empty row for.
-	 *  @param  rowLocation	Row location for last column of index row
-	 *
-	 * @return corresponding empty index row
-	 * @exception   StandardException thrown on failure
-	 */
-	public ExecIndexRow	buildEmptyIndexRow( int indexNumber,
-											RowLocation rowLocation) 
-			throws StandardException
-	{
-		int  ncols = getIndexColumnCount(indexNumber);
-		ExecIndexRow row = getExecutionFactory().getIndexableRow(ncols + 1);
-
-		row.setColumn(ncols + 1, rowLocation);
-
-		switch( indexNumber )
-		{
-		    case SYSCHECKS_INDEX1_ID:
-				/* 1st column is CONSTRAINTID (char(36)) */
-				row.setColumn(1, getDataValueFactory().getCharDataValue((String) null));
-				break;
-		}	// end switch
-
-		return	row;
-	}
-
 	///////////////////////////////////////////////////////////////////////////
 	//
 	//	ABSTRACT METHODS TO BE IMPLEMENTED BY CHILDREN OF CatalogRowFactory
@@ -261,50 +230,14 @@
 	 *
 	 * @return array of SystemColumn suitable for making this catalog.
 	 */
-	public SystemColumn[]	buildColumnList()
-	{
-		int						index = 0;
-		int						columnNumber = 1;
-		SystemColumn[]			columnList = new SystemColumn[SYSCHECKS_COLUMN_COUNT];
-
-		// describe columns
-
-		columnList[index++] = new SystemColumnImpl(	
-							convertIdCase( "CONSTRAINTID"),			// name 
-							SYSCHECKS_CONSTRAINTID,	// column number
-							0,					// precision
-							0,					// scale
-							false,				// nullability
-							"CHAR",				// dataType
-							true,				// built-in type
-							36					// maxLength
-			                );
-		columnList[index++] = 
-					new SystemColumnImpl(	
-							convertIdCase( "CHECKDEFINITION"),		// column name
-							SYSCHECKS_CHECKDEFINITION,	// column number
-							0,					// precision
-							0,					// scale
-							false,				// nullability
-							"LONG VARCHAR",	    // dataType
-							true,				// built-in type
-							TypeId.LONGVARCHAR_MAXWIDTH // maxLength
-			               );
-		columnList[index++] = 
-					new SystemColumnImpl(	
-							convertIdCase( "REFERENCEDCOLUMNS"),		// column name
-							SYSCHECKS_REFERENCEDCOLUMNS,	// column number
-							0,					// precision
-							0,					// scale
-							false,				// nullability
-							"org.apache.derby.catalog.ReferencedColumns",	// datatype
-							false,				// built-in type
-							TypeDescriptor.MAXIMUM_WIDTH_UNKNOWN
-												// maxLength
-			               );
-
-
-		return	columnList;
-	}
 
+    public SystemColumn[] buildColumnList() {
+        
+       return new SystemColumn[] {
+            SystemColumnImpl.getUUIDColumn("CONSTRAINTID", false),
+            SystemColumnImpl.getColumn("CHECKDEFINITION", Types.LONGVARCHAR, false),
+            SystemColumnImpl.getJavaColumn("REFERENCEDCOLUMNS",
+                    "org.apache.derby.catalog.ReferencedColumns", false)             
+        };
+    }
 }

Modified: db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSCOLPERMSRowFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSCOLPERMSRowFactory.java?rev=436921&r1=436920&r2=436921&view=diff
==============================================================================
--- db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSCOLPERMSRowFactory.java (original)
+++ db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSCOLPERMSRowFactory.java Fri Aug 25 13:02:02 2006
@@ -54,7 +54,7 @@
  *
  */
 
-public class SYSCOLPERMSRowFactory extends PermissionsCatalogRowFactory
+class SYSCOLPERMSRowFactory extends PermissionsCatalogRowFactory
 {
 	static final String TABLENAME_STRING = "SYSCOLPERMS";
 
@@ -67,9 +67,9 @@
     private static final int COLUMNS_COL_NUM = 6;
     private static final int COLUMN_COUNT = 6;
 
-    public static final int GRANTEE_TABLE_TYPE_GRANTOR_INDEX_NUM = 0;
-    public static final int COLPERMSID_INDEX_NUM = 1;
-    public static final int TABLEID_INDEX_NUM = 2;
+    static final int GRANTEE_TABLE_TYPE_GRANTOR_INDEX_NUM = 0;
+    static final int COLPERMSID_INDEX_NUM = 1;
+    static final int TABLEID_INDEX_NUM = 2;
 	private static final int[][] indexColumnPositions = 
 	{ 
 		{ GRANTEE_COL_NUM, TABLEID_COL_NUM, TYPE_COL_NUM, GRANTOR_COL_NUM},
@@ -90,7 +90,7 @@
 
     private SystemColumn[] columnList;
 
-    public SYSCOLPERMSRowFactory(UUIDFactory uuidf, ExecutionFactory ef, DataValueFactory dvf,
+    SYSCOLPERMSRowFactory(UUIDFactory uuidf, ExecutionFactory ef, DataValueFactory dvf,
                                  boolean convertIdToLower)
 	{
 		super(uuidf,ef,dvf,convertIdToLower);
@@ -170,98 +170,18 @@
     } // end of buildDescriptor
 
 	/** builds a column list for the catalog */
-	public SystemColumn[] buildColumnList()
+    public SystemColumn[] buildColumnList()
     {
-		if (columnList == null)
-        {
-            columnList = new SystemColumn[ COLUMN_COUNT];
-
-            columnList[ COLPERMSID_COL_NUM - 1] =
-                new SystemColumnImpl( convertIdCase( "COLPERMSID"),
-                                      COLPERMSID_COL_NUM,
-                                      0, // precision
-                                      0, // scale
-                                      false, // nullability
-                                      "CHAR",
-                                      true,
-                                      36);
-            columnList[ GRANTEE_COL_NUM - 1] =
-              new SystemColumnImpl( convertIdCase( "GRANTEE"),
-                                    GRANTEE_COL_NUM,
-                                    0, // precision
-                                    0, // scale
-                                    false, // nullability
-                                    AUTHORIZATION_ID_TYPE,
-                                    AUTHORIZATION_ID_IS_BUILTIN_TYPE,
-                                    AUTHORIZATION_ID_LENGTH);
-            columnList[ GRANTOR_COL_NUM - 1] =
-              new SystemColumnImpl( convertIdCase( "GRANTOR"),
-                                    GRANTOR_COL_NUM,
-                                    0, // precision
-                                    0, // scale
-                                    false, // nullability
-                                    AUTHORIZATION_ID_TYPE,
-                                    AUTHORIZATION_ID_IS_BUILTIN_TYPE,
-                                    AUTHORIZATION_ID_LENGTH);
-            columnList[ TABLEID_COL_NUM - 1] =
-              new SystemColumnImpl( convertIdCase( "TABLEID"),
-                                    TABLEID_COL_NUM,
-                                    0, // precision
-                                    0, // scale
-                                    false, // nullability
-                                    "CHAR", // dataType
-                                    true, // built-in type
-                                    36);
-            columnList[ TYPE_COL_NUM - 1] =
-              new SystemColumnImpl( convertIdCase( "TYPE"),
-                                    TYPE_COL_NUM,
-                                    0, // precision
-                                    0, // scale
-                                    false, // nullability
-                                    "CHAR", // dataType
-                                    true, // built-in type
-                                    1);
-            columnList[ COLUMNS_COL_NUM - 1] =
-              new SystemColumnImpl( convertIdCase( "COLUMNS"),
-                                    COLUMNS_COL_NUM,
-                                    0, // precision
-                                    0, // scale
-                                    false, // nullability
-                                    "org.apache.derby.iapi.services.io.FormatableBitSet", // datatype
-                                    false,							// built-in type
-                                    DataTypeDescriptor.MAXIMUM_WIDTH_UNKNOWN // maxLength
-                  );
-        }
-		return columnList;
-    } // end of buildColumnList
-
-	/**
-	 * builds an empty row given for a given index number.
-	 */
-  	public ExecIndexRow buildEmptyIndexRow(int indexNumber,
-                                           RowLocation rowLocation) 
-  		throws StandardException
-    {
-        ExecIndexRow row = getExecutionFactory().getIndexableRow( indexColumnPositions[indexNumber].length + 1);
-        row.setColumn( row.nColumns(), rowLocation);
-        
-        switch( indexNumber)
-        {
-        case GRANTEE_TABLE_TYPE_GRANTOR_INDEX_NUM:
-            row.setColumn(1, getNullAuthorizationID()); // grantee
-            row.setColumn(2, getDataValueFactory().getNullChar( (StringDataValue) null)); // table UUID
-            row.setColumn(3, getDataValueFactory().getNullChar( (StringDataValue) null)); // type
-            row.setColumn(4, getNullAuthorizationID()); // grantor
-            break;
-        case COLPERMSID_INDEX_NUM:
-            row.setColumn(1, getDataValueFactory().getNullChar( (StringDataValue) null)); // COLPERMSID
-            break;
-        case TABLEID_INDEX_NUM:
-            row.setColumn(1, getDataValueFactory().getNullChar( (StringDataValue) null)); // TABLEID
-            break;
-        }
-        return row;
-    } // end of buildEmptyIndexRow
+        return new SystemColumn[] {
+           SystemColumnImpl.getUUIDColumn("COLPERMSID", false),
+           SystemColumnImpl.getIdentifierColumn("GRANTEE", false),
+           SystemColumnImpl.getIdentifierColumn("GRANTOR", false),
+           SystemColumnImpl.getUUIDColumn("TABLEID", false),
+           SystemColumnImpl.getIndicatorColumn("TYPE"),
+           SystemColumnImpl.getJavaColumn("COLUMNS",
+                   "org.apache.derby.iapi.services.io.FormatableBitSet", false)    
+        };
+    }
 
 	/**
 	 * builds an index key row for a given index number.

Modified: db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSCOLUMNSRowFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSCOLUMNSRowFactory.java?rev=436921&r1=436920&r2=436921&view=diff
==============================================================================
--- db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSCOLUMNSRowFactory.java (original)
+++ db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSCOLUMNSRowFactory.java Fri Aug 25 13:02:02 2006
@@ -326,51 +326,6 @@
 	///////////////////////////////////////////////////////////////////////////
 
 	/**
-	 * Builds an empty index row.
-	 *
-	 *	@param	indexNumber	Index to build empty row for.
-	 *  @param  rowLocation	Row location for last column of index row
-	 *
-	 * @return corresponding empty index row
-	 * @exception   StandardException thrown on failure
-	 */
-	public ExecIndexRow	buildEmptyIndexRow( int indexNumber,
-											RowLocation rowLocation) 
-			throws StandardException
-	{
-		int ncols = getIndexColumnCount(indexNumber);
-		ExecIndexRow row = getExecutionFactory().getIndexableRow(ncols + 1);
-
-		row.setColumn(ncols + 1, rowLocation);
-
-		switch(indexNumber)
-		{
-			case SYSCOLUMNS_INDEX1_ID:
-				/* 1st column is REFERENCEID (UUID - char(36)) */
-				row.setColumn
-					(1, getDataValueFactory().getCharDataValue((String) null));
-
-				/* 2nd column is COLUMNNAME (varchar(128)) */
-				row.setColumn
-				    (2, 
-					 getDataValueFactory().getVarcharDataValue((String) null));
-
-				break;
-
-		    case SYSCOLUMNS_INDEX2_ID:
-				
-				/* 1st column is DEFAULTID (UUID - char(36)) */
-				row.setColumn
-					(1, getDataValueFactory().getCharDataValue((String) null));
-
-				break;
-		}	// end switch
-
-		return	row;
-	}
-
-
-	/**
 	 * Make a ColumnDescriptor out of a SYSCOLUMNS row
 	 *
 	 * @param row 					a SYSCOLUMNS row

Modified: db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSCONGLOMERATESRowFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSCONGLOMERATESRowFactory.java?rev=436921&r1=436920&r2=436921&view=diff
==============================================================================
--- db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSCONGLOMERATESRowFactory.java (original)
+++ db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSCONGLOMERATESRowFactory.java Fri Aug 25 13:02:02 2006
@@ -213,58 +213,6 @@
 		return makeRow(null, null);
 	}
 
-	/**
-	 * Builds an empty index row.
-	 *
-	 *	@param	indexNumber	Index to build empty row for.
-	 *  @param  rowLocation	Row location for last column of index row
-	 *
-	 * @return corresponding empty index row
-	 * @exception   StandardException thrown on failure
-	 */
-	public ExecIndexRow	buildEmptyIndexRow( int indexNumber,
-											RowLocation rowLocation) 
-			throws StandardException
-	{
-		int ncols = getIndexColumnCount(indexNumber);
-		ExecIndexRow row =	getExecutionFactory().getIndexableRow(ncols + 1);
-
-		row.setColumn(ncols + 1, rowLocation);
-
-		switch( indexNumber )
-		{
-		    case SYSCONGLOMERATES_INDEX1_ID:
-				
-				/* 1st column is CONGLOMERATEID (char(36)) */
-				row.setColumn(1, getDataValueFactory().getCharDataValue((String) null));
-				break;
-
-		    case SYSCONGLOMERATES_INDEX2_ID:
-				
-				/* 1st column is CONGLOMERATENAME (varchar(128)) */
-				row.setColumn(1, getDataValueFactory().getVarcharDataValue((String) null));
-				
-				/* 2nd column is SCHEMAID (char(36)) */
-				row.setColumn(2, getDataValueFactory().getCharDataValue((String) null));
-
-				break;
-
-		    case SYSCONGLOMERATES_INDEX3_ID:
-				
-				/* Build the row */
-				/* NOTE: this index is not unique, need extra column in template for
-				 * drop method in DataDictionary.
-				 */
-
-				/* 1st column is TABLEID (char(36)) */
-				row.setColumn(1, getDataValueFactory().getCharDataValue((String) null));
-
-				break;
-
-		}	// end switch
-
-		return	row;
-	}
 
 	/**
 	 * Get the Properties associated with creating the heap.

Modified: db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSCONSTRAINTSRowFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSCONSTRAINTSRowFactory.java?rev=436921&r1=436920&r2=436921&view=diff
==============================================================================
--- db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSCONSTRAINTSRowFactory.java (original)
+++ db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSCONSTRAINTSRowFactory.java Fri Aug 25 13:02:02 2006
@@ -224,57 +224,6 @@
 		return row;
 	}
 
-	/**
-	 * Builds an empty index row.
-	 *
-	 *	@param	indexNumber	Index to build empty row for.
-	 *  @param  rowLocation	Row location for last column of index row
-	 *
-	 * @return corresponding empty index row
-	 * @exception   StandardException thrown on failure
-	 */
-	public ExecIndexRow	buildEmptyIndexRow( int indexNumber,
-											RowLocation rowLocation) 
-			throws StandardException
-	{
-		int ncols = getIndexColumnCount(indexNumber);
-		ExecIndexRow row = getExecutionFactory().getIndexableRow(ncols + 1);
-
-		row.setColumn(ncols + 1, rowLocation);
-
-		switch( indexNumber )
-		{
-		    case SYSCONSTRAINTS_INDEX1_ID:
-				/* 1st column is CONSTRAINTID (char(36)) */
-				row.setColumn(1, getDataValueFactory().getCharDataValue((String) null));
-				break;
-
-		    case SYSCONSTRAINTS_INDEX2_ID:
-				/* 1st column is CONSTRAINTNAME (varchar(128)) */
-				row.setColumn(1, getDataValueFactory().getVarcharDataValue((String) null));
-
-				/* 2nd column is SCHEMAID (UUID - char(36)) */
-				row.setColumn(2, getDataValueFactory().getCharDataValue((String) null));
-
-				break;
-
-		    case SYSCONSTRAINTS_INDEX3_ID:
-				/* 1st column is TABLEID (char(36)) */
-				row.setColumn(1, getDataValueFactory().getCharDataValue((String) null));
-
-				break;
-
-		    default:
-
-				if (SanityManager.DEBUG)
-					SanityManager.NOTREACHED();
-				return null;
-
-
-		}	// end switch
-
-		return	row;
-	}
 
 	///////////////////////////////////////////////////////////////////////////
 	//

Modified: db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSDEPENDSRowFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSDEPENDSRowFactory.java?rev=436921&r1=436920&r2=436921&view=diff
==============================================================================
--- db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSDEPENDSRowFactory.java (original)
+++ db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSDEPENDSRowFactory.java Fri Aug 25 13:02:02 2006
@@ -180,29 +180,6 @@
 		return row;
 	}
 
-	/**
-	 * Builds an empty index row.
-	 *
-	 *	@param	indexNumber	Index to build empty row for.
-	 *  @param  rowLocation	Row location for last column of index row
-	 *
-	 * @return corresponding empty index row
-	 * @exception   StandardException thrown on failure
-	 */
-	public ExecIndexRow	buildEmptyIndexRow( int indexNumber,
-											RowLocation rowLocation) 
-			throws StandardException
-	{
-		ExecIndexRow row = getExecutionFactory().getIndexableRow(2);
-
-		/* both indices are on UUID */
-		row.setColumn(1, getDataValueFactory().getCharDataValue((String) null));
-
-		row.setColumn(2, rowLocation);
-
-		return	row;
-	}
-
 	///////////////////////////////////////////////////////////////////////////
 	//
 	//	ABSTRACT METHODS TO BE IMPLEMENTED BY CHILDREN OF CatalogRowFactory

Modified: db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSDUMMY1RowFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSDUMMY1RowFactory.java?rev=436921&r1=436920&r2=436921&view=diff
==============================================================================
--- db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSDUMMY1RowFactory.java (original)
+++ db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSDUMMY1RowFactory.java Fri Aug 25 13:02:02 2006
@@ -21,6 +21,8 @@
 
 package org.apache.derby.impl.sql.catalog;
 
+import java.sql.Types;
+
 import org.apache.derby.iapi.sql.dictionary.SystemColumn;
 import org.apache.derby.iapi.sql.dictionary.TupleDescriptor;
 import org.apache.derby.iapi.sql.dictionary.DataDictionary;
@@ -46,16 +48,8 @@
  *
  */
 
-public class SYSDUMMY1RowFactory extends CatalogRowFactory
+class SYSDUMMY1RowFactory extends CatalogRowFactory
 {
-	static final String TABLENAME_STRING = "SYSDUMMY1";
-
-	/* column #s for sysstatistics (1 based) */
-	
-	/* only column
-	*/
-	protected static final int 	SYSDUMMY1_IBMREQD = 1;
-
 	protected static final int SYSDUMMY1_COLUMN_COUNT = 1;
 
 	private static final String[] uuids =
@@ -63,22 +57,18 @@
 		"c013800d-00f8-5b70-bea3-00000019ed88", // catalog UUID
 		"c013800d-00f8-5b70-fee8-000000198c88"  // heap UUID.
 	};
-	/*
-	 * STATE
-	 */
-	private	SystemColumn[]		columnList;
 
 	/*
 	 *	CONSTRUCTORS
 	 */
-    public	SYSDUMMY1RowFactory(UUIDFactory uuidf, 
+    SYSDUMMY1RowFactory(UUIDFactory uuidf, 
 									ExecutionFactory ef, 
 									DataValueFactory dvf,
                                     boolean convertIdToLower)
 	{
 		super(uuidf,ef,dvf,convertIdToLower);
 		
-		initInfo(SYSDUMMY1_COLUMN_COUNT, TABLENAME_STRING, 
+		initInfo(SYSDUMMY1_COLUMN_COUNT, "SYSDUMMY1", 
 				 null, null, uuids);
 	}
 
@@ -111,12 +101,6 @@
 		return null;
 	}
 
-  	public ExecIndexRow	buildEmptyIndexRow(int indexNumber, RowLocation rowLocation)
-  		throws StandardException
-	{
-		return null;
-	}
-
 	/**
 	 * Builds a list of columns suitable for creating this Catalog.
 	 *
@@ -124,24 +108,10 @@
 	 * @return array of SystemColumn suitable for making this catalog.
 	 */
 	public SystemColumn[] buildColumnList()
-	{
-		if (columnList != null)
-			return columnList;
-
-		columnList = new SystemColumn[SYSDUMMY1_COLUMN_COUNT];
-		
-		columnList[0] = new SystemColumnImpl(
-						   convertIdCase( "IBMREQD"),			// column name
-						   SYSDUMMY1_IBMREQD,    // column number
-						   0,					// precision
-						   0,					// scale
-						   true,				// nullability
-						   "CHAR",				// dataType
-						   true,				// built-in type
-						   1					// maxLength
-						   );
-		
-		return columnList;
+	{        
+        return new SystemColumn[] {
+                SystemColumnImpl.getColumn("IBMREQD", Types.CHAR, true, 1)
+        };
 	}
 
 

Modified: db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSFILESRowFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSFILESRowFactory.java?rev=436921&r1=436920&r2=436921&view=diff
==============================================================================
--- db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSFILESRowFactory.java (original)
+++ db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSFILESRowFactory.java Fri Aug 25 13:02:02 2006
@@ -46,6 +46,8 @@
 import org.apache.derby.iapi.services.uuid.UUIDFactory;
 import org.apache.derby.catalog.TypeDescriptor;
 import org.apache.derby.catalog.UUID;
+
+import java.sql.Types;
 import java.util.Properties;
 
 /**
@@ -56,27 +58,27 @@
  * @author Rick Hillegas (extracted from DataDictionaryImpl).
  */
 
-public class SYSFILESRowFactory extends CatalogRowFactory
+class SYSFILESRowFactory extends CatalogRowFactory
 {
-	protected static final String	TABLENAME_STRING = "SYSFILES";
+	private static final String	TABLENAME_STRING = "SYSFILES";
 
-	protected static final int		SYSFILES_COLUMN_COUNT = 4;
+    private static final int		SYSFILES_COLUMN_COUNT = 4;
 
 	/* Column #s (1 based) */
-	protected static final int		ID_COL_NUM = 1;
-	protected static final String   ID_COL_NAME = "FILEID";
+    private static final int		ID_COL_NUM = 1;
+    private static final String   ID_COL_NAME = "FILEID";
 
-	protected static final int		SCHEMA_ID_COL_NUM = 2;
-	protected static final String   SCHEMA_ID_COL_NAME = "SCHEMAID";
+    private static final int		SCHEMA_ID_COL_NUM = 2;
+    private static final String   SCHEMA_ID_COL_NAME = "SCHEMAID";
 
-	protected static final int		NAME_COL_NUM = 3;
-	protected static final String   NAME_COL_NAME = "FILENAME";
+    private static final int		NAME_COL_NUM = 3;
+    private static final String   NAME_COL_NAME = "FILENAME";
 
-	protected static final int		GENERATION_ID_COL_NUM = 4;
-	protected static final String   GENERATION_ID_COL_NAME = "GENERATIONID";
+    private static final int		GENERATION_ID_COL_NUM = 4;
+    private static final String   GENERATION_ID_COL_NAME = "GENERATIONID";
 
-	protected static final int		SYSFILES_INDEX1_ID = 0;
-	protected static final int		SYSFILES_INDEX2_ID = 1;
+    static final int		SYSFILES_INDEX1_ID = 0;
+    static final int		SYSFILES_INDEX2_ID = 1;
 
 	private static final int[][] indexColumnPositions =
 	{
@@ -100,7 +102,7 @@
 	//
 	/////////////////////////////////////////////////////////////////////////////
 
-    public	SYSFILESRowFactory(UUIDFactory uuidf, ExecutionFactory ef, DataValueFactory dvf,
+    SYSFILESRowFactory(UUIDFactory uuidf, ExecutionFactory ef, DataValueFactory dvf,
                                  boolean convertIdToLower) 
 	{
 		super(uuidf,ef,dvf,convertIdToLower);
@@ -159,46 +161,6 @@
 		return row;
 	}
 
-	/**
-	 * Builds an empty index row.
-	 *
-	 *	@param	indexNumber	Index to build empty row for.
-	 *  @param  rowLocation	Row location for last column of index row
-	 *
-	 * @return corresponding empty index row
-	 * @exception   StandardException thrown on failure
-	 */
-	public ExecIndexRow	buildEmptyIndexRow( int indexNumber,
-											RowLocation rowLocation) 
-			throws StandardException
-	{
-		int ncols = getIndexColumnCount(indexNumber);
-		ExecIndexRow row = getExecutionFactory().getIndexableRow(ncols + 1);
-
-		row.setColumn(ncols + 1,  rowLocation);
-
-		switch( indexNumber )
-		{
-		    case SYSFILES_INDEX1_ID:
-				/* 1st column is NAME (varchar(128)) */
-				row.setColumn(1, getDataValueFactory().getVarcharDataValue((String) null));
-
-				/* 2nd column is SCHEMAID (UUID - char(36)) */
-				row.setColumn(2, getDataValueFactory().getCharDataValue((String) null));
-
-				break;
-
-		    case SYSFILES_INDEX2_ID:
-				/* 1st column is ID (UUID - char(36)) */
-				row.setColumn(1,
-							  getDataValueFactory().getCharDataValue((String) null));
-
-				break;
-		}	// end switch
-
-		return	row;
-	}
-
 	///////////////////////////////////////////////////////////////////////////
 	//
 	//	ABSTRACT METHODS TO BE IMPLEMENTED BY CHILDREN OF CatalogRowFactory
@@ -282,52 +244,14 @@
 	 *
 	 * @return array of SystemColumn suitable for making this catalog.
 	 */
-	public SystemColumn[]	buildColumnList()
-	{
-		int						index = 0;
-		SystemColumn[]			columnList = new SystemColumn[SYSFILES_COLUMN_COUNT];
-
-		// describe columns
-
-		columnList[index++] = new SystemColumnImpl(	
-								convertIdCase( ID_COL_NAME),		// column name
-								ID_COL_NUM,	        // column number
-								0,					// precision
-								0,					// scale
-								false,				// nullability
-								"CHAR",				// dataType
-								true,				// built-in type
-								36					// maxLength
-			                   );
-
-		columnList[index++] = new SystemColumnImpl(	
-								convertIdCase( SCHEMA_ID_COL_NAME),	// column name
-								SCHEMA_ID_COL_NUM,	// schema number
-								0,					// precision
-								0,					// scale
-								false,				// nullability
-								"CHAR",				// dataType
-								true,				// built-in type
-								36					// maxLength
-			                   );
-
-		columnList[index++] = new SystemColumnImpl(	
-								convertIdCase( NAME_COL_NAME),		// column name
-								NAME_COL_NUM, 	    // column number
-								false				// nullability
-			                   );
-		columnList[index++] = 
-					new SystemColumnImpl(	
-							convertIdCase( GENERATION_ID_COL_NAME),		// column name
-							GENERATION_ID_COL_NUM,	// column number
-							0,					// precision
-							0,					// scale
-							false,				// nullability
-							"BIGINT",			// dataType
-							true,				// built-in type
-							TypeId.LONGINT_MAXWIDTH	// maxLength
-			               );
-		return	columnList;
-	}
-
+    public SystemColumn[]   buildColumnList()
+    {
+        return new SystemColumn[] {
+           SystemColumnImpl.getUUIDColumn(ID_COL_NAME, false),
+           SystemColumnImpl.getUUIDColumn(SCHEMA_ID_COL_NAME, false),
+           SystemColumnImpl.getIdentifierColumn(NAME_COL_NAME, false),
+           SystemColumnImpl.getColumn(GENERATION_ID_COL_NAME, Types.BIGINT, false)
+                
+        };
+    }
 }

Modified: db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSFOREIGNKEYSRowFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSFOREIGNKEYSRowFactory.java?rev=436921&r1=436920&r2=436921&view=diff
==============================================================================
--- db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSFOREIGNKEYSRowFactory.java (original)
+++ db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSFOREIGNKEYSRowFactory.java Fri Aug 25 13:02:02 2006
@@ -178,30 +178,6 @@
 		return row;
 	}
 
-	/**
-	 * Builds an empty index row.
-	 *
-	 *	@param	indexNumber	Index to build empty row for.
-	 *  @param  rowLocation	Row location for last column of index row
-	 *
-	 * @return corresponding empty index row
-	 * @exception   StandardException thrown on failure
-	 */
-	public ExecIndexRow	buildEmptyIndexRow( int indexNumber,
-											RowLocation rowLocation) 
-			throws StandardException
-	{
-		int ncols = getIndexColumnCount(indexNumber);
-		ExecIndexRow row = getExecutionFactory().getIndexableRow(ncols + 1);
-
-		row.setColumn(ncols +1, rowLocation);
-
-		/* 1st column is CONSTRAINTID (char(36)) or KEYCONSTRAINTID (char(36)) */
-		row.setColumn(1, getDataValueFactory().getCharDataValue((String) null));
-
-		return	row;
-	}
-
 	///////////////////////////////////////////////////////////////////////////
 	//
 	//	ABSTRACT METHODS TO BE IMPLEMENTED BY CHILDREN OF CatalogRowFactory

Modified: db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSKEYSRowFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSKEYSRowFactory.java?rev=436921&r1=436920&r2=436921&view=diff
==============================================================================
--- db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSKEYSRowFactory.java (original)
+++ db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSKEYSRowFactory.java Fri Aug 25 13:02:02 2006
@@ -151,46 +151,7 @@
 		return row;
 	}
 
-	/**
-	 * Builds an empty index row.
-	 *
-	 *	@param	indexNumber	Index to build empty row for.
-	 *  @param  rowLocation	Row location for last column of index row
-	 *
-	 * @return corresponding empty index row
-	 * @exception   StandardException thrown on failure
-	 */
-	public ExecIndexRow	buildEmptyIndexRow( int indexNumber,
-											RowLocation rowLocation) 
-			throws StandardException
-	{
-		ExecIndexRow			row = null;
 
-		switch( indexNumber )
-		{
-		    case SYSKEYS_INDEX1_ID:
-				
-				/* Build the row */
-				row = getExecutionFactory().getIndexableRow(2);
-
-				/* 1st column is CONSTRAINTID (char(36)) */
-				row.setColumn(1, getDataValueFactory().getCharDataValue((String) null));
-
-				row.setColumn(2, rowLocation);
-
-				break;
-
-		    default:
-
-				if (SanityManager.DEBUG)
-					SanityManager.NOTREACHED();
-				return null;
-
-
-		}	// end switch
-
-		return	row;
-	}
 
 	///////////////////////////////////////////////////////////////////////////
 	//

Modified: db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSROUTINEPERMSRowFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSROUTINEPERMSRowFactory.java?rev=436921&r1=436920&r2=436921&view=diff
==============================================================================
--- db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSROUTINEPERMSRowFactory.java (original)
+++ db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSROUTINEPERMSRowFactory.java Fri Aug 25 13:02:02 2006
@@ -206,33 +206,6 @@
     } // end of buildColumnList
 
 	/**
-	 * builds an empty row given for a given index number.
-	 */
-  	public ExecIndexRow buildEmptyIndexRow(int indexNumber,
-                                           RowLocation rowLocation)
-  		throws StandardException
-    {
-        ExecIndexRow row = getExecutionFactory().getIndexableRow( indexColumnPositions[indexNumber].length + 1);
-        row.setColumn( row.nColumns(), rowLocation);
-        
-        switch( indexNumber)
-        {
-        case GRANTEE_ALIAS_GRANTOR_INDEX_NUM:
-            row.setColumn(1, getNullAuthorizationID()); // grantee
-            row.setColumn(2, getDataValueFactory().getNullChar( (StringDataValue) null)); // table UUID
-            row.setColumn(3, getNullAuthorizationID()); // grantor
-            break;
-        case ROUTINEPERMSID_INDEX_NUM:
-            row.setColumn(1, getDataValueFactory().getNullChar( (StringDataValue) null)); // ROUTINEPERMSID
-            break;
-        case ALIASID_INDEX_NUM:
-            row.setColumn(1, getDataValueFactory().getNullChar( (StringDataValue) null)); // ROUTINEPERMSID
-            break;
-        }
-        return row;
-    } // end of buildEmptyIndexRow
-
-	/**
 	 * builds an index key row given for a given index number.
 	 */
   	public ExecIndexRow buildIndexKeyRow( int indexNumber,

Modified: db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSSCHEMASRowFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSSCHEMASRowFactory.java?rev=436921&r1=436920&r2=436921&view=diff
==============================================================================
--- db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSSCHEMASRowFactory.java (original)
+++ db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSSCHEMASRowFactory.java Fri Aug 25 13:02:02 2006
@@ -158,41 +158,6 @@
 		return row;
 	}
 
-	/**
-	 * Builds an empty index row.
-	 *
-	 *	@param	indexNumber	Index to build empty row for.
-	 *  @param  rowLocation	Row location for last column of index row
-	 *
-	 * @return corresponding empty index row
-	 * @exception   StandardException thrown on failure
-	 */
-	public ExecIndexRow	buildEmptyIndexRow( int indexNumber,
-											RowLocation rowLocation) 
-			throws StandardException
-	{
-		int ncols = getIndexColumnCount(indexNumber);
-		ExecIndexRow row = getExecutionFactory().getIndexableRow(ncols + 1);
-
-		row.setColumn(ncols + 1, rowLocation);
-
-
-		switch( indexNumber )
-		{
-		    case SYSSCHEMAS_INDEX1_ID:
-				/* 1st column is SCHEMANAME (varchar(128)) */
-				row.setColumn(1, getDataValueFactory().getVarcharDataValue((String) null));
-				break;
-
-		    case SYSSCHEMAS_INDEX2_ID:
-				/* 1st column is SCHEMAID (UUID - char(36)) */
-				row.setColumn(1, getDataValueFactory().getCharDataValue((String) null));
-				break;
-
-		}	// end switch
-
-		return	row;
-	}
 
 	///////////////////////////////////////////////////////////////////////////
 	//

Modified: db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSSTATEMENTSRowFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSSTATEMENTSRowFactory.java?rev=436921&r1=436920&r2=436921&view=diff
==============================================================================
--- db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSSTATEMENTSRowFactory.java (original)
+++ db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSSTATEMENTSRowFactory.java Fri Aug 25 13:02:02 2006
@@ -234,40 +234,6 @@
 		return row;
 	}
 
-	/**
-	 * Builds an empty index row.
-	 *
-	 * @param	indexNumber	Index to build empty row for.
-	 * @param  rowLocation	Row location for last column of index row
-	 *
-	 * @return corresponding empty index row
-	 * @exception   StandardException thrown on failure
-	 */
-	public ExecIndexRow	buildEmptyIndexRow( int indexNumber,
-											RowLocation rowLocation) 
-			throws StandardException
-	{
-		int ncols = getIndexColumnCount(indexNumber);
-		ExecIndexRow row = getExecutionFactory().getIndexableRow(ncols + 1);
-
-		row.setColumn(ncols + 1, rowLocation);
-
-		switch( indexNumber )
-		{
-		    case SYSSTATEMENTS_INDEX1_ID:
-				/* 1st column is STMTID (UUID - char(36)) */
-				row.setColumn(1, getDataValueFactory().getCharDataValue((String) null));
-				break;
-
-		    case SYSSTATEMENTS_INDEX2_ID:
-				/* 1st column is STMTNAME (varchar(128)) */
-				row.setColumn(1, getDataValueFactory().getVarcharDataValue((String) null));
-				break;
-		}	// end switch
-
-		return	row;
-	}
-
 	///////////////////////////////////////////////////////////////////////////
 	//
 	//	ABSTRACT METHODS TO BE IMPLEMENTED BY CHILDREN OF CatalogRowFactory

Modified: db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSSTATISTICSRowFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSSTATISTICSRowFactory.java?rev=436921&r1=436920&r2=436921&view=diff
==============================================================================
--- db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSSTATISTICSRowFactory.java (original)
+++ db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSSTATISTICSRowFactory.java Fri Aug 25 13:02:02 2006
@@ -232,18 +232,6 @@
 										   statType, stat, columnCount);
 	}			
 
-	public ExecIndexRow	buildEmptyIndexRow(int indexNumber,
-										   RowLocation rowLocation) 
-			throws StandardException
-	{
-		/* there is only one index-- just use hardwired values. */
-		ExecIndexRow row = getExecutionFactory().getIndexableRow(3);
-		row.setColumn(1, getDataValueFactory().getCharDataValue((String)null));
-		row.setColumn(2, getDataValueFactory().getCharDataValue((String)null));
-		row.setColumn(3, rowLocation);
-		return row;
-	}
-
 	/**
 	 * Builds a list of columns suitable for creating this Catalog.
 	 *

Modified: db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSTABLEPERMSRowFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSTABLEPERMSRowFactory.java?rev=436921&r1=436920&r2=436921&view=diff
==============================================================================
--- db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSTABLEPERMSRowFactory.java (original)
+++ db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSTABLEPERMSRowFactory.java Fri Aug 25 13:02:02 2006
@@ -296,33 +296,6 @@
     } // end of buildColumnList
 
 	/**
-	 * builds an empty row given for a given index number.
-	 */
-  	public ExecIndexRow buildEmptyIndexRow(int indexNumber,
-                                           RowLocation rowLocation)
-  		throws StandardException
-    {
-        ExecIndexRow row = getExecutionFactory().getIndexableRow( indexColumnPositions[indexNumber].length + 1);
-        row.setColumn( row.nColumns(), rowLocation);
-        
-        switch( indexNumber)
-        {
-        case GRANTEE_TABLE_GRANTOR_INDEX_NUM:
-            row.setColumn(1, getNullAuthorizationID()); // grantee
-            row.setColumn(2, getDataValueFactory().getNullChar( (StringDataValue) null)); // table UUID
-            row.setColumn(3, getNullAuthorizationID()); // grantor
-            break;
-        case TABLEPERMSID_INDEX_NUM:
-            row.setColumn(1, getDataValueFactory().getNullChar( (StringDataValue) null)); // TABLEPERMSID
-            break;
-        case TABLEID_INDEX_NUM:
-            row.setColumn(1, getDataValueFactory().getNullChar( (StringDataValue) null)); // TABLEID
-            break;
-        }
-        return row;
-    } // end of buildEmptyIndexRow
-
-	/**
 	 * builds a key row given for a given index number.
 	 */
   	public ExecIndexRow buildIndexKeyRow( int indexNumber,

Modified: db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSTABLESRowFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSTABLESRowFactory.java?rev=436921&r1=436920&r2=436921&view=diff
==============================================================================
--- db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSTABLESRowFactory.java (original)
+++ db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSTABLESRowFactory.java Fri Aug 25 13:02:02 2006
@@ -55,7 +55,7 @@
  * @author Rick Hillegas (extracted from DataDictionaryImpl).
  */
 
-public class SYSTABLESRowFactory extends CatalogRowFactory
+class SYSTABLESRowFactory extends CatalogRowFactory
 {
 	private static final String		TABLENAME_STRING = "SYSTABLES";
 
@@ -96,7 +96,7 @@
 	//
 	/////////////////////////////////////////////////////////////////////////////
 
-    public	SYSTABLESRowFactory(UUIDFactory uuidf, ExecutionFactory ef, DataValueFactory dvf,
+    SYSTABLESRowFactory(UUIDFactory uuidf, ExecutionFactory ef, DataValueFactory dvf,
                                 boolean convertIdToLower)
 	{
 		super(uuidf,ef,dvf,convertIdToLower);
@@ -227,7 +227,7 @@
 	 * @return corresponding empty index row
 	 * @exception   StandardException thrown on failure
 	 */
-	public ExecIndexRow	buildEmptyIndexRow( int indexNumber,
+	ExecIndexRow	buildEmptyIndexRow( int indexNumber,
 											RowLocation rowLocation)
 			throws StandardException
 	{

Modified: db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSTRIGGERSRowFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSTRIGGERSRowFactory.java?rev=436921&r1=436920&r2=436921&view=diff
==============================================================================
--- db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSTRIGGERSRowFactory.java (original)
+++ db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSTRIGGERSRowFactory.java Fri Aug 25 13:02:02 2006
@@ -248,50 +248,6 @@
 		return row;
 	}
 
-	/**
-	 * Builds an empty index row.
-	 *
-	 * @param	indexNumber	Index to build empty row for.
-	 * @param  rowLocation	Row location for last column of index row
-	 *
-	 * @return corresponding empty index row
-	 * @exception   StandardException thrown on failure
-	 */
-	public ExecIndexRow	buildEmptyIndexRow( int indexNumber,
-											RowLocation rowLocation) 
-			throws StandardException
-	{
-		int ncols = getIndexColumnCount(indexNumber);
-		ExecIndexRow row = getExecutionFactory().getIndexableRow(ncols + 1);
-
-		row.setColumn(ncols + 1, rowLocation);
-
-		switch( indexNumber )
-		{
-		    case SYSTRIGGERS_INDEX1_ID:
-				/* 1st column is TRIGGERID (UUID - char(36)) */
-				row.setColumn(1, getDataValueFactory().getCharDataValue((String) null));
-				break;
-
-		    case SYSTRIGGERS_INDEX2_ID:
-				/* 1st column is TRIGGERNAME (varchar(128)) */
-				row.setColumn(1, getDataValueFactory().getVarcharDataValue((String) null));
-
-				/* 2nd column is SCHEMAID (char(32)) */
-				row.setColumn(2, getDataValueFactory().getCharDataValue((String) null));
-				break;
-
-		    case SYSTRIGGERS_INDEX3_ID:
-				/* 1nd column is TABLEID (char(32)) */
-				row.setColumn(2, getDataValueFactory().getCharDataValue((String) null));
-
-				/* 2nd column is COMPILATIONTIMESTAMP (timestamp) */
-				row.setColumn(2, new SQLTimestamp());
-				break;
-		}	// end switch
-
-		return	row;
-	}
 
 	///////////////////////////////////////////////////////////////////////////
 	//
@@ -666,11 +622,6 @@
 							);
 
 		return	columnList;
-	}
-
-	public int heapColumnCount()
-	{
-		return SYSTRIGGERS_COLUMN_COUNT;
 	}
 
 	// a little helper

Modified: db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSVIEWSRowFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSVIEWSRowFactory.java?rev=436921&r1=436920&r2=436921&view=diff
==============================================================================
--- db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSVIEWSRowFactory.java (original)
+++ db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/SYSVIEWSRowFactory.java Fri Aug 25 13:02:02 2006
@@ -188,31 +188,7 @@
 
 		return row;
 	}
-
-	/**
-	 * Builds an empty index row.
-	 *
-	 *	@param	indexNumber	Index to build empty row for.
-	 *  @param  rowLocation	Row location for last column of index row
-	 *
-	 * @return corresponding empty index row
-	 * @exception   StandardException thrown on failure
-	 */
-	public ExecIndexRow	buildEmptyIndexRow( int indexNumber,
-											RowLocation rowLocation) 
-			throws StandardException
-	{
-		/* Build the row  */
-		ExecIndexRow row = getExecutionFactory().getIndexableRow(2);
-
-		/* 1st column is TABLEID (char(36)) */
-		row.setColumn(1, getDataValueFactory().getCharDataValue((String) null));
-
-		row.setColumn(2, rowLocation);
-
-		return	row;
-	}
-
+    
 	///////////////////////////////////////////////////////////////////////////
 	//
 	//	ABSTRACT METHODS TO BE IMPLEMENTED BY CHILDREN OF CatalogRowFactory
@@ -349,10 +325,5 @@
 							36					// maxLength
 			                );
 		return	columnList;
-	}
-
-	public int heapColumnCount()
-	{
-		return SYSVIEWS_COLUMN_COUNT;
 	}
 }

Modified: db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/TabInfoImpl.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/TabInfoImpl.java?rev=436921&r1=436920&r2=436921&view=diff
==============================================================================
--- db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/TabInfoImpl.java (original)
+++ db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/catalog/TabInfoImpl.java Fri Aug 25 13:02:02 2006
@@ -616,9 +616,26 @@
 						   null,
 						   key,
 						   ScanController.GT,
-						   indexNumber);
+						   indexNumber,
+						   true);
 	}
 
+	public int deleteRow( TransactionController tc, ExecIndexRow key,
+							int indexNumber, boolean wait)
+		throws StandardException
+	{
+		//  Always row locking
+		return  deleteRows(tc,
+						   key,
+						   ScanController.GE,
+						   null,
+						   null,
+						   key,
+						   ScanController.GT,
+						   indexNumber,
+						   wait);
+	}
+	
 	/**
 	 * LOCKING: row locking if there is both a start and
 	 * stop key; otherwise table locking
@@ -627,13 +644,37 @@
 	 * @see TabInfo#deleteRows
 	 */
 	public int deleteRows(TransactionController tc,
+							ExecIndexRow startKey,
+							int startOp,
+							Qualifier[][] qualifier,
+							TupleFilter filter,
+							ExecIndexRow stopKey,
+							int stopOp,
+							int indexNumber) throws StandardException
+    {
+		return  deleteRows(tc,
+				   startKey,
+				   startOp,
+				   qualifier,
+				   filter,
+				   stopKey,
+				   stopOp,
+				   indexNumber,
+				   true);
+    }
+
+	/**
+	 * @inheritDoc
+	 */
+	public int deleteRows(TransactionController tc,
 						  ExecIndexRow startKey,
 						  int startOp,
 						  Qualifier[][] qualifier,
 						  TupleFilter filter,
 						  ExecIndexRow stopKey,
 						  int stopOp,
-						  int indexNumber)
+						  int indexNumber,
+						  boolean wait)
 		 throws StandardException
 	{
 		ConglomerateController		heapCC;
@@ -644,7 +685,7 @@
 		ExecRow						baseRow = crf.makeEmptyRow();
 		int                         rowsDeleted = 0;
 		boolean						passedFilter = true;
-
+		
 		rc = getRowChanger( tc, (int[])null,baseRow );
 
 		/*
@@ -666,7 +707,7 @@
 				TransactionController.ISOLATION_SERIALIZABLE;
 
 		// Row level locking
-		rc.open(lockMode);
+		rc.open(lockMode, wait);
 
 		DataValueDescriptor[] startKeyRow = 
             startKey == null ? null : startKey.getRowArray();
@@ -678,14 +719,16 @@
 		heapCC = tc.openConglomerate(
                     getHeapConglomerate(),
                     false,
-                    TransactionController.OPENMODE_FORUPDATE,
+                    (TransactionController.OPENMODE_FORUPDATE |
+                            ((wait) ? 0 : TransactionController.OPENMODE_LOCK_NOWAIT)),
                     lockMode,
                     TransactionController.ISOLATION_REPEATABLE_READ);
 
 		drivingScan = tc.openScan(
 			getIndexConglomerate(indexNumber),  // conglomerate to open
 			false, // don't hold open across commit
-            TransactionController.OPENMODE_FORUPDATE, // for update
+			(TransactionController.OPENMODE_FORUPDATE | 
+				((wait) ? 0 : TransactionController.OPENMODE_LOCK_NOWAIT)),
             lockMode,
 			isolation,
 			(FormatableBitSet) null, // all fields as objects
@@ -729,6 +772,7 @@
 		heapCC.close();
 		drivingScan.close();
 		rc.close();
+		
 		return rowsDeleted;
 	}
 



Mime
View raw message