db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmars...@apache.org
Subject svn commit: r413129 - in /db/derby/code/trunk/java: engine/org/apache/derby/iapi/sql/conn/ engine/org/apache/derby/iapi/sql/dictionary/ engine/org/apache/derby/impl/sql/catalog/ engine/org/apache/derby/impl/sql/compile/ engine/org/apache/derby/impl/sql...
Date Fri, 09 Jun 2006 19:23:48 GMT
Author: kmarsden
Date: Fri Jun  9 12:23:47 2006
New Revision: 413129

URL: http://svn.apache.org/viewvc?rev=413129&view=rev
Log:
DERBY-1327 Identity column can be created with wrong and very large start with v
alue with "J2RE 1.5.0 IBM Windows 32 build pwi32dev-20060412 (SR2)" with JIT on

The fix for this issue would be to reduce the number of parameters required by the constructor
to <=10 in org.apache.derby.iapi.sql.dictionary.ColumnDescriptor class. While researching
into this, I found that all the 3 constructors in the class have a parameter named autoinc
and it is defined as a boolean. This parameter is always equal to (parameter named autoincInc
!= 0). In my patch (Derby1327WrongStartKeyPatch1CodelineTrunk.txt) which is attached to this
JIRA, I have removed the autoinc parameter and inside the constructors, I use (parameter named
autoincInc != 0) instead of relying on autoinc. This cleans up the constructor parameter passing
for all the 3 constructors and also brings down the number of parameters to <=10. The test
program from the JIRA entry runs fine with this change and I have created a new test JitTest.java
based on that test program. Hopefully this test can be a place holder for any future JIT issues.
I also ran the test suites and there were no new 
 failures.

I also removed the import of org.apache.derby.iapi.sql.dictionary.ColumnDescriptor from some
classes which didn't really use ColumnDescriptor.

Contributed by Mamta Satoor


Added:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/JitTest.out
  (with props)
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/JitTest.java
  (with props)
Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/conn/LanguageConnectionContext.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/ColumnDescriptor.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSCOLUMNSRowFactory.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSFILESRowFactory.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CallStatementNode.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromList.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromSubquery.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/InsertNode.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ResultColumnList.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SubqueryList.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UpdateNode.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/AlterTableConstantAction.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/ConstraintConstantAction.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/CreateTableConstantAction.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/CreateViewConstantAction.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DropConstraintConstantAction.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DropIndexConstantAction.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DropSchemaConstantAction.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DropViewConstantAction.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericResultSetFactory.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/IndexConstantAction.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/InsertConstantAction.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/SetConstraintsConstantAction.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/WriteCursorConstantAction.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbylang.runall

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/conn/LanguageConnectionContext.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/conn/LanguageConnectionContext.java?rev=413129&r1=413128&r2=413129&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/conn/LanguageConnectionContext.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/conn/LanguageConnectionContext.java
Fri Jun  9 12:23:47 2006
@@ -27,7 +27,6 @@
 import org.apache.derby.iapi.sql.compile.CompilerContext;
 import org.apache.derby.iapi.sql.dictionary.DataDictionary;
 import org.apache.derby.iapi.sql.dictionary.TableDescriptor;
-import org.apache.derby.iapi.sql.dictionary.ColumnDescriptor;
 import org.apache.derby.iapi.sql.dictionary.SchemaDescriptor;
 import org.apache.derby.iapi.sql.compile.OptimizerFactory;
 import org.apache.derby.iapi.types.DataValueFactory;

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/ColumnDescriptor.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/ColumnDescriptor.java?rev=413129&r1=413128&r2=413129&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/ColumnDescriptor.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/ColumnDescriptor.java
Fri Jun  9 12:23:47 2006
@@ -95,7 +95,6 @@
 	 * @param defaultUUID			The UUID for the default, if any.
 	 * @param autoincStart	Start value for an autoincrement column.
 	 * @param autoincInc	Increment for autoincrement column
