db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmars...@apache.org
Subject svn commit: r413354 - in /db/derby/code/branches/10.1/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/...
Date Sat, 10 Jun 2006 19:10:36 GMT
Author: kmarsden
Date: Sat Jun 10 12:10:35 2006
New Revision: 413354

URL: http://svn.apache.org/viewvc?rev=413354&view=rev
Log:
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

Contributed by Mamta Satoor

Attaching the patch for 10.1 codeline after doing a merge from main and hand fixing some of
the conflicts. (The derbyall test suite ran fine with jdk13)
svn merge -r 413128:413129 https://svn.apache.org/repos/asf/db/derby/code/trunk/

One thing to note though is that in 10.1 codeline, the number of parameters to ColumnDescriptor
constructors are 10 and not >10. So, from the bug diagnosis as mentioned in this JIRA entry,
the bug should not have manifested in 10.1 codeline (the main codeline does have ColumnDscriptor
constructor with >10 parameters).


Kathey verified that the issue reproduced without the patch and did not reprodcue after the
patch BUT this issue should be left unresolved until we get clarification on the conditions
where the JIT bug is triggered and know that this is a reliable workaround for the problem.


Kathey also manually merged the test which did not seem to merge properly with the patch.


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

Modified: db/derby/code/branches/10.1/java/engine/org/apache/derby/iapi/sql/conn/LanguageConnectionContext.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/engine/org/apache/derby/iapi/sql/conn/LanguageConnectionContext.java?rev=413354&r1=413353&r2=413354&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/engine/org/apache/derby/iapi/sql/conn/LanguageConnectionContext.java
(original)
+++ db/derby/code/branches/10.1/java/engine/org/apache/derby/iapi/sql/conn/LanguageConnectionContext.java
Sat Jun 10 12:10:35 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/branches/10.1/java/engine/org/apache/derby/iapi/sql/dictionary/ColumnDescriptor.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/engine/org/apache/derby/iapi/sql/dictionary/ColumnDescriptor.java?rev=413354&r1=413353&r2=413354&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/engine/org/apache/derby/iapi/sql/dictionary/ColumnDescriptor.java
(original)
+++ db/derby/code/branches/10.1/java/engine/org/apache/derby/iapi/sql/dictionary/ColumnDescriptor.java
Sat Jun 10 12:10:35 2006
@@ -84,14 +84,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;
@@ -105,7 +104,7 @@
 			this.uuid = table.getUUID();
 		}
 
-		assertAutoinc(autoinc,
+		assertAutoinc(autoincInc != 0,
 			      autoincInc,
 			      columnDefaultInfo);
 
@@ -132,14 +131,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;
@@ -150,7 +148,7 @@
 		this.uuid = uuid;
 		this.defaultUUID = defaultUUID;
 
-		assertAutoinc(autoinc,
+		assertAutoinc(autoincInc!=0,
 			      autoincInc,
 			      columnDefaultInfo);
 		

Modified: db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java?rev=413354&r1=413353&r2=413354&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
(original)
+++ db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
Sat Jun 10 12:10:35 2006
@@ -2938,7 +2938,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
@@ -3126,7 +3126,7 @@
 										  (DefaultInfo) null,
 										  uuid,
 										  (UUID) null,
-										  0, 0, false);
+										  0, 0);
 										
 				updateColumnDescriptor(cd,
 									   cd.getReferencingUUID(), 
@@ -6865,7 +6865,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/branches/10.1/java/engine/org/apache/derby/impl/sql/catalog/SYSCOLUMNSRowFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/catalog/SYSCOLUMNSRowFactory.java?rev=413354&r1=413353&r2=413354&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/catalog/SYSCOLUMNSRowFactory.java
(original)
+++ db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/catalog/SYSCOLUMNSRowFactory.java
Sat Jun 10 12:10:35 2006
@@ -487,11 +487,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();
 
@@ -500,8 +495,7 @@
 
 		colDesc = new ColumnDescriptor(columnName, columnNumber,
 							dataTypeServices, defaultValue, defaultInfo, uuid, 
-							defaultUUID, autoincStart, autoincInc, 
-							autoincColumn);
+							defaultUUID, autoincStart, autoincInc);
 		return colDesc;
 	}
 

