You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by ba...@apache.org on 2005/09/02 23:57:32 UTC

svn commit: r267331 - in /db/derby/code/trunk/java: engine/org/apache/derby/impl/sql/execute/ testing/org/apache/derbyTesting/functionTests/master/ testing/org/apache/derbyTesting/functionTests/master/DerbyNet/ testing/org/apache/derbyTesting/functionT...

Author: bandaram
Date: Fri Sep  2 14:57:25 2005
New Revision: 267331

URL: http://svn.apache.org/viewcvs?rev=267331&view=rev
Log:
DERBY-353: Return last user specified value for IDENTITY BY DEFAULT columns. The fix changed:

a) Inside the InsertResultSet class getSetAutoincrementValue function the Data Dictionary is accessed to get the current identity value. Which is then updated in the identityVal variable which is then used by the identity_val_local() function to display to the user. 

b) The above process did not happen when there was a user supplied value. The system table was not accessed and the setIdentity() function in the GenericLanguageContext class was not called. 

c) My fix attacked the case when the user supplies a value for the identity column which can be done in the case of Generated by default and calls the setIdentity function to store the value in this case also. 

Thanks to Rick for doing code reviews.

Submitted by V Narayanan (V.Narayanan@Sun.COM)

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/InsertResultSet.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/autoGeneratedJdbc30.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/autoGeneratedJdbc30.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/autoGeneratedJdbc30.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/autoincrement.out

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/InsertResultSet.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/InsertResultSet.java?rev=267331&r1=267330&r2=267331&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/InsertResultSet.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/InsertResultSet.java Fri Sep  2 14:57:25 2005
@@ -178,7 +178,6 @@
 	private	TriggerInfo				triggerInfo;
 	private RISetChecker 			fkChecker;
 	private TriggerEventActivator	triggerActivator;