-	 * @param autoinc		boolean value for sanity checking.
 	 * @param userChangedWhat		Adding an autoincrement column OR
 	 *						changing increment value or start value of
 	 *						the autoincrement column.
@@ -105,12 +104,12 @@
 					 DataTypeDescriptor columnType, DataValueDescriptor columnDefault,
 					 DefaultInfo columnDefaultInfo,
 					 TableDescriptor table,
-					 UUID defaultUUID, long autoincStart, long autoincInc, boolean autoinc,
+					 UUID defaultUUID, long autoincStart, long autoincInc, 
 					 long userChangedWhat)
 	{
 		this(columnName, columnPosition, columnType, columnDefault,
 				columnDefaultInfo, table, defaultUUID, autoincStart,
-				autoincInc, autoinc);				
+				autoincInc);				
 		autoinc_create_or_modify_Start_Increment = userChangedWhat;
 	}
 
@@ -130,14 +129,13 @@
 		 * @param defaultUUID			The UUID for the default, if any.
 		 * @param autoincStart	Start value for an autoincrement column.
 		 * @param autoincInc	Increment for autoincrement column
-		 * @param autoinc		boolean value for sanity checking.
 		 */
 
 		public ColumnDescriptor(String columnName, int columnPosition,
 						 DataTypeDescriptor columnType, DataValueDescriptor columnDefault,
 						 DefaultInfo columnDefaultInfo,
 						 TableDescriptor table,
-						 UUID defaultUUID, long autoincStart, long autoincInc, boolean autoinc)
+						 UUID defaultUUID, long autoincStart, long autoincInc)
 		{
 		this.columnName = columnName;
 		this.columnPosition = columnPosition;
@@ -151,7 +149,7 @@
 			this.uuid = table.getUUID();
 		}
 
-		assertAutoinc(autoinc,
+		assertAutoinc(autoincInc != 0,
 			      autoincInc,
 			      columnDefaultInfo);
 
@@ -178,14 +176,13 @@
 	 * @param defaultUUID			The UUID for the default, if any.
 	 * @param autoincStart	Start value for an autoincrement column.
 	 * @param autoincInc	Increment for autoincrement column
-	 * @param autoinc		Boolean value, for sanity checking.
 	 */
 	public ColumnDescriptor(String columnName, int columnPosition,
 		DataTypeDescriptor columnType, DataValueDescriptor columnDefault,
 		DefaultInfo columnDefaultInfo,
 		UUID uuid,
 		UUID defaultUUID,
-        long autoincStart, long autoincInc, boolean autoinc)
+        long autoincStart, long autoincInc)
 
 	{
 		this.columnName = columnName;
@@ -196,7 +193,7 @@
 		this.uuid = uuid;
 		this.defaultUUID = defaultUUID;
 
-		assertAutoinc(autoinc,
+		assertAutoinc(autoincInc!=0,
 			      autoincInc,
 			      columnDefaultInfo);
 		

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=413129&r1=413128&r2=413129&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
Fri Jun  9 12:23:47 2006
@@ -3078,7 +3078,7 @@
                         (DataValueDescriptor)parameterDefaults[index],
                     (DefaultInfo) null,
                     uuid,
-                    (UUID) null, 0, 0, false);
+                    (UUID) null, 0, 0);
 										
 			addDescriptorNow(cd, null, SYSCOLUMNS_CATALOG_NUM, 
 						  false, // no chance of duplicates here
@@ -3262,7 +3262,7 @@
 										  (DefaultInfo) null,
 										  uuid,
 										  (UUID) null,
-										  0, 0, false);
+										  0, 0);
 										
 				updateColumnDescriptor(cd,
 									   cd.getReferencingUUID(), 
@@ -7101,7 +7101,7 @@
 		return new ColumnDescriptor
 			(column.getName(), column.getID(), typeDesc, null, null, td,
 			 (UUID) null, // No defaults yet for system columns
-			 0, 0, false
+			 0, 0
 			 );
 	}
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSCOLUMNSRowFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSCOLUMNSRowFactory.java?rev=413129&r1=413128&r2=413129&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSCOLUMNSRowFactory.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSCOLUMNSRowFactory.java
Fri Jun  9 12:23:47 2006
@@ -503,11 +503,6 @@
 		/* 9th column is AUTOINCREMENTINC (long) */
 		autoincInc = row.getColumn(SYSCOLUMNS_AUTOINCREMENTINC).getLong();
 