Modified: db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/catalog/SYSFILESRowFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/catalog/SYSFILESRowFactory.java?rev=413354&r1=413353&r2=413354&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/catalog/SYSFILESRowFactory.java
(original)
+++ db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/catalog/SYSFILESRowFactory.java
Sat Jun 10 12:10:35 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/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/CallStatementNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/CallStatementNode.java?rev=413354&r1=413353&r2=413354&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/CallStatementNode.java
(original)
+++ db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/CallStatementNode.java
Sat Jun 10 12:10:35 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/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/FromList.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/FromList.java?rev=413354&r1=413353&r2=413354&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/FromList.java
(original)
+++ db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/FromList.java
Sat Jun 10 12:10:35 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/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/FromSubquery.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/FromSubquery.java?rev=413354&r1=413353&r2=413354&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/FromSubquery.java
(original)
+++ db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/FromSubquery.java
Sat Jun 10 12:10:35 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/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/InsertNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/InsertNode.java?rev=413354&r1=413353&r2=413354&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/InsertNode.java
(original)
+++ db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/InsertNode.java
Sat Jun 10 12:10:35 2006
@@ -39,7 +39,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/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/ResultColumnList.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/ResultColumnList.java?rev=413354&r1=413353&r2=413354&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/ResultColumnList.java
(original)
+++ db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/ResultColumnList.java
Sat Jun 10 12:10:35 2006
@@ -723,7 +723,7 @@
 											null,
 											(TableDescriptor) null,
 											null,
-											0, 0, false);
+											0, 0);
 			rc.setColumnDescriptor(null, cd);
 			rc.setVirtualColumnId(index + 1);
 		}

Modified: db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/SubqueryList.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/SubqueryList.java?rev=413354&r1=413353&r2=413354&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/SubqueryList.java
(original)
+++ db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/SubqueryList.java
Sat Jun 10 12:10:35 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/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/UpdateNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/UpdateNode.java?rev=413354&r1=413353&r2=413354&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/UpdateNode.java
(original)
+++ db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/UpdateNode.java
Sat Jun 10 12:10:35 2006
@@ -40,7 +40,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/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/AlterTableConstantAction.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/AlterTableConstantAction.java?rev=413354&r1=413353&r2=413354&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/AlterTableConstantAction.java
(original)
+++ db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/AlterTableConstantAction.java
Sat Jun 10 12:10:35 2006
@@ -624,8 +624,7 @@
 												   td,
 												   defaultUUID,
 												   columnInfo[ix].autoincStart,
-												   columnInfo[ix].autoincInc,
-												   columnInfo[ix].autoincInc != 0
+												   columnInfo[ix].autoincInc
 												   );
 
 		dd.addDescriptor(columnDescriptor, td,
@@ -927,8 +926,7 @@
 									td,
 									columnDescriptor.getDefaultUUID(),
 								    columnInfo[ix].autoincStart,
-								    columnInfo[ix].autoincInc,
-								    columnInfo[ix].autoincInc != 0
+								    columnInfo[ix].autoincInc
 									);
 		
 
@@ -970,8 +968,7 @@
 									td,
 									columnDescriptor.getDefaultUUID(),
 									columnDescriptor.getAutoincStart(),
-									columnDescriptor.getAutoincInc(),
-									columnDescriptor.getAutoincInc() != 0);
+									columnDescriptor.getAutoincInc());
 		
 
 
@@ -1038,8 +1035,7 @@
 												   td,
 												   defaultUUID,
 												   columnInfo[ix].autoincStart,
-												   columnInfo[ix].autoincInc,
-												   columnInfo[ix].autoincInc != 0
+												   columnInfo[ix].autoincInc
 												   );
 
 		// Update the ColumnDescriptor with new default info