-
 	/**
 	 * keeps track of autoincrement values that are generated by 
 	 * getSetAutoincrementValues.
@@ -371,8 +370,9 @@
 
 		// Is this a bulkInsert or regular insert?
 		String insertMode = constants.getProperty("insertMode");
-		
-		RowLocation[] rla;
+
+                RowLocation[] rla;
+
 		if ((rla = constants.getAutoincRowLocation()) != null)
 		{
 			aiCache = 
@@ -719,7 +719,7 @@
 		throws StandardException
 	{
 		long startValue = 0;
-		NumberDataValue dvd;
+                NumberDataValue dvd;
 		int index = columnPosition - 1;	// all our indices are 0 based.
 
 		/* As in DB2, only for single row insert: insert into t1(c1) values (..) do
@@ -861,6 +861,7 @@
 	{
 		boolean	firstDeferredRow = true;
 		ExecRow	deferredRowBuffer = null;
+                long user_autoinc=0;
 
 		/* Get or re-use the row changer.
 		 * NOTE: We need to set ourself as the top result set
@@ -999,16 +1000,40 @@
 			}
 
             rowCount++;
+            
+            if(constants.hasAutoincrement())
+            {
+                        dd = lcc.getDataDictionary();
+                        td = dd.getTableDescriptor(constants.targetUUID);
+                       
+                        int maxColumns = td.getMaxColumnID();
+                        int col;
+                        
+                        for(col=1;col<=maxColumns;col++)
+                        {
+                            ColumnDescriptor cd = td.getColumnDescriptor(col);
+                            if(cd.isAutoincrement())
+                            {
+                                break;
+                            }
+                        }
+                        
+                        if(col <= maxColumns)
+                        {
+                            DataValueDescriptor dvd = row.cloneColumn(col);
+                            user_autoinc = dvd.getLong();
+                        }
+             } 
 
 			// No need to do a next on a single row source
-			if (constants.singleRowSource)
-			{
-				row = null;
-			}
-			else
-			{
-				row = getNextRowCore(sourceResultSet);
-			}
+             if (constants.singleRowSource)
+	     {
+			row = null;
+	     }
+	     else
+	     {
+		row = getNextRowCore(sourceResultSet);
+	     }
         }
 
 		/*
@@ -1128,7 +1153,15 @@
 		}
 		if (setIdentity)
 			lcc.setIdentityValue(identityVal);
-    }
+                /*
+                 * find the value of the identity column from the user inserted value
+                 * and do a lcc.setIdentityValue(<user_value>);
+                 */
+                else if(constants.hasAutoincrement())
+                {
+                        lcc.setIdentityValue(user_autoinc);
+                } 
+ }
 
 	/*
 	 * Take the input row and return a new compact ExecRow

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/autoGeneratedJdbc30.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/autoGeneratedJdbc30.out?rev=267331&r1=267330&r2=267331&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/autoGeneratedJdbc30.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/autoGeneratedJdbc30.out Fri Sep  2 14:57:25 2005
@@ -12,88 +12,88 @@
  there was no prior one-row insert into a table with autogenerated key
 	 1
 	 -
-	{null}
+	{3}
 Now try the same test again but this time with Statement.executeUpdate. It should behave the same
 	 1
 	 -
-	{null}
+	{6}
 Now try the same test again but this time with PreparedStatement.execute. It should behave the same
 	 1
 	 -
-	{null}
+	{9}
 Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same
 	 1
 	 -
-	{null}
+	{12}
 Test 4 - request for generated keys after doing an insert into a table with no auto generated keys
  And there has been no one-row insert into a table with auto-generated keys yet.
 We should get a resultset with one row of NULL value from getGeneratedKeys
 	 1
 	 -
-	{null}
+	{12}
 Now try the same test again but this time with Statement.executeUpdate. It should behave the same
 	 1
 	 -
-	{null}
+	{12}
 Now try the same test again but this time with PreparedStatement.execute. It should behave the same
 	 1
 	 -
-	{null}
+	{12}
 Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same
 	 1
 	 -
-	{null}
+	{12}
 Test 5a - request for generated keys after doing a one-row insert(using a subquery) into a table with autogenerated key using a subquery with auto generated keys
 Even though this is a one-row insert but since insert has a sub-select, get generated keys will return one row of NULL value
 	 1
 	 -
-	{null}
+	{6}
 Now try the same test again but this time with Statement.executeUpdate. It should behave the same
 	 1
 	 -
-	{null}
+	{12}
 Now try the same test again but this time with PreparedStatement.execute. It should behave the same
 	 1
 	 -
-	{null}
+	{18}
 Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same
 	 1
 	 -
-	{null}
+	{24}
 Test 5b - request for generated keys after doing a one-row insert(using a subquery) into a table with autogenerated key using a subquery with auto generated keys
 Even though this is a one-row insert but since insert has a sub-select, get generated keys will return one row of NULL value
 	 1
 	 -
-	{null}
+	{0}
 Now try the same test again but this time with Statement.executeUpdate. It should behave the same
 	 1
 	 -
-	{null}
+	{0}
 Now try the same test again but this time with PreparedStatement.execute. It should behave the same
 	 1
 	 -
-	{null}
+	{0}
 Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same
 	 1
 	 -
-	{null}
+	{0}
 Test 5c - request for generated keys after doing a one-row insert(using a subquery) into a table with autogenerated key using a subquery with auto generated keys
 Even though this is a one-row insert but since insert has a sub-select, get generated keys will return one row of NULL value
 	 1
 	 -
-	{null}
+	{25}
 Now try the same test again but this time with Statement.executeUpdate. It should behave the same
 	 1
 	 -
-	{null}
+	{26}
 Now try the same test again but this time with PreparedStatement.execute. It should behave the same
 	 1
 	 -
-	{null}
+	{27}
 Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same
 	 1
 	 -
-	{null}
+	{28}
 Test 6 - request for generated keys after doing a one-row insert into a table with auto generated keys
 We should get a resultset with one row of non-NULL value
 	 1
@@ -115,37 +115,37 @@
  This time we will get a row of non-NULL value because there has been a prior one-row insert into table with auto-generated key 
 	 1
 	 -
-	{32}
+	{15}
 Now try the same test again but this time with Statement.executeUpdate. It should behave the same
 	 1
 	 -
-	{32}
+	{18}
 Now try the same test again but this time with PreparedStatement.execute. It should behave the same
 	 1
 	 -
-	{32}
+	{21}
 Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same
 	 1
 	 -
-	{32}
+	{24}
 Test 8 - create a new statement and request for generated keys on it after doing an insert into 
  a table with no auto generated keys
 We should get a resultset with one row of non-NULL value
 	 1
 	 -
-	{32}
+	{24}
 Now try the same test again but this time with Statement.executeUpdate. It should behave the same
 	 1
 	 -
-	{32}
+	{24}
 Now try the same test again but this time with PreparedStatement.execute. It should behave the same
 	 1
 	 -
-	{32}
+	{24}
 Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same
 	 1
 	 -
-	{32}
+	{24}
 Test 9 - request for generated keys on a statement which does a update 
 We should get a resultset with no rows from getGeneratedKeys because we executed a non-insert sql
 <NULL>
@@ -169,37 +169,37 @@
 expected to see resultset with one row of NULL value but instead get one row of non-NULL value from getGeneratedKeys
 	 1
 	 -
-	{32}
+	{24}
 Now try the same test again but this time with Statement.executeUpdate. It should behave the same
 	 1
 	 -
-	{32}
+	{24}
 Now try the same test again but this time with PreparedStatement.execute. It should behave the same
 	 1
 	 -
-	{32}
+	{24}
 Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same
 	 1
 	 -
-	{32}
+	{24}
 Test 12 - do a rollback and request for generated keys on a statement which does insert into a table with 
  no auto generated keys (previous transaction had a one-row insert on a table with auto-generated keys)
 had expected to see resultset with one row of NULL value but instead get one row of non-NULL value from getGeneratedKeys
 	 1
 	 -
-	{32}
+	{24}
 Now try the same test again but this time with Statement.executeUpdate. It should behave the same
 	 1
 	 -
-	{32}
+	{24}
 Now try the same test again but this time with PreparedStatement.execute. It should behave the same
 	 1
 	 -
-	{32}
+	{24}
 Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same
 	 1
 	 -
-	{32}
+	{24}
 Test 13 - try savepoint rollback and see what happens to auto generated keys resultset
 Inside the savepoint unit, issue a one-row insert into a table with auto generated keys
 We should get a resultset with one row of non-NULL value

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/autoGeneratedJdbc30.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/autoGeneratedJdbc30.out?rev=267331&r1=267330&r2=267331&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/autoGeneratedJdbc30.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/autoGeneratedJdbc30.out Fri Sep  2 14:57:25 2005
@@ -12,88 +12,88 @@
  there was no prior one-row insert into a table with autogenerated key
 	 1
 	 -
-	{null}
+	{3}
 Now try the same test again but this time with Statement.executeUpdate. It should behave the same
 	 1
 	 -
-	{null}
+	{6}
 Now try the same test again but this time with PreparedStatement.execute. It should behave the same
 	 1
 	 -
-	{null}
+	{9}
 Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same
 	 1
 	 -
-	{null}
+	{12}
 Test 4 - request for generated keys after doing an insert into a table with no auto generated keys
  And there has been no one-row insert into a table with auto-generated keys yet.
 We should get a resultset with one row of NULL value from getGeneratedKeys
 	 1
 	 -
-	{null}
+	{12}
 Now try the same test again but this time with Statement.executeUpdate. It should behave the same
 	 1
 	 -
-	{null}
+	{12}
 Now try the same test again but this time with PreparedStatement.execute. It should behave the same
 	 1
 	 -
-	{null}
+	{12}
 Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same
 	 1
 	 -
-	{null}
+	{12}
 Test 5a - request for generated keys after doing a one-row insert(using a subquery) into a table with autogenerated key using a subquery with auto generated keys
 Even though this is a one-row insert but since insert has a sub-select, get generated keys will return one row of NULL value
 	 1
 	 -
-	{null}
+	{6}
 Now try the same test again but this time with Statement.executeUpdate. It should behave the same
 	 1
 	 -
-	{null}
+	{12}
 Now try the same test again but this time with PreparedStatement.execute. It should behave the same
 	 1
 	 -
-	{null}
+	{18}
 Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same
 	 1
 	 -
-	{null}
+	{24}
 Test 5b - request for generated keys after doing a one-row insert(using a subquery) into a table with autogenerated key using a subquery with auto generated keys
 Even though this is a one-row insert but since insert has a sub-select, get generated keys will return one row of NULL value
 	 1
 	 -
-	{null}
+	{0}
 Now try the same test again but this time with Statement.executeUpdate. It should behave the same
 	 1
 	 -
-	{null}
+	{0}
 Now try the same test again but this time with PreparedStatement.execute. It should behave the same
 	 1
 	 -
-	{null}
+	{0}
 Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same
 	 1
 	 -
-	{null}
+	{0}
 Test 5c - request for generated keys after doing a one-row insert(using a subquery) into a table with autogenerated key using a subquery with auto generated keys
 Even though this is a one-row insert but since insert has a sub-select, get generated keys will return one row of NULL value
 	 1
 	 -
-	{null}
+	{25}
 Now try the same test again but this time with Statement.executeUpdate. It should behave the same
 	 1
 	 -
-	{null}
+	{26}
 Now try the same test again but this time with PreparedStatement.execute. It should behave the same
 	 1
 	 -
-	{null}
+	{27}
 Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same
 	 1
 	 -
-	{null}
+	{28}
 Test 6 - request for generated keys after doing a one-row insert into a table with auto generated keys
 We should get a resultset with one row of non-NULL value
 	 1
@@ -115,37 +115,37 @@
  This time we will get a row of non-NULL value because there has been a prior one-row insert into table with auto-generated key 
 	 1
 	 -
-	{32}
+	{15}
 Now try the same test again but this time with Statement.executeUpdate. It should behave the same
 	 1
 	 -
-	{32}
+	{18}
 Now try the same test again but this time with PreparedStatement.execute. It should behave the same
 	 1
 	 -
-	{32}
+	{21}
 Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same
 	 1
 	 -
-	{32}
+	{24}
 Test 8 - create a new statement and request for generated keys on it after doing an insert into 
  a table with no auto generated keys
 We should get a resultset with one row of non-NULL value
 	 1
 	 -
-	{32}
+	{24}
 Now try the same test again but this time with Statement.executeUpdate. It should behave the same
 	 1
 	 -
-	{32}
+	{24}
 Now try the same test again but this time with PreparedStatement.execute. It should behave the same
 	 1
 	 -
-	{32}
+	{24}
 Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same
 	 1
 	 -
-	{32}
+	{24}
 Test 9 - request for generated keys on a statement which does a update 
 We should get a resultset with no rows from getGeneratedKeys because we executed a non-insert sql
 <NULL>
@@ -169,37 +169,37 @@
 expected to see resultset with one row of NULL value but instead get one row of non-NULL value from getGeneratedKeys
 	 1
 	 -
-	{32}
+	{24}
 Now try the same test again but this time with Statement.executeUpdate. It should behave the same
 	 1
 	 -
-	{32}
+	{24}
 Now try the same test again but this time with PreparedStatement.execute. It should behave the same
 	 1
 	 -
-	{32}
+	{24}
 Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same
 	 1
 	 -
-	{32}
+	{24}
 Test 12 - do a rollback and request for generated keys on a statement which does insert into a table with 
  no auto generated keys (previous transaction had a one-row insert on a table with auto-generated keys)
 had expected to see resultset with one row of NULL value but instead get one row of non-NULL value from getGeneratedKeys
 	 1
 	 -
-	{32}
+	{24}
 Now try the same test again but this time with Statement.executeUpdate. It should behave the same
 	 1
 	 -
-	{32}
+	{24}
 Now try the same test again but this time with PreparedStatement.execute. It should behave the same
 	 1
 	 -
-	{32}
+	{24}
 Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same
 	 1
 	 -
-	{32}
+	{24}
 Test 13 - try savepoint rollback and see what happens to auto generated keys resultset
 Inside the savepoint unit, issue a one-row insert into a table with auto generated keys
 We should get a resultset with one row of non-NULL value

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/autoGeneratedJdbc30.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/autoGeneratedJdbc30.out?rev=267331&r1=267330&r2=267331&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/autoGeneratedJdbc30.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/autoGeneratedJdbc30.out Fri Sep  2 14:57:25 2005
@@ -12,88 +12,88 @@
  there was no prior one-row insert into a table with autogenerated key
 	 1
 	 -
-	{null}
+	{3}
 Now try the same test again but this time with Statement.executeUpdate. It should behave the same
 	 1
 	 -
-	{null}
+	{6}
 Now try the same test again but this time with PreparedStatement.execute. It should behave the same
 	 1
 	 -
-	{null}
+	{9}
 Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same
 	 1
 	 -
-	{null}
+	{12}
 Test 4 - request for generated keys after doing an insert into a table with no auto generated keys
  And there has been no one-row insert into a table with auto-generated keys yet.
 We should get a resultset with one row of NULL value from getGeneratedKeys
 	 1
 	 -
-	{null}
+	{12}
 Now try the same test again but this time with Statement.executeUpdate. It should behave the same
 	 1
 	 -
-	{null}
+	{12}
 Now try the same test again but this time with PreparedStatement.execute. It should behave the same
 	 1
 	 -
-	{null}
+	{12}
 Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same
 	 1
 	 -
-	{null}
+	{12}
 Test 5a - request for generated keys after doing a one-row insert(using a subquery) into a table with autogenerated key using a subquery with auto generated keys
 Even though this is a one-row insert but since insert has a sub-select, get generated keys will return one row of NULL value
 	 1
 	 -
-	{null}
+	{6}
 Now try the same test again but this time with Statement.executeUpdate. It should behave the same
 	 1
 	 -
-	{null}
+	{12}
 Now try the same test again but this time with PreparedStatement.execute. It should behave the same
 	 1
 	 -
-	{null}
+	{18}
 Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same
 	 1
 	 -
-	{null}
+	{24}
 Test 5b - request for generated keys after doing a one-row insert(using a subquery) into a table with autogenerated key using a subquery with auto generated keys
 Even though this is a one-row insert but since insert has a sub-select, get generated keys will return one row of NULL value
 	 1
 	 -
-	{null}
+	{0}
 Now try the same test again but this time with Statement.executeUpdate. It should behave the same
 	 1
 	 -
-	{null}
+	{0}
 Now try the same test again but this time with PreparedStatement.execute. It should behave the same
 	 1
 	 -
-	{null}
+	{0}
 Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same
 	 1
 	 -
-	{null}
+	{0}
 Test 5c - request for generated keys after doing a one-row insert(using a subquery) into a table with autogenerated key using a subquery with auto generated keys
 Even though this is a one-row insert but since insert has a sub-select, get generated keys will return one row of NULL value
 	 1
 	 -
-	{null}
+	{25}
 Now try the same test again but this time with Statement.executeUpdate. It should behave the same
 	 1
 	 -
-	{null}
+	{26}
 Now try the same test again but this time with PreparedStatement.execute. It should behave the same
 	 1
 	 -
-	{null}
+	{27}
 Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same
 	 1
 	 -
-	{null}
+	{28}
 Test 6 - request for generated keys after doing a one-row insert into a table with auto generated keys
 We should get a resultset with one row of non-NULL value
 	 1
@@ -115,37 +115,37 @@
  This time we will get a row of non-NULL value because there has been a prior one-row insert into table with auto-generated key 
 	 1
 	 -
-	{32}
+	{15}
 Now try the same test again but this time with Statement.executeUpdate. It should behave the same
 	 1
 	 -
-	{32}
+	{18}
 Now try the same test again but this time with PreparedStatement.execute. It should behave the same
 	 1
 	 -
-	{32}
+	{21}
 Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same
 	 1
 	 -
-	{32}
+	{24}
 Test 8 - create a new statement and request for generated keys on it after doing an insert into 
  a table with no auto generated keys
 We should get a resultset with one row of non-NULL value
 	 1
 	 -
-	{32}
+	{24}
 Now try the same test again but this time with Statement.executeUpdate. It should behave the same
 	 1
 	 -
-	{32}
+	{24}
 Now try the same test again but this time with PreparedStatement.execute. It should behave the same
 	 1
 	 -
-	{32}
+	{24}
 Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same
 	 1
 	 -
-	{32}
+	{24}
 Test 9 - request for generated keys on a statement which does a update 
 We should get a resultset with no rows from getGeneratedKeys because we executed a non-insert sql
 <NULL>
@@ -169,37 +169,37 @@
 expected to see resultset with one row of NULL value but instead get one row of non-NULL value from getGeneratedKeys
 	 1
 	 -
-	{32}
+	{24}
 Now try the same test again but this time with Statement.executeUpdate. It should behave the same
 	 1
 	 -
-	{32}
+	{24}
 Now try the same test again but this time with PreparedStatement.execute. It should behave the same
 	 1
 	 -
-	{32}
+	{24}
 Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same
 	 1
 	 -
-	{32}
+	{24}
 Test 12 - do a rollback and request for generated keys on a statement which does insert into a table with 
  no auto generated keys (previous transaction had a one-row insert on a table with auto-generated keys)
 had expected to see resultset with one row of NULL value but instead get one row of non-NULL value from getGeneratedKeys
 	 1
 	 -
-	{32}
+	{24}
 Now try the same test again but this time with Statement.executeUpdate. It should behave the same
 	 1
 	 -
-	{32}
+	{24}
 Now try the same test again but this time with PreparedStatement.execute. It should behave the same
 	 1
 	 -
-	{32}
+	{24}
 Now try the same test again but this time with PreparedStatement.executeUpdate. It should behave the same
 	 1
 	 -
-	{32}
+	{24}
 Test 13 - try savepoint rollback and see what happens to auto generated keys resultset
 Inside the savepoint unit, issue a one-row insert into a table with auto generated keys
 We should get a resultset with one row of non-NULL value

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/autoincrement.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/autoincrement.out?rev=267331&r1=267330&r2=267331&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/autoincrement.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/autoincrement.out Fri Sep  2 14:57:25 2005
@@ -286,17 +286,17 @@
 values IDENTITY_VAL_LOCAL();
 1                              
 -------------------------------
-0                              
+20                             
 ij> insert into ai_test (y) select y+10 from ai_test;
 10 rows inserted/updated/deleted
 ij> values IDENTITY_VAL_LOCAL();
 1                              
 -------------------------------
-0                              
+40                             
 ij> values IDENTITY_VAL_LOCAL();
 1                              
 -------------------------------
-0                              
+40                             
 ij> -- try some more connection info tests
 create table ai_single1 (c char(100), a_odd int generated always as identity (start with 1, increment by 2));
 0 rows inserted/updated/deleted
@@ -588,7 +588,7 @@
 ij> values IDENTITY_VAL_LOCAL();
 1                              
 -------------------------------
-0                              
+4                              
 ij> -- test some more generated column specs
 create table trigtest (s1 smallint generated always as identity, lvl int);
 0 rows inserted/updated/deleted
@@ -1169,7 +1169,7 @@
 values IDENTITY_VAL_LOCAL();
 1                              
 -------------------------------
-2                              
+4                              
 ij> select * from t1;
 C1         |C2         
 -----------------------
@@ -1183,7 +1183,7 @@
 values IDENTITY_VAL_LOCAL();
 1                              
 -------------------------------
-2                              
+8                              
 ij> select * from t1;
 C1         |C2         
 -----------------------
@@ -1200,13 +1200,13 @@
 ij> values IDENTITY_VAL_LOCAL();
 1                              
 -------------------------------
-2                              
+8                              
 ij> insert into t1(c2) select c1 from t1;
 0 rows inserted/updated/deleted
 ij> values IDENTITY_VAL_LOCAL();
 1                              
 -------------------------------
-2                              
+0                              
 ij> -- end of practice, back to start...
 insert into t1(c2) values (8);
 1 row inserted/updated/deleted