-		/* NOTE: We use the autoincColumn variable in order to work around 
-		 * a 1.3.0 HotSpot bug.  (#4361550)
-		 */
-		boolean autoincColumn = (autoincInc != 0); 
-
 		DataValueDescriptor col = row.getColumn(SYSCOLUMNS_AUTOINCREMENTSTART);
 		autoincStart = col.getLong();
 
@@ -516,8 +511,7 @@
 
 		colDesc = new ColumnDescriptor(columnName, columnNumber,
 							dataTypeServices, defaultValue, defaultInfo, uuid, 
-							defaultUUID, autoincStart, autoincInc, 
-							autoincColumn);
+							defaultUUID, autoincStart, autoincInc);
 		return colDesc;
 	}
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSFILESRowFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSFILESRowFactory.java?rev=413129&r1=413128&r2=413129&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSFILESRowFactory.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SYSFILESRowFactory.java
Fri Jun  9 12:23:47 2006
@@ -26,7 +26,6 @@
 import org.apache.derby.iapi.error.StandardException;
 
 import org.apache.derby.iapi.sql.dictionary.CatalogRowFactory;
-import org.apache.derby.iapi.sql.dictionary.ColumnDescriptor;
 import org.apache.derby.iapi.sql.dictionary.DataDescriptorGenerator;
 import org.apache.derby.iapi.sql.dictionary.DataDictionary;
 import org.apache.derby.iapi.sql.dictionary.SchemaDescriptor;

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CallStatementNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CallStatementNode.java?rev=413129&r1=413128&r2=413129&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CallStatementNode.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CallStatementNode.java
Fri Jun  9 12:23:47 2006
@@ -26,7 +26,6 @@
 
 import org.apache.derby.iapi.sql.dictionary.DataDictionary;
 import org.apache.derby.iapi.sql.dictionary.DataDictionaryContext;
-import org.apache.derby.iapi.sql.dictionary.ColumnDescriptor;
 
 import org.apache.derby.iapi.sql.ResultSet;
 import org.apache.derby.iapi.sql.Activation;

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromList.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromList.java?rev=413129&r1=413128&r2=413129&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromList.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromList.java Fri Jun
 9 12:23:47 2006
@@ -33,7 +33,6 @@
 import org.apache.derby.iapi.sql.compile.C_NodeTypes;
 
 import org.apache.derby.iapi.sql.dictionary.DataDictionary;
-import org.apache.derby.iapi.sql.dictionary.ColumnDescriptor;
 
 import org.apache.derby.iapi.error.StandardException;
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromSubquery.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromSubquery.java?rev=413129&r1=413128&r2=413129&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromSubquery.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromSubquery.java Fri
Jun  9 12:23:47 2006
@@ -28,7 +28,6 @@
 import org.apache.derby.iapi.sql.compile.CompilerContext;
 import org.apache.derby.iapi.sql.compile.C_NodeTypes;
 import org.apache.derby.iapi.sql.dictionary.DataDictionary;
-import org.apache.derby.iapi.sql.dictionary.ColumnDescriptor;
 
 import org.apache.derby.iapi.services.sanity.SanityManager;
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/InsertNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/InsertNode.java?rev=413129&r1=413128&r2=413129&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/InsertNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/InsertNode.java Fri
Jun  9 12:23:47 2006
@@ -41,7 +41,6 @@
 
 import org.apache.derby.iapi.reference.ClassName;
 
