db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r608580 - in /db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog: DD_Version.java DataDictionaryImpl.java
Date Thu, 03 Jan 2008 18:03:38 GMT
Author: djd
Date: Thu Jan  3 10:03:35 2008
New Revision: 608580

URL: http://svn.apache.org/viewvc?rev=608580&view=rev
Log:
DERBY-2775 (partial) Remove one use of DataTypeDescriptor.setNullability() that was not required.
Nullabilty was being set for system columns that needed to be upgraded in old databases from
an incorrect value. Using the nullability of the original definition is already correct and
avoids redundant setting. Changed the name of the method as it is now a generic fix a system
column rather than being specific to nullability. 

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DD_Version.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DD_Version.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DD_Version.java?rev=608580&r1=608579&r2=608580&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DD_Version.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DD_Version.java Thu
Jan  3 10:03:35 2008
@@ -762,17 +762,17 @@
 		{
 			// SYSSTATEMENTS table ==> SYSSTATEMENTS_COMPILATION_SCHEMAID needs 
 			// to be modified.
-			bootingDictionary.upgrade_setNullability(rowFactory,
+			bootingDictionary.upgradeFixSystemColumnDefinition(rowFactory,
 				SYSSTATEMENTSRowFactory.SYSSTATEMENTS_COMPILATION_SCHEMAID, 
-				true, tc);
+				tc);
 		}
 		else if (catalogNum == DataDictionaryImpl.SYSVIEWS_CATALOG_NUM)
 		{
 			// SYSVIEWS table ==> SYSVIEWS_COMPILATION_SCHEMAID needs 
 			// to be modified.
-			bootingDictionary.upgrade_setNullability(rowFactory,
+			bootingDictionary.upgradeFixSystemColumnDefinition(rowFactory,
 				SYSVIEWSRowFactory.SYSVIEWS_COMPILATION_SCHEMAID, 
-				true, tc);
+				tc);
 		}
 		
 		/* OLD Cloudscape 5.1 upgrade code. See applySafeChanges(). 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java?rev=608580&r1=608579&r2=608580&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
Thu Jan  3 10:03:35 2008
@@ -6922,31 +6922,31 @@
 		addSystemTableToDictionary(ti, sd, tc, ddg);
 	}							 
 	/**
-	  *	Upgrade an existing catalog by  setting the nullability
+	  *	Upgrade an existing system catalog column's definition
+      * by setting it to the value it would have in a newly
+      * created database. This is only used to for a couple
+      * of columns that had incorrectly nullability. Other
+      * uses (e.g. changing column type) might require more work.
 	  *
 	  *	@param	columnNumber			The column to change
-	  *	@param	nullability				true if nullable 
 	  *	@param	tc						Transaction controller
 	  *
 	  *	@exception StandardException Standard Derby error policy
 	  */
-	public void upgrade_setNullability(CatalogRowFactory rowFactory,
+	public void upgradeFixSystemColumnDefinition(CatalogRowFactory rowFactory,
 									   int columnNumber,
-									   boolean nullability,
 									   TransactionController tc)
 		throws StandardException
 	{
 		SystemColumn		theColumn;
 		SystemColumn[]		columns = rowFactory.buildColumnList();
 		SchemaDescriptor	sd = getSystemSchemaDescriptor();
-		String columnName;
 
 		TableDescriptor td = getTableDescriptor(rowFactory.getCatalogName(), sd, tc);
 
 		theColumn = columns[columnNumber - 1];	// from 1 to 0 based
 		ColumnDescriptor cd = makeColumnDescriptor(theColumn, columnNumber, td );
-		columnName = cd.getColumnName();
-		cd.getType().setNullability(nullability);
+		String columnName = cd.getColumnName();
 		int[] columnNameColArray = new int[1];
 		columnNameColArray[0] = SYSCOLUMNSRowFactory.SYSCOLUMNS_COLUMNDATATYPE ;
 		updateColumnDescriptor(cd,



Mime
View raw message