Modified: db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/ConstraintConstantAction.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/ConstraintConstantAction.java?rev=413354&r1=413353&r2=413354&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/ConstraintConstantAction.java
(original)
+++ db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/ConstraintConstantAction.java
Sat Jun 10 12:10:35 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/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/CreateTableConstantAction.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/CreateTableConstantAction.java?rev=413354&r1=413353&r2=413354&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/CreateTableConstantAction.java
(original)
+++ db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/CreateTableConstantAction.java
Sat Jun 10 12:10:35 2006
@@ -265,10 +265,8 @@
 								   td,
 								   defaultUUID,
 								   columnInfo[ix].autoincStart,
-								   columnInfo[ix].autoincInc,
-								   columnInfo[ix].autoincInc != 0
+								   columnInfo[ix].autoincInc
 							   );
-
 			cdlArray[ix] = columnDescriptor;
 		}
 

Modified: db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/CreateViewConstantAction.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/CreateViewConstantAction.java?rev=413354&r1=413353&r2=413354&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/CreateViewConstantAction.java
(original)
+++ db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/CreateViewConstantAction.java
Sat Jun 10 12:10:35 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/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/DropConstraintConstantAction.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/DropConstraintConstantAction.java?rev=413354&r1=413353&r2=413354&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/DropConstraintConstantAction.java
(original)
+++ db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/DropConstraintConstantAction.java
Sat Jun 10 12:10:35 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/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/DropIndexConstantAction.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/DropIndexConstantAction.java?rev=413354&r1=413353&r2=413354&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/DropIndexConstantAction.java
(original)
+++ db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/DropIndexConstantAction.java
Sat Jun 10 12:10:35 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/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/DropSchemaConstantAction.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/DropSchemaConstantAction.java?rev=413354&r1=413353&r2=413354&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/DropSchemaConstantAction.java
(original)
+++ db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/DropSchemaConstantAction.java
Sat Jun 10 12:10:35 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/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/DropViewConstantAction.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/DropViewConstantAction.java?rev=413354&r1=413353&r2=413354&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/DropViewConstantAction.java
(original)
+++ db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/DropViewConstantAction.java
Sat Jun 10 12:10:35 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/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/GenericResultSetFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/GenericResultSetFactory.java?rev=413354&r1=413353&r2=413354&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/GenericResultSetFactory.java
(original)
+++ db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/GenericResultSetFactory.java
Sat Jun 10 12:10:35 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/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/IndexConstantAction.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/IndexConstantAction.java?rev=413354&r1=413353&r2=413354&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/IndexConstantAction.java
(original)
+++ db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/IndexConstantAction.java
Sat Jun 10 12:10:35 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/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/InsertConstantAction.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/InsertConstantAction.java?rev=413354&r1=413353&r2=413354&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/InsertConstantAction.java
(original)
+++ db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/InsertConstantAction.java
Sat Jun 10 12:10:35 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/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/SetConstraintsConstantAction.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/SetConstraintsConstantAction.java?rev=413354&r1=413353&r2=413354&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/SetConstraintsConstantAction.java
(original)
+++ db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/SetConstraintsConstantAction.java
Sat Jun 10 12:10:35 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/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/WriteCursorConstantAction.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/WriteCursorConstantAction.java?rev=413354&r1=413353&r2=413354&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/WriteCursorConstantAction.java
(original)
+++ db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/WriteCursorConstantAction.java
Sat Jun 10 12:10:35 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/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/JitTest.out
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/JitTest.out?rev=413354&view=auto
==============================================================================
--- db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/JitTest.out
(added)
+++ db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/JitTest.out
Sat Jun 10 12:10:35 2006
@@ -0,0 +1,7 @@
+10.1.2.5
+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/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/JitTest.out
------------------------------------------------------------------------------
    svn:eol-style = native

Added: db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/lang/JitTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/lang/JitTest.java?rev=413354&view=auto
==============================================================================
--- db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/lang/JitTest.java
(added)
+++ db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/lang/JitTest.java
Sat Jun 10 12:10:35 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/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/lang/JitTest.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message