-import org.apache.derby.iapi.sql.dictionary.ColumnDescriptor;
 import org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor;
 import org.apache.derby.iapi.sql.dictionary.ConstraintDescriptor;
 import org.apache.derby.iapi.sql.dictionary.DataDictionary;

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ResultColumnList.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ResultColumnList.java?rev=413129&r1=413128&r2=413129&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ResultColumnList.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ResultColumnList.java
Fri Jun  9 12:23:47 2006
@@ -728,7 +728,7 @@
 											null,
 											(TableDescriptor) null,
 											null,
-											0, 0, false);
+											0, 0);
 			rc.setColumnDescriptor(null, cd);
 			rc.setVirtualColumnId(index + 1);
 		}

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SubqueryList.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SubqueryList.java?rev=413129&r1=413128&r2=413129&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SubqueryList.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SubqueryList.java Fri
Jun  9 12:23:47 2006
@@ -21,7 +21,6 @@
 package	org.apache.derby.impl.sql.compile;
 
 import org.apache.derby.iapi.sql.dictionary.DataDictionary;
-import org.apache.derby.iapi.sql.dictionary.ColumnDescriptor;
 
 import org.apache.derby.iapi.error.StandardException;
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UpdateNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UpdateNode.java?rev=413129&r1=413128&r2=413129&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UpdateNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UpdateNode.java Fri
Jun  9 12:23:47 2006
@@ -41,7 +41,6 @@
 
 import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;
 
-import org.apache.derby.iapi.sql.dictionary.ColumnDescriptor;
 import org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor;
 import org.apache.derby.iapi.sql.dictionary.ConstraintDescriptorList;
 import org.apache.derby.iapi.sql.dictionary.ConstraintDescriptor;

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/AlterTableConstantAction.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/AlterTableConstantAction.java?rev=413129&r1=413128&r2=413129&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/AlterTableConstantAction.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/AlterTableConstantAction.java
Fri Jun  9 12:23:47 2006
@@ -623,8 +623,7 @@
 												   td,
 												   defaultUUID,
 												   columnInfo[ix].autoincStart,
-												   columnInfo[ix].autoincInc,
-												   columnInfo[ix].autoincInc != 0
+												   columnInfo[ix].autoincInc
 												   );
 
 		dd.addDescriptor(columnDescriptor, td,
@@ -923,8 +922,7 @@
 									td,
 									columnDescriptor.getDefaultUUID(),
 								    columnInfo[ix].autoincStart,
-								    columnInfo[ix].autoincInc,
-								    columnInfo[ix].autoincInc != 0
+								    columnInfo[ix].autoincInc
 									);
 		
 
@@ -966,8 +964,7 @@
 									td,
 									columnDescriptor.getDefaultUUID(),
 									columnDescriptor.getAutoincStart(),
-									columnDescriptor.getAutoincInc(),
-									columnDescriptor.getAutoincInc() != 0);
+									columnDescriptor.getAutoincInc());
 		
 
 
@@ -1035,7 +1032,6 @@
 												   defaultUUID,
 												   columnInfo[ix].autoincStart,
 												   columnInfo[ix].autoincInc,
-												   columnInfo[ix].autoincInc != 0,
 												   columnInfo[ix].autoinc_create_or_modify_Start_Increment
 												   );
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/ConstraintConstantAction.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/ConstraintConstantAction.java?rev=413129&r1=413128&r2=413129&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/ConstraintConstantAction.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/ConstraintConstantAction.java
Fri Jun  9 12:23:47 2006
@@ -30,7 +30,6 @@
 import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;
 
 import org.apache.derby.iapi.sql.dictionary.CheckConstraintDescriptor;
-import org.apache.derby.iapi.sql.dictionary.ColumnDescriptor;
 import org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor;
 import org.apache.derby.iapi.sql.dictionary.ConstraintDescriptor;
 import org.apache.derby.iapi.sql.dictionary.DataDescriptorGenerator;

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/CreateTableConstantAction.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/CreateTableConstantAction.java?rev=413129&r1=413128&r2=413129&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/CreateTableConstantAction.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/CreateTableConstantAction.java
Fri Jun  9 12:23:47 2006
@@ -256,6 +256,7 @@
 				defaultUUID = dd.getUUIDFactory().createUUID();
 			}
 
+			if (columnInfo[ix].autoincInc != 0)//dealing with autoinc column
 			columnDescriptor = new ColumnDescriptor(
 				                   columnInfo[ix].name,
 								   index++,
@@ -266,9 +267,20 @@
 								   defaultUUID,
 								   columnInfo[ix].autoincStart,
 								   columnInfo[ix].autoincInc,
-								   columnInfo[ix].autoincInc != 0,
 								   columnInfo[ix].autoinc_create_or_modify_Start_Increment
 							   );
+			else
+				columnDescriptor = new ColumnDescriptor(
+		                   columnInfo[ix].name,
+						   index++,
+						   columnInfo[ix].dataType,
+						   columnInfo[ix].defaultValue,
+						   columnInfo[ix].defaultInfo,
+						   td,
+						   defaultUUID,
+						   columnInfo[ix].autoincStart,
+						   columnInfo[ix].autoincInc
+					   );
 
 			cdlArray[ix] = columnDescriptor;
 		}

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/CreateViewConstantAction.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/CreateViewConstantAction.java?rev=413129&r1=413128&r2=413129&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/CreateViewConstantAction.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/CreateViewConstantAction.java
Fri Jun  9 12:23:47 2006
@@ -175,8 +175,7 @@
 								   td,
 								   (UUID) null,
 								   columnInfo[ix].autoincStart,
-								   columnInfo[ix].autoincInc,
-								   columnInfo[ix].autoincInc != 0
+								   columnInfo[ix].autoincInc
 							   );
 			cdlArray[ix] = columnDescriptor;
 		}

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DropConstraintConstantAction.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DropConstraintConstantAction.java?rev=413129&r1=413128&r2=413129&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DropConstraintConstantAction.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DropConstraintConstantAction.java
Fri Jun  9 12:23:47 2006
@@ -33,7 +33,6 @@
 
 import org.apache.derby.iapi.sql.StatementType;
 
-import org.apache.derby.iapi.sql.dictionary.ColumnDescriptor;
 import org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor;
 import org.apache.derby.iapi.sql.dictionary.ConstraintDescriptor;
 import org.apache.derby.iapi.sql.dictionary.ConstraintDescriptorList;

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DropIndexConstantAction.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DropIndexConstantAction.java?rev=413129&r1=413128&r2=413129&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DropIndexConstantAction.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DropIndexConstantAction.java
Fri Jun  9 12:23:47 2006
@@ -27,7 +27,6 @@
 import org.apache.derby.iapi.sql.depend.Dependency;
 import org.apache.derby.iapi.sql.depend.Dependent;
 
-import org.apache.derby.iapi.sql.dictionary.ColumnDescriptor;
 import org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor;
 import org.apache.derby.iapi.sql.dictionary.DataDescriptorGenerator;
 import org.apache.derby.iapi.sql.dictionary.DataDictionary;

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DropSchemaConstantAction.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DropSchemaConstantAction.java?rev=413129&r1=413128&r2=413129&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DropSchemaConstantAction.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DropSchemaConstantAction.java
Fri Jun  9 12:23:47 2006
@@ -22,7 +22,6 @@
 
 import org.apache.derby.iapi.services.sanity.SanityManager;
 import org.apache.derby.iapi.error.StandardException;
-import org.apache.derby.iapi.sql.dictionary.ColumnDescriptor;
 import org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor;
 import org.apache.derby.iapi.sql.dictionary.DataDescriptorGenerator;
 import org.apache.derby.iapi.sql.dictionary.DataDictionary;

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DropViewConstantAction.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DropViewConstantAction.java?rev=413129&r1=413128&r2=413129&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DropViewConstantAction.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DropViewConstantAction.java
Fri Jun  9 12:23:47 2006
@@ -25,7 +25,6 @@
 import org.apache.derby.iapi.error.StandardException;
 import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;
 
-import org.apache.derby.iapi.sql.dictionary.ColumnDescriptor;
 import org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor;
 import org.apache.derby.iapi.sql.dictionary.DataDescriptorGenerator;
 import org.apache.derby.iapi.sql.dictionary.DataDictionary;

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericResultSetFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericResultSetFactory.java?rev=413129&r1=413128&r2=413129&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericResultSetFactory.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericResultSetFactory.java
Fri Jun  9 12:23:47 2006
@@ -42,7 +42,6 @@
 
 import org.apache.derby.iapi.sql.dictionary.TableDescriptor;
 import org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor;
-import org.apache.derby.iapi.sql.dictionary.ColumnDescriptor;
 import org.apache.derby.iapi.sql.dictionary.SchemaDescriptor;
 
 import org.apache.derby.iapi.store.access.Qualifier;

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/IndexConstantAction.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/IndexConstantAction.java?rev=413129&r1=413128&r2=413129&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/IndexConstantAction.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/IndexConstantAction.java
Fri Jun  9 12:23:47 2006
@@ -24,7 +24,6 @@
 import org.apache.derby.iapi.error.StandardException;
 import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;
 
-import org.apache.derby.iapi.sql.dictionary.ColumnDescriptor;
 import org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor;
 import org.apache.derby.iapi.sql.dictionary.ConstraintDescriptor;
 import org.apache.derby.iapi.sql.dictionary.DataDescriptorGenerator;

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/InsertConstantAction.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/InsertConstantAction.java?rev=413129&r1=413128&r2=413129&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/InsertConstantAction.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/InsertConstantAction.java
Fri Jun  9 12:23:47 2006
@@ -32,7 +32,6 @@
 import org.apache.derby.iapi.sql.dictionary.IndexRowGenerator;
 import org.apache.derby.iapi.sql.dictionary.DataDictionary;
 import org.apache.derby.iapi.sql.dictionary.TableDescriptor;
-import org.apache.derby.iapi.sql.dictionary.ColumnDescriptor;
 import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;
 import org.apache.derby.iapi.sql.execute.ConstantAction;
 import org.apache.derby.iapi.sql.execute.ExecRow;

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/SetConstraintsConstantAction.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/SetConstraintsConstantAction.java?rev=413129&r1=413128&r2=413129&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/SetConstraintsConstantAction.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/SetConstraintsConstantAction.java
Fri Jun  9 12:23:47 2006
@@ -34,7 +34,6 @@
 import org.apache.derby.iapi.sql.StatementType;
 
 import org.apache.derby.iapi.sql.dictionary.CheckConstraintDescriptor;
-import org.apache.derby.iapi.sql.dictionary.ColumnDescriptor;
 import org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor;
 import org.apache.derby.iapi.sql.dictionary.ConstraintDescriptor;
 import org.apache.derby.iapi.sql.dictionary.ConstraintDescriptorList;

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/WriteCursorConstantAction.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/WriteCursorConstantAction.java?rev=413129&r1=413128&r2=413129&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/WriteCursorConstantAction.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/WriteCursorConstantAction.java
Fri Jun  9 12:23:47 2006
@@ -32,7 +32,6 @@
 import org.apache.derby.iapi.sql.dictionary.DataDictionary;
 import org.apache.derby.iapi.sql.dictionary.TableDescriptor;
 import org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor;
-import org.apache.derby.iapi.sql.dictionary.ColumnDescriptor;
 import org.apache.derby.iapi.sql.dictionary.IndexRowGenerator;
 import org.apache.derby.iapi.sql.dictionary.SchemaDescriptor;
 import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;

Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/JitTest.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/JitTest.out?rev=413129&view=auto
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/JitTest.out
(added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/JitTest.out
Fri Jun  9 12:23:47 2006
@@ -0,0 +1,7 @@
+10.2.0.3 alpha
+Apache Derby
+Apache Derby Embedded JDBC Driver
+Drop all tables in APP schema
+Create tables until we get a wrong Start with value
+PASS: All 200 tables created without problems
+Drop all tables in APP schema

Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/JitTest.out
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbylang.runall
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbylang.runall?rev=413129&r1=413128&r2=413129&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbylang.runall
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbylang.runall
Fri Jun  9 12:23:47 2006
@@ -77,6 +77,7 @@
 lang/insert.sql
 lang/intersect.sql
 lang/isolationLevels.sql
+lang/JitTest.java
 lang/joinDeadlock.sql
 lang/joins.sql
 lang/langUnitTests.sql

Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/JitTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/JitTest.java?rev=413129&view=auto
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/JitTest.java
(added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/JitTest.java
Fri Jun  9 12:23:47 2006
@@ -0,0 +1,191 @@
+/*
+
+   Derby - Class org.apache.derbyTesting.functionTests.tests.lang.JitTest
+
+   Copyright (c) 2001, 2006 The Apache Software Foundation or its licensors, where applicable.
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ */
+
+package org.apache.derbyTesting.functionTests.tests.lang;
+
+import java.sql.Connection;
+import java.sql.DatabaseMetaData;
+import java.sql.ResultSet;
+import java.sql.Statement;
+import java.sql.SQLException;
+
+import org.apache.derby.tools.ij;
+import org.apache.derby.tools.JDBCDisplayUtil;
+
+/**
+ * DERBY-1327
+ * Identity column can be created with wrong and very large start with 
+ * value with "J2RE 1.5.0 IBM Windows 32 build pwi32dev-20060412 (SR2)" 
+ * with JIT on
+ */
+public class JitTest {
+
+  public static void main (String args[]) 
+  { 
+    try {
+    	/* Load the JDBC Driver class */
+    	// use the ij utility to read the property file and
+    	// make the initial connection.
+    	ij.getPropertyArg(args);
+    	Connection conn = ij.startJBMS();
+
+    	//add tests specific to a jit issue
+    	testDerby1327BadStartWithForAutoIncColumn(conn);
+    	conn.close();
+    } catch (Exception e) {
+    	System.out.println("FAIL -- unexpected exception "+e);
+    	JDBCDisplayUtil.ShowException(System.out, e);
+      	e.printStackTrace();
+    }
+  }
+  
+  /**
+   * After some number of table creations with JIT turned on, the START WITH  
+   * value for the table being created and all the ones already created gets 
+   * mysteriously changed with pwi32dev-20060412 (SR2)
+   * 
+   * @throws Exception
+   */
+  public static void testDerby1327BadStartWithForAutoIncColumn(Connection conn) 
+  	throws Exception
+  {
+	conn.setAutoCommit(false);
+		Statement stmt = null;		
+
+		DatabaseMetaData md = conn.getMetaData() ;
+		System.out.println(md.getDatabaseProductVersion());
+		System.out.println(md.getDatabaseProductName());
+		System.out.println(md.getDriverName());
+		dropAllAppTables(conn);
+		System.out.println("Create tables until we get a wrong Start with value");
+		stmt = conn.createStatement();
+
+		// numBadStartWith will be changed if any columns get a bad start with value.
+		int numBadStartWith = 0; 
+		String createTableSQL = null;
+		try {
+			// create 200 tables.  Break out if we get a table that has a bad
+			// start with value.
+			for (int i = 0; (i < 200) && (numBadStartWith == 0); i++)
+			{
+				String tableName = "APP.MYTABLE" + i;
+			    createTableSQL = "CREATE TABLE " + tableName + 
+				"  (ROLEID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY ("+
+				"START WITH 2, INCREMENT BY 1), INSTANCEID INTEGER, STATUS"+
+				" INTEGER, LOGICAL_STATE INTEGER, LSTATE_TSTAMP  TIMESTAMP,"+
+				" UPDT_TSTAMP TIMESTAMP, TSTAMP TIMESTAMP,"+
+				" CLALEVEL1_CLALEVEL2_CLALEVEL2ID VARCHAR(255),  "+
+				"CLALEVEL1_CLALEVEL2_CLALEVEL3_CLALEVEL3ID VARCHAR(255))";
+				
+				stmt.executeUpdate(createTableSQL);
+				conn.commit();
+                numBadStartWith = checkBadStartWithCols(conn,2);
+				if (numBadStartWith > 0)
+					break;
+			}
+		} catch (SQLException se)
+		{
+			System.out.println("Failed on " + createTableSQL);
+			JDBCDisplayUtil.ShowSQLException(System.out,se);
+
+		}
+		
+		if (numBadStartWith == 0)
+		{
+			System.out.println("PASS: All 200 tables created without problems");
+			dropAllAppTables(conn);
+		}
+		stmt.close();
+		conn.rollback();
+  } 
+
+
+  /**
+   * Check that all tables in App do not have a an autoincrementstart value
+   * greater tan maxautoincrementstart
+   * @param conn
+   * @param maxautoincrementstart  Maximum expected autoincrementstart value
+   * @return number of columns with bad autoincrementstart value
+   */
+  	private static int checkBadStartWithCols(Connection conn, int
+  	  		maxautoincrementstart) throws Exception
+  	{
+  		Statement stmt = conn.createStatement();
+  		ResultSet rs =stmt.executeQuery("select count(autoincrementstart) from"+
+  				" sys.syscolumns c, sys.systables t, sys.sysschemas s WHERE"+
+				" t.schemaid =  s.schemaid and s.schemaname = 'APP' and"+
+				" autoincrementstart > " +  maxautoincrementstart);
+
+  		rs.next();
+  		int numBadStartWith = rs.getInt(1);
+  		if (numBadStartWith > 0)
+  			System.out.println(numBadStartWith + " columns have bad START WITH VALUE");
+  		rs.close();
+  		
+  		if (numBadStartWith > 0)
+  		{
+  			rs =stmt.executeQuery("select tablename, columnname,"+
+  					" autoincrementstart from sys.syscolumns c, sys.systables t,"+
+					" sys.sysschemas s WHERE t.schemaid = s.schemaid and"+
+					" s.schemaname = 'APP' and autoincrementstart > 2 ORDER"+
+					" BY tablename");
+  			while (rs.next())
+  			{
+  				System.out.println("Unexpected start value: " +
+  								   rs.getLong(3) + 
+  								   " on column " + rs.getString(1) +
+  								   "(" + rs.getString(2) + ")");
+  				
+  				
+  			}
+  		}
+         return numBadStartWith;
+  	}
+
+  	/**
+       * Drop all tables in schema APP
+  	 * @param conn
+  	 * @throws SQLException
+  	 */
+  	private  static void dropAllAppTables(Connection conn) throws SQLException
+  	{
+  		Statement stmt1 = conn.createStatement();
+  		Statement stmt2 = conn.createStatement();
+  		System.out.println("Drop all tables in APP schema");
+  		ResultSet rs = stmt1.executeQuery("SELECT tablename from sys.systables"+
+  				" t, sys.sysschemas s where t.schemaid = s.schemaid and"+
+				" s.schemaname = 'APP'");
+
+  		while (rs.next())
+  		{
+  			String tableName = rs.getString(1);
+  			
+  			try {
+  				stmt2.executeUpdate("DROP TABLE " + tableName);
+  			}
+  			catch (SQLException se)
+  			{
+  				System.out.println("Error dropping table:" + tableName);
+  				se.printStackTrace();
+  				continue;
+  			}
+  		}
+  	}
+}

Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/JitTest.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message