db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmars...@apache.org
Subject svn commit: r109265 - in incubator/derby/code/trunk/java/testing: . org/apache/derbyTesting/functionTests/harness org/apache/derbyTesting/functionTests/master org/apache/derbyTesting/functionTests/master/DerbyNet org/apache/derbyTesting/functionTests/suites org/apache/derbyTesting/functionTests/tests/derbynet org/apache/derbyTesting/functionTests/tests/jdbcapi org/apache/derbyTesting/functionTests/tests/lang org/apache/derbyTesting/functionTests/tests/store org/apache/derbyTesting/functionTests/tests/storetests org/apache/derbyTesting/functionTests/tests/tools
Date Wed, 01 Dec 2004 00:24:00 GMT
Author: kmarsden
Date: Tue Nov 30 16:23:58 2004
New Revision: 109265

URL: http://svn.apache.org/viewcvs?view=rev&rev=109265
Log:
Adding store .sql tests & suite, xa suite; remove some cloudscape references.
contributed by myrna@golux.com

Added:
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/holdCursorExternalSortJDBC30.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/holdCursorJDBC30.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/Rllmodule1.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/Rllmodule2.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/Rllmodule3.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/Rllmodule4.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/RowLockBasic.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/RowLockIso.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/SpaceTable.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/TableLockBasic.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/TransactionTable.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/access.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/backupRestore.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/bug3498.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/cisco.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/connectDisconnect.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/dataSourcePermissions.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/heapscan.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/holdCursorExternalSortJDBC30.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/holdCursorJDBC30.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/lockTableVti.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/logDevice.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/longColumn.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/longRow.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/madhare.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/removeStubs.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/rlliso1multi.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/rlliso3multi.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/rollForwardRecovery.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/st_1.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/st_b5772.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/st_schema.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/testsqldecimal.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/xaAnotherTest.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/xaMorph.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/xaOffline1.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/xaSimpleNegative.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/xaSimplePositive.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/xaStateTran.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/xab2354.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/storeall.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/storemats.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/storemats.runall
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/storemore.runall
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/storetests.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/storetests.runall
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/xa.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/xa.runall
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/xaAnotherTest.sql
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/xaAnotherTest_app.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/xaAnotherTest_derby.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/xaAnotherTest_sed.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/xaMorph.sql
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/xaSimpleNegative.sql
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/xaSimpleNegative_derby.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/xaSimplePositive.sql
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/xaSimplePositive_app.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/xaSimplePositive_sed.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/xaStateTran.sql
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/LockTableQuery.subsql
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/Rllmodule1.sql
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/Rllmodule1_derby.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/Rllmodule2.sql
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/Rllmodule2_derby.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/Rllmodule3.sql
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/Rllmodule3_derby.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/Rllmodule4.sql
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/Rllmodule4_derby.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/RowLockBasic.sql
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/RowLockBasic_derby.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/RowLockIso.sql
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/RowLockIso_app.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/RowLockIso_derby.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/SpaceTable.sql
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/TableLockBasic.sql
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/TableLockBasic.subsql
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/TableLockBasic_derby.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/TransactionTable.sql
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/TransactionTable_app.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/TransactionTable_derby.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/access.sql
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/access_app.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/access_derby.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/backupRestore.sql
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/backupRestore_app.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/brtestjar.jar   (contents, props changed)
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/bug3498.sql
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/bug3498_app.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/build.xml
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/cisco.sql
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/cisco.subsql
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/cisco_app.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/cisco_default.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/cisco_derby.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/connectDisconnect.sql
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/connectDisconnect_app.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/connectDisconnect_derby.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/copyfiles.ant
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/createTestProcedures.subsql
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/default_app.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/default_derby.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/global_xactTable.view
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/heapscan.sql
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/heapscan_app.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/heapscan_derby.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/holdCursorExternalSortJDBC30.sql
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/holdCursorExternalSortJDBC30_app.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/holdCursorExternalSortJDBC30_derby.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/holdCursorJDBC30.sql
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/holdCursorJDBC30_app.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/lockTableVti.sql
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/logDevice.sql
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/logDevice_app.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/longColumn.sql
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/longColumn_derby.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/longRow.sql
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/madhare.sql
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/removeStubs.sql
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/rlliso1multi.sql
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/rlliso1multi.subsql
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/rlliso1multi_app.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/rlliso1multi_derby.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/rlliso2multi.sql
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/rlliso2multi_app.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/rlliso2multi_derby.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/rlliso3multi.sql
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/rlliso3multi_app.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/rlliso3multi_derby.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/rollForwardRecovery.sql
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/rollForwardRecovery_app.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/rollForwardRecovery_derby.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/testsqldecimal.sql
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/testsqldecimal_derby.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/xaOffline1.sql
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/xaOffline1_derby.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/xaOffline1_sed.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/xab2354.sql
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/xab2354_sed.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/storetests/
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/storetests/build.xml
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/storetests/copyfiles.ant
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/storetests/default_app.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/storetests/default_derby.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/storetests/st_1.sql
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/storetests/st_b5772.sql
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/storetests/st_schema.sql
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/storetests/st_schema_app.properties
Modified:
   incubator/derby/code/trunk/java/testing/build.xml
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/build.xml
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/NSinSameJVM.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/refActions1.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/testProperties.out
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbyall.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbylang.runall
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/NSinSameJVM.java
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/build.xml
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/dataSourcePermissions_net_app.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testProperties.java
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/derbynet/testij_app.properties
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/build.xml
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/copyfiles.ant
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/build.xml
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/refActions1.sql
   incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/tools/build.xml

Modified: incubator/derby/code/trunk/java/testing/build.xml
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/build.xml?view=diff&rev=109265&p1=incubator/derby/code/trunk/java/testing/build.xml&r1=109264&p2=incubator/derby/code/trunk/java/testing/build.xml&r2=109265
==============================================================================
--- incubator/derby/code/trunk/java/testing/build.xml	(original)
+++ incubator/derby/code/trunk/java/testing/build.xml	Tue Nov 30 16:23:58 2004
@@ -44,6 +44,7 @@
     <ant dir="${derby.testing.src.dir}/${derby.testing.functest.dir}/util"/> 
     <ant dir="${derby.testing.src.dir}/${derby.testing.functest.dir}/tests/jdbcapi"/> 
     <ant dir="${derby.testing.src.dir}/${derby.testing.functest.dir}/tests/lang"/> 
+    <ant dir="${derby.testing.src.dir}/${derby.testing.functest.dir}/tests/store"/> 
     <ant dir="${derby.testing.src.dir}/${derby.testing.functest.dir}/tests/tools"/> 
     <ant dir="${derby.testing.src.dir}/${derby.testing.functest.dir}/tests/derbynet"/> 
     <ant dir="${derby.testing.src.dir}/${derby.testing.functest.dir}/master"/> 

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/build.xml
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/build.xml?view=diff&rev=109265&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/build.xml&r1=109264&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/build.xml&r2=109265
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/build.xml	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/harness/build.xml	Tue Nov 30 16:23:58 2004
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 
 <!-- ==================================================================== -->
-<!--                       Cloudscape build file                          -->
+<!--                       Derby build file                          -->
 <!-- ==================================================================== -->
 
 <project default="FTharness" basedir="../../../../../../.." >

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/NSinSameJVM.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/NSinSameJVM.out?view=diff&rev=109265&p1=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/NSinSameJVM.out&r1=109264&p2=incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/NSinSameJVM.out&r2=109265
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/NSinSameJVM.out	(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/NSinSameJVM.out	Tue Nov 30 16:23:58 2004
@@ -1,4 +1,4 @@
-main-NSinSameJVM: Cloudscape drivers loaded
+main-NSinSameJVM: Derby drivers loaded
 Server is ready to accept connections on port 20000.
 Connection number: 1.
 main-NSinSameJVM: NetworkServer started

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/holdCursorExternalSortJDBC30.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/holdCursorExternalSortJDBC30.out?view=auto&rev=109265
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/holdCursorExternalSortJDBC30.out	Tue Nov 30 16:23:58 2004
@@ -0,0 +1,345 @@
+ij> ------------------------------------------------------------------------------
+----- TEST CASES SPECIFIC TO STORE IMPLEMENTATION OF HOLD CURSOR (external sort):
+----- overview:
+-----    TEST  0: test hold cursor with external sort (order by).
+-----    TEST  1: basic heap  scan tests (multiple rows)
+-----    TEST  2: basic btree scan tests (zero rows/update nonkey field)
+-----    TEST  3: basic btree scan tests (multiple rows/update nonkey field)
+-----    TEST  4: basic btree scan tests (zero rows/read only/no group fetch)
+-----    TEST  5: basic btree scan tests (multiple rows/read only/no group fetch)
+-----    TEST  6: basic tests for cursors with order by
+-----    TEST  7: test of hold cursor code in DistinctScalarAggregateResultSet.java
+-----    TEST  8: test of hold cursor code in GroupedAggregateResultSet.java
+-----    TEST  9: test scan positioned on a row which has been purged.
+-----    TEST 10: test scan positioned on a page which has been purged
+-----
+-----
+-----
+-----    TEST  0: test hold cursor with external sort (order by).
+-----     Cutover to external sort has been set to 4 rows by the test property 
+-----     file so with 10 rows we get a 1 level external sort.  This tests that
+-----     temp files will be held open across the commit if the cursor is held
+-----     open.
+-----
+run resource 'createTestProcedures.subsql';
+ij> CREATE FUNCTION  PADSTRING (DATA VARCHAR(32000), LENGTH INTEGER) RETURNS VARCHAR(32000) EXTERNAL NAME 'org.apache.derbyTesting.functiontests.util.Formatters.padString' LANGUAGE JAVA PARAMETER STYLE JAVA;
+0 rows inserted/updated/deleted
+ij> CREATE PROCEDURE WAIT_FOR_POST_COMMIT() DYNAMIC RESULT SETS 0 LANGUAGE JAVA EXTERNAL NAME 'org.apache.derbyTesting.functiontests.util.T_Access.waitForPostCommitToFinish' PARAMETER STYLE JAVA;
+0 rows inserted/updated/deleted
+ij> autocommit off;
+ij> create table foo (a int, data varchar(2000));
+0 rows inserted/updated/deleted
+ij> insert into foo values 
+    (10,PADSTRING('10',2000)), (9,PADSTRING('9',2000)), (8,PADSTRING('8',2000)), (7,PADSTRING('7',2000)), (6,PADSTRING('6',2000)), (5,PADSTRING('5',2000)), (4,PADSTRING('4',2000)), (3,PADSTRING('3',2000)), (2,PADSTRING('2',2000)), (1,PADSTRING('1',2000));
+10 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault', '1');
+Statement executed.
+ij> get with hold cursor test1 as 
+    'select * from foo order by a';
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault', '16');
+Statement executed.
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+1 |1                                                                                                                              &
+ij> commit;
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+2 |2                                                                                                                              &
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+3 |3                                                                                                                              &
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+4 |4                                                                                                                              &
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+5 |5                                                                                                                              &
+ij> commit;
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+6 |6                                                                                                                              &
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+7 |7                                                                                                                              &
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+8 |8                                                                                                                              &
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+9 |9                                                                                                                              &
+ij> commit;
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+10 |10                                                                                                                             &
+ij> next test1;
+No current row
+ij> commit;
+ij> close test1;
+ij> -- exercise the non-held cursor path also.
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault', '1');
+Statement executed.
+ij> get cursor test1 as 
+    'select * from foo order by a';
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault', '16');
+Statement executed.
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+1 |1                                                                                                                              &
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+2 |2                                                                                                                              &
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+3 |3                                                                                                                              &
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+4 |4                                                                                                                              &
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+5 |5                                                                                                                              &
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+6 |6                                                                                                                              &
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+7 |7                                                                                                                              &
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+8 |8                                                                                                                              &
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+9 |9                                                                                                                              &
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+10 |10                                                                                                                             &
+ij> next test1;
+No current row
+ij> close test1;
+ij> commit;
+ij> ------------------------------------------------------------------------------
+-----    TEST  1: test hold cursor with multi-level external sort (order by).
+-----     Cutover to external sort has been set to 4 rows by the test property 
+-----     file so with 10 rows we get a 1 level external sort.  This tests that
+-----     temp files will be held open across the commit if the cursor is held
+-----     open.
+-----
+insert into foo select a + 100, data from foo;
+10 rows inserted/updated/deleted
+ij> insert into foo select a + 10,  data from foo;
+20 rows inserted/updated/deleted
+ij> insert into foo select a + 200, data from foo;
+40 rows inserted/updated/deleted
+ij> insert into foo select a + 200, data from foo;
+80 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault', '1');
+Statement executed.
+ij> get with hold cursor test1 as 
+    'select * from foo order by a';
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault', '16');
+Statement executed.
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+1 |1                                                                                                                              &
+ij> commit;
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+2 |2                                                                                                                              &
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+3 |3                                                                                                                              &
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+4 |4                                                                                                                              &
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+5 |5                                                                                                                              &
+ij> commit;
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+6 |6                                                                                                                              &
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+7 |7                                                                                                                              &
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+8 |8                                                                                                                              &
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+9 |9                                                                                                                              &
+ij> commit;
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+10 |10                                                                                                                             &
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+11 |1                                                                                                                              &
+ij> commit;
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+12 |2                                                                                                                              &
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+13 |3                                                                                                                              &
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+14 |4                                                                                                                              &
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+15 |5                                                                                                                              &
+ij> commit;
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+16 |6                                                                                                                              &
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+17 |7                                                                                                                              &
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+18 |8                                                                                                                              &
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+19 |9                                                                                                                              &
+ij> commit;
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+20 |10                                                                                                                             &
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+101 |1                                                                                                                              &
+ij> commit;
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+102 |2                                                                                                                              &
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+103 |3                                                                                                                              &
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+104 |4                                                                                                                              &
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+105 |5                                                                                                                              &
+ij> commit;
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+106 |6                                                                                                                              &
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+107 |7                                                                                                                              &
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+108 |8                                                                                                                              &
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+109 |9                                                                                                                              &
+ij> commit;
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+110 |10                                                                                                                             &
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+111 |1                                                                                                                              &
+ij> commit;
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+112 |2                                                                                                                              &
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+113 |3                                                                                                                              &
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+114 |4                                                                                                                              &
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+115 |5                                                                                                                              &
+ij> commit;
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+116 |6                                                                                                                              &
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+117 |7                                                                                                                              &
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+118 |8                                                                                                                              &
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+119 |9                                                                                                                              &
+ij> commit;
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+120 |10                                                                                                                             &
+ij> next test1;
+A |DATA                                                                                                                            
+-----
+201 |1                                                                                                                              &
+ij> commit;
+ij> close test1;
+ij> -- clean up
+drop function PADSTRING;
+0 rows inserted/updated/deleted
+ij> drop procedure WAIT_FOR_POST_COMMIT;
+0 rows inserted/updated/deleted
+ij> drop table foo;
+0 rows inserted/updated/deleted
+ij> 

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/holdCursorJDBC30.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/holdCursorJDBC30.out?view=auto&rev=109265
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/holdCursorJDBC30.out	Tue Nov 30 16:23:58 2004
@@ -0,0 +1,1579 @@
+ij> ------------------------------------------------------------------------------
+----- TEST CASES SPECIFIC TO STORE IMPLEMENTATION OF HOLD CURSOR:
+----- overview:
+-----    TEST  0: basic heap  scan tests (0 rows).
+-----    TEST  1: basic heap  scan tests (multiple rows)
+-----    TEST  2: basic btree scan tests (zero rows/update nonkey field)
+-----    TEST  3: basic btree scan tests (multiple rows/update nonkey field)
+-----    TEST  4: basic btree scan tests (zero rows/read only/no group fetch)
+-----    TEST  5: basic btree scan tests (multiple rows/read only/no group fetch)
+-----    TEST  6: basic tests for cursors with order by
+-----    TEST  7: test of hold cursor code in DistinctScalarAggregateResultSet.java
+-----    TEST  8: test of hold cursor code in GroupedAggregateResultSet.java
+-----    TEST  9: test scan positioned on a row which has been purged.
+-----    TEST 10: test scan positioned on a page which has been purged
+-----
+-----
+-----
+----- TEST 0: basic heap scan tests (0 rows).
+-----     The following tests that no matter where commit comes in the state of
+-----     the scan that the scan will continue after the commit.  Tests various
+-----     states of scan like: before first next, after first next, before close,
+-----     after close.
+-----
+run resource 'createTestProcedures.subsql';
+ij> CREATE FUNCTION  PADSTRING (DATA VARCHAR(32000), LENGTH INTEGER) RETURNS VARCHAR(32000) EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.Formatters.padString' LANGUAGE JAVA PARAMETER STYLE JAVA;
+0 rows inserted/updated/deleted
+ij> CREATE PROCEDURE WAIT_FOR_POST_COMMIT() DYNAMIC RESULT SETS 0 LANGUAGE JAVA EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.T_Access.waitForPostCommitToFinish' PARAMETER STYLE JAVA;
+0 rows inserted/updated/deleted
+ij> autocommit off;
+ij> create table foo (a int, data int);
+0 rows inserted/updated/deleted
+ij> -- the following for update cursors will all use group fetch = 1, thus each
+----- next passes straight through to store.
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault', '1');
+Statement executed.
+ij> get with hold cursor test1 as 'select * from foo for update';
+ij> close test1;
+ij> commit;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as 'select * from foo for update';
+ij> commit;
+ij> close test1;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as 'select * from foo for update';
+ij> commit;
+ij> next  test1;
+No current row
+ij> close test1;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as 'select * from foo for update';
+ij> next  test1;
+No current row
+ij> commit;
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> close test1;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as 'select * from foo for update';
+ij> next  test1;
+No current row
+ij> commit;
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> commit;
+ij> close test1;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as 'select * from foo for update';
+ij> next  test1;
+No current row
+ij> commit;
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> commit;
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> commit;
+ij> close test1;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as 'select * from foo for update';
+ij> next  test1;
+No current row
+ij> commit;
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> commit;
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> commit;
+ij> close test1;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as 'select * from foo for update';
+ij> next  test1;
+No current row
+ij> commit;
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> commit;
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> close test1;
+ij> commit;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> commit;
+ij> ------------------------------------------------------------------------------
+----- TEST 1: basic heap scan tests (multiple rows)
+-----     The following tests that no matter where commit comes in the state of
+-----     the scan that the scan will continue after the commit.  Tests various
+-----     states of scan like: before first next, after first next, before close,
+-----     after close.
+-----
+insert into foo values (1, 10);
+1 row inserted/updated/deleted
+ij> insert into foo values (1, 20);
+1 row inserted/updated/deleted
+ij> insert into foo values (1, 30);
+1 row inserted/updated/deleted
+ij> insert into foo values (1, 40);
+1 row inserted/updated/deleted
+ij> insert into foo values (1, 50);
+1 row inserted/updated/deleted
+ij> -- the following for update cursors will all use group fetch = 1, thus each
+----- next passes straight through to store.
+get with hold cursor test1 as 'select * from foo for update';
+ij> close test1;
+ij> commit;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as 'select * from foo for update';
+ij> commit;
+ij> close test1;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as 'select * from foo for update';
+ij> commit;
+ij> next  test1;
+A |DATA       
+-----
+1 |10         
+ij> close test1;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as 'select * from foo for update';
+ij> next  test1;
+A |DATA       
+-----
+1 |10         
+ij> commit;
+ij> next  test1;
+A |DATA       
+-----
+1 |20         
+ij> close test1;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as 'select * from foo for update';
+ij> next  test1;
+A |DATA       
+-----
+1 |10         
+ij> commit;
+ij> next  test1;
+A |DATA       
+-----
+1 |20         
+ij> commit;
+ij> close test1;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as 'select * from foo for update';
+ij> next  test1;
+A |DATA       
+-----
+1 |10         
+ij> commit;
+ij> next  test1;
+A |DATA       
+-----
+1 |20         
+ij> commit;
+ij> next  test1;
+A |DATA       
+-----
+1 |30         
+ij> next  test1;
+A |DATA       
+-----
+1 |40         
+ij> next  test1;
+A |DATA       
+-----
+1 |50         
+ij> commit;
+ij> close test1;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as 'select * from foo for update';
+ij> next  test1;
+A |DATA       
+-----
+1 |10         
+ij> commit;
+ij> next  test1;
+A |DATA       
+-----
+1 |20         
+ij> commit;
+ij> next  test1;
+A |DATA       
+-----
+1 |30         
+ij> next  test1;
+A |DATA       
+-----
+1 |40         
+ij> next  test1;
+A |DATA       
+-----
+1 |50         
+ij> next  test1;
+No current row
+ij> commit;
+ij> close test1;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as 'select * from foo for update';
+ij> next  test1;
+A |DATA       
+-----
+1 |10         
+ij> commit;
+ij> next  test1;
+A |DATA       
+-----
+1 |20         
+ij> commit;
+ij> next  test1;
+A |DATA       
+-----
+1 |30         
+ij> next  test1;
+A |DATA       
+-----
+1 |40         
+ij> next  test1;
+A |DATA       
+-----
+1 |50         
+ij> next  test1;
+No current row
+ij> close test1;
+ij> commit;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> commit;
+ij> ------------------------------------------------------------------------------
+----- TEST 2: basic btree scan tests (zero rows/update nonkey field)
+-----     The following tests that no matter where commit comes in the state of
+-----     the scan that the scan will continue after the commit.  Tests various
+-----     states of scan like: before first next, after first next, before close,
+-----     after close.
+-----
+autocommit off;
+ij> drop table foo;
+0 rows inserted/updated/deleted
+ij> create table foo (a int, data int);
+0 rows inserted/updated/deleted
+ij> create index foox on foo (a);
+0 rows inserted/updated/deleted
+ij> -- the following for update cursors will all use group fetch = 1, thus each
+----- next passes straight through to store.
+get with hold cursor test1 as
+    'select * from foo for update of data';
+ij> close test1;
+ij> commit;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as
+    'select * from foo for update of data';
+ij> commit;
+ij> close test1;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as
+    'select * from foo for update of data';
+ij> commit;
+ij> next  test1;
+No current row
+ij> close test1;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as
+    'select * from foo for update of data';
+ij> next  test1;
+No current row
+ij> commit;
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> close test1;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as
+    'select * from foo for update of data';
+ij> next  test1;
+No current row
+ij> commit;
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> commit;
+ij> close test1;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as
+    'select * from foo for update of data';
+ij> next  test1;
+No current row
+ij> commit;
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> commit;
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> commit;
+ij> close test1;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as
+    'select * from foo for update of data';
+ij> next  test1;
+No current row
+ij> commit;
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> commit;
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> commit;
+ij> close test1;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as
+    'select * from foo for update of data';
+ij> next  test1;
+No current row
+ij> commit;
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> commit;
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> close test1;
+ij> commit;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> commit;
+ij> ------------------------------------------------------------------------------
+----- TEST 3: basic btree scan tests (multiple rows/update nonkey field)
+-----     The following tests that no matter where commit comes in the state of
+-----     the scan that the scan will continue after the commit.  Tests various
+-----     states of scan like: before first next, after first next, before close,
+-----     after close.
+-----
+insert into foo values (1, 10);
+1 row inserted/updated/deleted
+ij> insert into foo values (1, 20);
+1 row inserted/updated/deleted
+ij> insert into foo values (1, 30);
+1 row inserted/updated/deleted
+ij> insert into foo values (1, 40);
+1 row inserted/updated/deleted
+ij> insert into foo values (1, 50);
+1 row inserted/updated/deleted
+ij> -- the following for update of data cursors will all use group fetch = 1, thus each
+----- next passes straight through to store.
+get with hold cursor test1 as
+    'select * from foo for update of data';
+ij> close test1;
+ij> commit;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as
+    'select * from foo for update of data';
+ij> commit;
+ij> close test1;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as
+    'select * from foo for update of data';
+ij> commit;
+ij> next  test1;
+A |DATA       
+-----
+1 |10         
+ij> close test1;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as
+    'select * from foo for update of data';
+ij> next  test1;
+A |DATA       
+-----
+1 |10         
+ij> commit;
+ij> next  test1;
+A |DATA       
+-----
+1 |20         
+ij> close test1;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as
+    'select * from foo for update of data';
+ij> next  test1;
+A |DATA       
+-----
+1 |10         
+ij> commit;
+ij> next  test1;
+A |DATA       
+-----
+1 |20         
+ij> commit;
+ij> close test1;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as
+    'select * from foo for update of data';
+ij> next  test1;
+A |DATA       
+-----
+1 |10         
+ij> commit;
+ij> next  test1;
+A |DATA       
+-----
+1 |20         
+ij> commit;
+ij> next  test1;
+A |DATA       
+-----
+1 |30         
+ij> next  test1;
+A |DATA       
+-----
+1 |40         
+ij> next  test1;
+A |DATA       
+-----
+1 |50         
+ij> commit;
+ij> close test1;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as
+    'select * from foo for update of data';
+ij> next  test1;
+A |DATA       
+-----
+1 |10         
+ij> commit;
+ij> next  test1;
+A |DATA       
+-----
+1 |20         
+ij> commit;
+ij> next  test1;
+A |DATA       
+-----
+1 |30         
+ij> next  test1;
+A |DATA       
+-----
+1 |40         
+ij> next  test1;
+A |DATA       
+-----
+1 |50         
+ij> next  test1;
+No current row
+ij> commit;
+ij> close test1;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as 
+    'select * from foo for update of data';
+ij> next  test1;
+A |DATA       
+-----
+1 |10         
+ij> commit;
+ij> next  test1;
+A |DATA       
+-----
+1 |20         
+ij> commit;
+ij> next  test1;
+A |DATA       
+-----
+1 |30         
+ij> next  test1;
+A |DATA       
+-----
+1 |40         
+ij> next  test1;
+A |DATA       
+-----
+1 |50         
+ij> next  test1;
+No current row
+ij> close test1;
+ij> commit;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> --  test negative case of trying non next operations after commit
+get with hold cursor test1 as 
+    'select * from foo for update of data';
+ij> next  test1;
+A |DATA       
+-----
+1 |10         
+ij> commit;
+ij> delete from foo where current of test1;
+ERROR 24000: Invalid cursor state - no current row.
+ij> next  test1;
+A |DATA       
+-----
+1 |20         
+ij> commit;
+ij> update foo set data=-3000 where current of test1;
+ERROR 24000: Invalid cursor state - no current row.
+ij> next  test1;
+A |DATA       
+-----
+1 |30         
+ij> next  test1;
+A |DATA       
+-----
+1 |40         
+ij> next  test1;
+A |DATA       
+-----
+1 |50         
+ij> next  test1;
+No current row
+ij> close test1;
+ij> commit;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> --  test positive case of trying delete/update after commit and next.
+get with hold cursor test1 as 
+    'select * from foo for update of data';
+ij> next  test1;
+A |DATA       
+-----
+1 |10         
+ij> commit;
+ij> next  test1;
+A |DATA       
+-----
+1 |20         
+ij> delete from foo where current of test1;
+1 row inserted/updated/deleted
+ij> commit;
+ij> next  test1;
+A |DATA       
+-----
+1 |30         
+ij> next  test1;
+A |DATA       
+-----
+1 |40         
+ij> update foo set data=-3000 where current of test1;
+1 row inserted/updated/deleted
+ij> next  test1;
+A |DATA       
+-----
+1 |50         
+ij> next  test1;
+No current row
+ij> close test1;
+ij> commit;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> --  make sure above deletes/updates worked.
+get with hold cursor test1 as 
+    'select * from foo for update of data';
+ij> next  test1;
+A |DATA       
+-----
+1 |10         
+ij> commit;
+ij> next  test1;
+A |DATA       
+-----
+1 |30         
+ij> commit;
+ij> next  test1;
+A |DATA       
+-----
+1 |-3000      
+ij> next  test1;
+A |DATA       
+-----
+1 |50         
+ij> next  test1;
+No current row
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> close test1;
+ij> commit;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> commit;
+ij> ------------------------------------------------------------------------------
+----- TEST 4: basic btree scan tests (zero rows/read only/no group fetch)
+-----     The following tests that no matter where commit comes in the state of
+-----     the scan that the scan will continue after the commit.  Tests various
+-----     states of scan like: before first next, after first next, before close,
+-----     after close.
+-----
+----- basic tests for btree
+autocommit off;
+ij> drop table foo;
+0 rows inserted/updated/deleted
+ij> create table foo (a int, data int);
+0 rows inserted/updated/deleted
+ij> create index foox on foo (a);
+0 rows inserted/updated/deleted
+ij> -- the following for read cursors will all use group fetch = 1, thus each
+----- next passes straight through to store.  This select should only use the
+----- index with no interaction with the base table.
+get with hold cursor test1 as
+    'select a from foo ';
+ij> close test1;
+ij> commit;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as
+    'select * from foo ';
+ij> commit;
+ij> close test1;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as
+    'select * from foo ';
+ij> commit;
+ij> next  test1;
+No current row
+ij> close test1;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as
+    'select * from foo ';
+ij> next  test1;
+No current row
+ij> commit;
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> close test1;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as
+    'select * from foo ';
+ij> next  test1;
+No current row
+ij> commit;
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> commit;
+ij> close test1;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as
+    'select * from foo ';
+ij> next  test1;
+No current row
+ij> commit;
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> commit;
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> commit;
+ij> close test1;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as
+    'select * from foo ';
+ij> next  test1;
+No current row
+ij> commit;
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> commit;
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> commit;
+ij> close test1;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as
+    'select * from foo ';
+ij> next  test1;
+No current row
+ij> commit;
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> commit;
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> close test1;
+ij> commit;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> commit;
+ij> ------------------------------------------------------------------------------
+----- TEST 5: basic btree scan tests (multiple rows/read only/no group fetch)
+-----     The following tests that no matter where commit comes in the state of
+-----     the scan that the scan will continue after the commit.  Tests various
+-----     states of scan like: before first next, after first next, before close,
+-----     after close.
+-----
+insert into foo values (1, 10);
+1 row inserted/updated/deleted
+ij> insert into foo values (1, 20);
+1 row inserted/updated/deleted
+ij> insert into foo values (1, 30);
+1 row inserted/updated/deleted
+ij> insert into foo values (1, 40);
+1 row inserted/updated/deleted
+ij> insert into foo values (1, 50);
+1 row inserted/updated/deleted
+ij> -- the following for read cursors will all use group fetch = 1, thus each
+----- next passes straight through to store.  This select should only use the
+----- index with no interaction with the base table.
+get with hold cursor test1 as
+    'select * from foo ';
+ij> close test1;
+ij> commit;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as
+    'select * from foo ';
+ij> commit;
+ij> close test1;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as
+    'select * from foo ';
+ij> commit;
+ij> next  test1;
+A |DATA       
+-----
+1 |10         
+ij> close test1;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as
+    'select * from foo ';
+ij> next  test1;
+A |DATA       
+-----
+1 |10         
+ij> commit;
+ij> next  test1;
+A |DATA       
+-----
+1 |20         
+ij> close test1;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as
+    'select * from foo ';
+ij> next  test1;
+A |DATA       
+-----
+1 |10         
+ij> commit;
+ij> next  test1;
+A |DATA       
+-----
+1 |20         
+ij> commit;
+ij> close test1;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as
+    'select * from foo ';
+ij> next  test1;
+A |DATA       
+-----
+1 |10         
+ij> commit;
+ij> next  test1;
+A |DATA       
+-----
+1 |20         
+ij> commit;
+ij> next  test1;
+A |DATA       
+-----
+1 |30         
+ij> next  test1;
+A |DATA       
+-----
+1 |40         
+ij> next  test1;
+A |DATA       
+-----
+1 |50         
+ij> commit;
+ij> close test1;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as
+    'select * from foo ';
+ij> next  test1;
+A |DATA       
+-----
+1 |10         
+ij> commit;
+ij> next  test1;
+A |DATA       
+-----
+1 |20         
+ij> commit;
+ij> next  test1;
+A |DATA       
+-----
+1 |30         
+ij> next  test1;
+A |DATA       
+-----
+1 |40         
+ij> next  test1;
+A |DATA       
+-----
+1 |50         
+ij> next  test1;
+No current row
+ij> commit;
+ij> close test1;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as 
+    'select * from foo ';
+ij> next  test1;
+A |DATA       
+-----
+1 |10         
+ij> commit;
+ij> next  test1;
+A |DATA       
+-----
+1 |20         
+ij> commit;
+ij> next  test1;
+A |DATA       
+-----
+1 |30         
+ij> next  test1;
+A |DATA       
+-----
+1 |40         
+ij> next  test1;
+A |DATA       
+-----
+1 |50         
+ij> next  test1;
+No current row
+ij> close test1;
+ij> commit;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> commit;
+ij> ------------------------------------------------------------------------------
+----- TEST 6: basic tests for cursors with order by
+-----     The following tests that no matter where commit comes in the state of
+-----     the scan that the scan will continue after the commit.  Tests various
+-----     states of scan like: before first next, after first next, before close,
+-----     after close.
+-----
+----- basic tests for cursors which include an order by
+autocommit off;
+ij> drop table foo;
+0 rows inserted/updated/deleted
+ij> create table foo (a int, data int);
+0 rows inserted/updated/deleted
+ij> create index foox on foo (a);
+0 rows inserted/updated/deleted
+ij> -- the following for update cursors will all use group fetch = 1, thus each
+----- next passes straight through to store.  This select should only use the
+----- index with no interaction with the base table.
+get with hold cursor test1 as
+    'select a,data from foo order by data desc';
+ij> close test1;
+ij> commit;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as
+    'select a,data from foo order by data desc';
+ij> commit;
+ij> close test1;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as
+    'select a,data from foo order by data desc';
+ij> commit;
+ij> next  test1;
+No current row
+ij> close test1;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as
+    'select a,data from foo order by data desc';
+ij> next  test1;
+No current row
+ij> commit;
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> close test1;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as
+    'select a,data from foo order by data desc';
+ij> next  test1;
+No current row
+ij> commit;
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> commit;
+ij> close test1;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as
+    'select a,data from foo order by data desc';
+ij> next  test1;
+No current row
+ij> commit;
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> commit;
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> commit;
+ij> close test1;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as
+    'select a,data from foo order by data desc';
+ij> next  test1;
+No current row
+ij> commit;
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> commit;
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> commit;
+ij> close test1;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as
+    'select a,data from foo order by data desc';
+ij> next  test1;
+No current row
+ij> commit;
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> commit;
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> next  test1;
+ERROR (no SQLState): Invalid operation: result set closed
+ij> close test1;
+ij> commit;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> commit;
+ij> insert into foo values (1, 10);
+1 row inserted/updated/deleted
+ij> insert into foo values (1, 20);
+1 row inserted/updated/deleted
+ij> insert into foo values (1, 30);
+1 row inserted/updated/deleted
+ij> insert into foo values (1, 40);
+1 row inserted/updated/deleted
+ij> insert into foo values (1, 50);
+1 row inserted/updated/deleted
+ij> -- insert into foo (select a + 5, data + 50 from foo);
+----- the following for update of data cursors will all use group fetch = 1, thus each
+----- next passes straight through to store.
+get with hold cursor test1 as
+    'select a,data from foo order by data desc';
+ij> close test1;
+ij> commit;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as
+    'select a,data from foo order by data desc';
+ij> commit;
+ij> close test1;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as
+    'select a,data from foo order by data desc';
+ij> commit;
+ij> next  test1;
+A |DATA       
+-----
+1 |50         
+ij> close test1;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as
+    'select a,data from foo order by data desc';
+ij> next  test1;
+A |DATA       
+-----
+1 |50         
+ij> commit;
+ij> next  test1;
+A |DATA       
+-----
+1 |40         
+ij> close test1;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as
+    'select a,data from foo order by data desc';
+ij> next  test1;
+A |DATA       
+-----
+1 |50         
+ij> commit;
+ij> next  test1;
+A |DATA       
+-----
+1 |40         
+ij> commit;
+ij> close test1;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as
+    'select a,data from foo order by data desc';
+ij> next  test1;
+A |DATA       
+-----
+1 |50         
+ij> commit;
+ij> next  test1;
+A |DATA       
+-----
+1 |40         
+ij> commit;
+ij> next  test1;
+A |DATA       
+-----
+1 |30         
+ij> next  test1;
+A |DATA       
+-----
+1 |20         
+ij> next  test1;
+A |DATA       
+-----
+1 |10         
+ij> commit;
+ij> close test1;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as
+    'select a,data from foo order by data desc';
+ij> next  test1;
+A |DATA       
+-----
+1 |50         
+ij> commit;
+ij> next  test1;
+A |DATA       
+-----
+1 |40         
+ij> commit;
+ij> next  test1;
+A |DATA       
+-----
+1 |30         
+ij> next  test1;
+A |DATA       
+-----
+1 |20         
+ij> next  test1;
+A |DATA       
+-----
+1 |10         
+ij> next  test1;
+No current row
+ij> commit;
+ij> close test1;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> get with hold cursor test1 as 
+    'select a,data from foo order by data desc';
+ij> next  test1;
+A |DATA       
+-----
+1 |50         
+ij> commit;
+ij> next  test1;
+A |DATA       
+-----
+1 |40         
+ij> commit;
+ij> next  test1;
+A |DATA       
+-----
+1 |30         
+ij> next  test1;
+A |DATA       
+-----
+1 |20         
+ij> next  test1;
+A |DATA       
+-----
+1 |10         
+ij> next  test1;
+No current row
+ij> close test1;
+ij> commit;
+ij> -- should fail
+next test1;
+IJ ERROR: Unable to establish cursor
+ij> commit;
+ij> ------------------------------------------------------------------------------
+----- TEST 7: test of hold cursor code in DistinctScalarAggregateResultSet.java
+-----     Directed test of hold cursor as applies to sort scans opened by
+-----     DistinctScalarAggregateResultSet.java.
+-----
+drop table t1;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'T1' because it does not exist.
+ij> create table t1 (c1 int, c2 int);
+0 rows inserted/updated/deleted
+ij> insert into t1 values (null, null), (1,1), (null, null), (2,1), (3,1), (10,10);
+6 rows inserted/updated/deleted
+ij> select * from t1;
+C1 |C2         
+-----
+NULL |NULL       
+1 |1          
+NULL |NULL       
+2 |1          
+3 |1          
+10 |10         
+ij> select sum(distinct c1) from t1;
+1          
+-----
+16         
+WARNING 01003: Null values were eliminated from the argument of a column function. : 
+ij> get with hold cursor test1 as 'select sum(distinct c1) from t1';
+ij> commit;
+ij> next test1;
+1          
+-----
+16         
+WARNING 01003: Null values were eliminated from the argument of a column function. : 
+ij> close test1;
+ij> get with hold cursor test1 as 'select sum(distinct c1) from t1';
+ij> next test1;
+1          
+-----
+16         
+WARNING 01003: Null values were eliminated from the argument of a column function. : 
+ij> commit;
+ij> next test1;
+No current row
+ij> commit;
+ij> close test1;
+ij> commit;
+ij> ------------------------------------------------------------------------------
+----- TEST 8: test of hold cursor code in GroupedAggregateResultSet.java
+-----     Directed test of hold cursor as applies to sort scans opened by
+-----     GroupedAggregateResultSet.java.
+-----
+drop table t1;
+0 rows inserted/updated/deleted
+ij> create table t1 (c1 int, c2 int);
+0 rows inserted/updated/deleted
+ij> insert into t1 values (null, null), (1,1), (null, null), (2,1), (3,1), (10,10);
+6 rows inserted/updated/deleted
+ij> select * from t1;
+C1 |C2         
+-----
+NULL |NULL       
+1 |1          
+NULL |NULL       
+2 |1          
+3 |1          
+10 |10         
+ij> select sum(distinct c1) from t1 group by c2;
+1          
+-----
+6          
+10         
+NULL       
+WARNING 01003: Null values were eliminated from the argument of a column function. : 
+ij> commit;
+ij> get with hold cursor test1 as 'select sum(distinct c1) from t1 group by c2';
+ij> commit;
+ij> next test1;
+1          
+-----
+6          
+ij> next test1;
+1          
+-----
+10         
+ij> commit;
+ij> next test1;
+1          
+-----
+NULL       
+WARNING 01003: Null values were eliminated from the argument of a column function. : 
+ij> close test1;
+ij> get with hold cursor test1 as 'select sum(distinct c1) from t1 group by c2';
+ij> next test1;
+1          
+-----
+6          
+ij> commit;
+ij> next test1;
+1          
+-----
+10         
+ij> commit;
+ij> next test1;
+1          
+-----
+NULL       
+WARNING 01003: Null values were eliminated from the argument of a column function. : 
+ij> close test1;
+ij> ------------------------------------------------------------------------------
+----- TEST 9: test scan positioned on a row which has been purged.
+-----
+drop table t1;
+0 rows inserted/updated/deleted
+ij> create table t1 (c1 int, c2 int);
+0 rows inserted/updated/deleted
+ij> create index tx on t1 (c1);
+0 rows inserted/updated/deleted
+ij> insert into t1 values (1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6);
+6 rows inserted/updated/deleted
+ij> get with hold cursor test1 as 
+    'select c1 from t1';
+ij> next test1;
+C1         
+-----
+1          
+ij> commit;
+ij> -- at this point the btree scan is positioned by "key" on (1,1).  Make sure
+----- deleting this key doesn't cause any problems.
+delete from t1 where c1 = 1 or c1 = 2;
+2 rows inserted/updated/deleted
+ij> next test1;
+C1         
+-----
+2          
+ij> -- at this point the btree scan is positioned on (3, 3), let's see what happens
+----- if we delete (3,3) and look at current scan.
+delete from t1 where c1 = 3;
+1 row inserted/updated/deleted
+ij> -- position on (4,4)
+next test1;
+C1         
+-----
+3          
+ij> commit;
+ij> -- delete all the rows and hopefully get all rows to be purged by the time
+----- the scan does the next.
+delete from t1;
+3 rows inserted/updated/deleted
+ij> commit;
+ij> next test1;
+C1         
+-----
+4          
+ij> close test1;
+ij> ------------------------------------------------------------------------------
+----- TEST 10: test scan positioned on a page which has been purged (should really
+-----          not be any different than a row being purged).
+-----
+drop table t1;
+0 rows inserted/updated/deleted
+ij> create table t1 (c1 varchar(1000), c2 int);
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', '4096');
+Statement executed.
+ij> create index tx on t1 (c1);
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', NULL);
+Statement executed.
+ij> insert into t1 values (PADSTRING('1',1000), 1), (PADSTRING('2',1000), 2), (PADSTRING('3',1000), 3), (PADSTRING('4',1000), 4), (PADSTRING('5',1000), 5), (PADSTRING('6',1000), 6), (PADSTRING('7',1000), 7);
+7 rows inserted/updated/deleted
+ij> get with hold cursor test1 as 
+    'select c1 from t1';
+ij> next test1;
+C1                                                                                                                              
+-----
+1                                                                                                                              &
+ij> commit;
+ij> -- at this point the btree scan is positioned by "key" on (1,1).  Make sure
+----- deleting this key doesn't cause any problems.
+delete from t1 where c1 = PADSTRING('1',1000) or c1 = PADSTRING('2',1000);
+2 rows inserted/updated/deleted
+ij> next test1;
+C1                                                                                                                              
+-----
+2                                                                                                                              &
+ij> -- at this point the btree scan is positioned on (3, 3), let's see what happens
+----- if we delete (3,3) and look at current scan.
+delete from t1 where c1 = PADSTRING('3',1000);
+1 row inserted/updated/deleted
+ij> -- position on (4,4)
+next test1;
+C1                                                                                                                              
+-----
+3                                                                                                                              &
+ij> commit;
+ij> -- delete all the rows and hopefully get all rows to be purged by the time
+----- the scan does the next.
+delete from t1;
+4 rows inserted/updated/deleted
+ij> commit;
+ij> next test1;
+C1                                                                                                                              
+-----
+4                                                                                                                              &
+ij> close test1;
+ij> ------------------------------------------------------------------------------
+----- TEST 11: beetle 4902: test query plans which use reopenScan() on a btree to 
+-----          do the inner table processing of a join.  Prior to the fix a null
+-----          pointer exception would be thrown after the commit, as the code
+-----          did not handle keeping the resultset used for the inner table
+-----          open across commits in this case.
+-----
+drop table t1;
+0 rows inserted/updated/deleted
+ij> drop table t2;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'T2' because it does not exist.
+ij> create table t1 (i1 int, i2 int);
+0 rows inserted/updated/deleted
+ij> create table t2 (i1 int, i2 int);
+0 rows inserted/updated/deleted
+ij> create index t1_idx on t1 (i1);
+0 rows inserted/updated/deleted
+ij> create index t2_idx on t2 (i1);
+0 rows inserted/updated/deleted
+ij> insert into t1 values (1, 10), (2, 20), (3, 30), (4, 40), (5, 50);
+5 rows inserted/updated/deleted
+ij> insert into t2 values (1, 10), (2, 20),          (4, 40), (5, 50);
+4 rows inserted/updated/deleted
+ij> commit;
+ij> -- force nestedLoop to make sure reopenScan() is used on inner table.
+get with hold cursor test11 as
+'select * from
+    t1, t2
+        where t1.i1 = t2.i1';
+ij> commit;
+ij> next test11;
+I1 |I2 |I1 |I2         
+-----
+1 |10 |1 |10         
+ij> commit;
+ij> next test11;
+I1 |I2 |I1 |I2         
+-----
+2 |20 |2 |20         
+ij> commit;
+ij> next test11;
+I1 |I2 |I1 |I2         
+-----
+4 |40 |4 |40         
+ij> next test11;
+I1 |I2 |I1 |I2         
+-----
+5 |50 |5 |50         
+ij> commit;
+ij> commit;
+ij> next test11;
+No current row
+ij> commit;
+ij> close test11;
+ij> ------------------------------------------------------------------------------
+----- TEST 12: beetle 4902: test query plans which use reopenScan() on a base table
+-----          to do the inner table processing of a join.  Prior to the fix a null
+-----          pointer exception would be thrown after the commit, as the code
+-----          did not handle keeping the resultset used for the inner table
+-----          open across commits in this case.
+-----
+drop table t1;
+0 rows inserted/updated/deleted
+ij> drop table t2;
+0 rows inserted/updated/deleted
+ij> create table t1 (i1 int, i2 int);
+0 rows inserted/updated/deleted
+ij> create table t2 (i1 int, i2 int);
+0 rows inserted/updated/deleted
+ij> insert into t1 values (1, 10), (2, 20), (3, 30), (4, 40), (5, 50);
+5 rows inserted/updated/deleted
+ij> insert into t2 values (1, 10), (2, 20),          (4, 40), (5, 50);
+4 rows inserted/updated/deleted
+ij> commit;
+ij> -- force nestedLoop to make sure reopenScan() is used on inner table.
+get with hold cursor test12 as
+'select * from
+    t1, t2
+        where t1.i1 = t2.i1';
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault', '16');
+Statement executed.
+ij> commit;
+ij> next test12;
+I1 |I2 |I1 |I2         
+-----
+1 |10 |1 |10         
+ij> commit;
+ij> next test12;
+I1 |I2 |I1 |I2         
+-----
+2 |20 |2 |20         
+ij> commit;
+ij> next test12;
+I1 |I2 |I1 |I2         
+-----
+4 |40 |4 |40         
+ij> next test12;
+I1 |I2 |I1 |I2         
+-----
+5 |50 |5 |50         
+ij> commit;
+ij> commit;
+ij> next test12;
+No current row
+ij> commit;
+ij> close test12;
+ij> exit;

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/Rllmodule1.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/Rllmodule1.out?view=auto&rev=109265
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/Rllmodule1.out	Tue Nov 30 16:23:58 2004
@@ -0,0 +1,74 @@
+ij> -- Test whether the RllRAMAccessmanager is working right (ie. forcing row 
+-- level locking). 
+run resource 'LockTableQuery.subsql';
+ij> create view lock_table as
+select 
+    cast(username as char(8)) as username,
+    cast(t.type as char(8)) as trantype,
+    cast(l.type as char(8)) as type,
+    cast(lockcount as char(3)) as cnt,
+    mode,
+    cast(tablename as char(12)) as tabname,
+    cast(lockname as char(10)) as lockname,
+    state,
+    status
+from 
+    new org.apache.derby.diag.LockTable() l  right outer join new org.apache.derby.diag.TransactionTable() t
+on l.xid = t.xid where l.tableType <> 'S' and t.type='UserTransaction';
+0 rows inserted/updated/deleted
+ij> --on l.xid = t.xid where l.tableType <> 'S' or l.tableType is null
+-- order by
+--     tabname, type desc, mode, cnt, lockname
+-- lock table with system catalog locks included.
+create view full_lock_table as
+select 
+    cast(username as char(8)) as username,
+    cast(t.type as char(8)) as trantype,
+    cast(l.type as char(8)) as type,
+    cast(lockcount as char(3)) as cnt,
+    mode,
+    cast(tablename as char(12)) as tabname,
+    cast(lockname as char(10)) as lockname,
+    state,
+    status
+from 
+    new org.apache.derby.diag.LockTable() l right outer join new org.apache.derby.diag.TransactionTable() t
+on l.xid = t.xid where l.tableType <> 'S' ;
+0 rows inserted/updated/deleted
+ij> -- lock table with no join.
+create view lock_table2 as
+select 
+    cast(l.xid as char(8)) as xid,
+    cast(l.type as char(8)) as type,
+    cast(lockcount as char(3)) as cnt,
+    mode,
+    cast(tablename as char(12)) as tabname,
+    cast(lockname as char(10)) as lockname,
+    state
+from 
+    new org.apache.derby.diag.LockTable() l  
+where l.tableType <> 'S' ;
+0 rows inserted/updated/deleted
+ij> -- transaction table with no join.
+create view tran_table as
+select 
+    *
+from 
+    new org.apache.derby.diag.TransactionTable() t ;
+0 rows inserted/updated/deleted
+ij> autocommit off;
+ij> create table heap_only (a int);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test insert into empty heap, should just get row lock 
+--------------------------------------------------------------------------------
+insert into heap_only values (1);
+1 row inserted/updated/deleted
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IX  |HEAP_ONLY   |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |HEAP_ONLY   |(1,7)     |GRANT|ACTIVE  
+ij> commit;
+ij> 

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/Rllmodule2.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/Rllmodule2.out?view=auto&rev=109265
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/Rllmodule2.out	Tue Nov 30 16:23:58 2004
@@ -0,0 +1,74 @@
+ij> -- Test whether the RllRAMAccessmanager is working right.  The property file
+-- for this test sets the lock level to table so make sure we get a table lock.
+-- level locking). 
+run resource 'LockTableQuery.subsql';
+ij> create view lock_table as
+select 
+    cast(username as char(8)) as username,
+    cast(t.type as char(8)) as trantype,
+    cast(l.type as char(8)) as type,
+    cast(lockcount as char(3)) as cnt,
+    mode,
+    cast(tablename as char(12)) as tabname,
+    cast(lockname as char(10)) as lockname,
+    state,
+    status
+from 
+    new org.apache.derby.diag.LockTable() l  right outer join new org.apache.derby.diag.TransactionTable() t
+on l.xid = t.xid where l.tableType <> 'S' and t.type='UserTransaction';
+0 rows inserted/updated/deleted
+ij> --on l.xid = t.xid where l.tableType <> 'S' or l.tableType is null
+-- order by
+--     tabname, type desc, mode, cnt, lockname
+-- lock table with system catalog locks included.
+create view full_lock_table as
+select 
+    cast(username as char(8)) as username,
+    cast(t.type as char(8)) as trantype,
+    cast(l.type as char(8)) as type,
+    cast(lockcount as char(3)) as cnt,
+    mode,
+    cast(tablename as char(12)) as tabname,
+    cast(lockname as char(10)) as lockname,
+    state,
+    status
+from 
+    new org.apache.derby.diag.LockTable() l right outer join new org.apache.derby.diag.TransactionTable() t
+on l.xid = t.xid where l.tableType <> 'S' ;
+0 rows inserted/updated/deleted
+ij> -- lock table with no join.
+create view lock_table2 as
+select 
+    cast(l.xid as char(8)) as xid,
+    cast(l.type as char(8)) as type,
+    cast(lockcount as char(3)) as cnt,
+    mode,
+    cast(tablename as char(12)) as tabname,
+    cast(lockname as char(10)) as lockname,
+    state
+from 
+    new org.apache.derby.diag.LockTable() l  
+where l.tableType <> 'S' ;
+0 rows inserted/updated/deleted
+ij> -- transaction table with no join.
+create view tran_table as
+select 
+    *
+from 
+    new org.apache.derby.diag.TransactionTable() t ;
+0 rows inserted/updated/deleted
+ij> autocommit off;
+ij> create table heap_only (a int);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test insert into empty heap, should just get table lock 
+--------------------------------------------------------------------------------
+insert into heap_only values (1);
+1 row inserted/updated/deleted
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |X   |HEAP_ONLY   |Tablelock |GRANT|ACTIVE  
+ij> commit;
+ij> 

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/Rllmodule3.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/Rllmodule3.out?view=auto&rev=109265
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/Rllmodule3.out	Tue Nov 30 16:23:58 2004
@@ -0,0 +1,74 @@
+ij> -- Test whether the RllRAMAccessmanager is working right (ie. forcing row 
+-- level locking with no properties set). 
+run resource 'LockTableQuery.subsql';
+ij> create view lock_table as
+select 
+    cast(username as char(8)) as username,
+    cast(t.type as char(8)) as trantype,
+    cast(l.type as char(8)) as type,
+    cast(lockcount as char(3)) as cnt,
+    mode,
+    cast(tablename as char(12)) as tabname,
+    cast(lockname as char(10)) as lockname,
+    state,
+    status
+from 
+    new org.apache.derby.diag.LockTable() l  right outer join new org.apache.derby.diag.TransactionTable() t
+on l.xid = t.xid where l.tableType <> 'S' and t.type='UserTransaction';
+0 rows inserted/updated/deleted
+ij> --on l.xid = t.xid where l.tableType <> 'S' or l.tableType is null
+-- order by
+--     tabname, type desc, mode, cnt, lockname
+-- lock table with system catalog locks included.
+create view full_lock_table as
+select 
+    cast(username as char(8)) as username,
+    cast(t.type as char(8)) as trantype,
+    cast(l.type as char(8)) as type,
+    cast(lockcount as char(3)) as cnt,
+    mode,
+    cast(tablename as char(12)) as tabname,
+    cast(lockname as char(10)) as lockname,
+    state,
+    status
+from 
+    new org.apache.derby.diag.LockTable() l right outer join new org.apache.derby.diag.TransactionTable() t
+on l.xid = t.xid where l.tableType <> 'S' ;
+0 rows inserted/updated/deleted
+ij> -- lock table with no join.
+create view lock_table2 as
+select 
+    cast(l.xid as char(8)) as xid,
+    cast(l.type as char(8)) as type,
+    cast(lockcount as char(3)) as cnt,
+    mode,
+    cast(tablename as char(12)) as tabname,
+    cast(lockname as char(10)) as lockname,
+    state
+from 
+    new org.apache.derby.diag.LockTable() l  
+where l.tableType <> 'S' ;
+0 rows inserted/updated/deleted
+ij> -- transaction table with no join.
+create view tran_table as
+select 
+    *
+from 
+    new org.apache.derby.diag.TransactionTable() t ;
+0 rows inserted/updated/deleted
+ij> autocommit off;
+ij> create table heap_only (a int);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test insert into empty heap, should just get row lock 
+--------------------------------------------------------------------------------
+insert into heap_only values (1);
+1 row inserted/updated/deleted
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IX  |HEAP_ONLY   |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |HEAP_ONLY   |(1,7)     |GRANT|ACTIVE  
+ij> commit;
+ij> 

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/Rllmodule4.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/Rllmodule4.out?view=auto&rev=109265
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/Rllmodule4.out	Tue Nov 30 16:23:58 2004
@@ -0,0 +1,74 @@
+ij> -- Test whether the RllRAMAccessmanager is working right (ie. forcing row 
+-- level locking). 
+run resource 'LockTableQuery.subsql';
+ij> create view lock_table as
+select 
+    cast(username as char(8)) as username,
+    cast(t.type as char(8)) as trantype,
+    cast(l.type as char(8)) as type,
+    cast(lockcount as char(3)) as cnt,
+    mode,
+    cast(tablename as char(12)) as tabname,
+    cast(lockname as char(10)) as lockname,
+    state,
+    status
+from 
+    new org.apache.derby.diag.LockTable() l  right outer join new org.apache.derby.diag.TransactionTable() t
+on l.xid = t.xid where l.tableType <> 'S' and t.type='UserTransaction';
+0 rows inserted/updated/deleted
+ij> --on l.xid = t.xid where l.tableType <> 'S' or l.tableType is null
+-- order by
+--     tabname, type desc, mode, cnt, lockname
+-- lock table with system catalog locks included.
+create view full_lock_table as
+select 
+    cast(username as char(8)) as username,
+    cast(t.type as char(8)) as trantype,
+    cast(l.type as char(8)) as type,
+    cast(lockcount as char(3)) as cnt,
+    mode,
+    cast(tablename as char(12)) as tabname,
+    cast(lockname as char(10)) as lockname,
+    state,
+    status
+from 
+    new org.apache.derby.diag.LockTable() l right outer join new org.apache.derby.diag.TransactionTable() t
+on l.xid = t.xid where l.tableType <> 'S' ;
+0 rows inserted/updated/deleted
+ij> -- lock table with no join.
+create view lock_table2 as
+select 
+    cast(l.xid as char(8)) as xid,
+    cast(l.type as char(8)) as type,
+    cast(lockcount as char(3)) as cnt,
+    mode,
+    cast(tablename as char(12)) as tabname,
+    cast(lockname as char(10)) as lockname,
+    state
+from 
+    new org.apache.derby.diag.LockTable() l  
+where l.tableType <> 'S' ;
+0 rows inserted/updated/deleted
+ij> -- transaction table with no join.
+create view tran_table as
+select 
+    *
+from 
+    new org.apache.derby.diag.TransactionTable() t ;
+0 rows inserted/updated/deleted
+ij> autocommit off;
+ij> create table heap_only (a int);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test insert into empty heap, should just get row lock 
+--------------------------------------------------------------------------------
+insert into heap_only values (1);
+1 row inserted/updated/deleted
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IX  |HEAP_ONLY   |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |HEAP_ONLY   |(1,7)     |GRANT|ACTIVE  
+ij> commit;
+ij> 

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/RowLockBasic.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/RowLockBasic.out?view=auto&rev=109265
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/RowLockBasic.out	Tue Nov 30 16:23:58 2004
@@ -0,0 +1,386 @@
+ij> -- Very basic single user testing of row locking, verify that the right locks
+-- are obtained for simple operations.  This test only looks at table and
+-- row logical locks, it does not verify physical latches or lock ordering.
+-- The basic methodology is:
+--    start transaction
+--    simple operation
+--    print lock table which should match the master
+--    end transation
+-- 
+set isolation to RR;
+0 rows inserted/updated/deleted
+ij> run resource 'createTestProcedures.subsql';
+ij> CREATE FUNCTION  PADSTRING (DATA VARCHAR(32000), LENGTH INTEGER) RETURNS VARCHAR(32000) EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.Formatters.padString' LANGUAGE JAVA PARAMETER STYLE JAVA;
+0 rows inserted/updated/deleted
+ij> CREATE PROCEDURE WAIT_FOR_POST_COMMIT() DYNAMIC RESULT SETS 0 LANGUAGE JAVA EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.T_Access.waitForPostCommitToFinish' PARAMETER STYLE JAVA;
+0 rows inserted/updated/deleted
+ij> run resource 'LockTableQuery.subsql';
+ij> create view lock_table as
+select 
+    cast(username as char(8)) as username,
+    cast(t.type as char(8)) as trantype,
+    cast(l.type as char(8)) as type,
+    cast(lockcount as char(3)) as cnt,
+    mode,
+    cast(tablename as char(12)) as tabname,
+    cast(lockname as char(10)) as lockname,
+    state,
+    status
+from 
+    new org.apache.derby.diag.LockTable() l  right outer join new org.apache.derby.diag.TransactionTable() t
+on l.xid = t.xid where l.tableType <> 'S' and t.type='UserTransaction';
+0 rows inserted/updated/deleted
+ij> --on l.xid = t.xid where l.tableType <> 'S' or l.tableType is null
+-- order by
+--     tabname, type desc, mode, cnt, lockname
+-- lock table with system catalog locks included.
+create view full_lock_table as
+select 
+    cast(username as char(8)) as username,
+    cast(t.type as char(8)) as trantype,
+    cast(l.type as char(8)) as type,
+    cast(lockcount as char(3)) as cnt,
+    mode,
+    cast(tablename as char(12)) as tabname,
+    cast(lockname as char(10)) as lockname,
+    state,
+    status
+from 
+    new org.apache.derby.diag.LockTable() l right outer join new org.apache.derby.diag.TransactionTable() t
+on l.xid = t.xid where l.tableType <> 'S' ;
+0 rows inserted/updated/deleted
+ij> -- lock table with no join.
+create view lock_table2 as
+select 
+    cast(l.xid as char(8)) as xid,
+    cast(l.type as char(8)) as type,
+    cast(lockcount as char(3)) as cnt,
+    mode,
+    cast(tablename as char(12)) as tabname,
+    cast(lockname as char(10)) as lockname,
+    state
+from 
+    new org.apache.derby.diag.LockTable() l  
+where l.tableType <> 'S' ;
+0 rows inserted/updated/deleted
+ij> -- transaction table with no join.
+create view tran_table as
+select 
+    *
+from 
+    new org.apache.derby.diag.TransactionTable() t ;
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', '4096');
+0 rows inserted/updated/deleted
+ij> autocommit off;
+ij> create table a (a int);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test insert into empty heap, should just get row lock on row being inserted
+--------------------------------------------------------------------------------
+insert into a values (1);
+1 row inserted/updated/deleted
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test insert into heap with one row, just get row lock on row being inserted
+--------------------------------------------------------------------------------
+insert into a values (2);
+1 row inserted/updated/deleted
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |3   |X   |*** TRANSIEN|Tablelock |GRANT|ACTIVE  
+ij> commit;
+ij> create table a (a int, b varchar(1000));
+0 rows inserted/updated/deleted
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> commit;
+ij> create index a_idx on a (a, b) ;
+0 rows inserted/updated/deleted
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |4   |S   |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test insert into empty btree, should just get row lock on row being 
+-- inserted and an instant duration lock on "first key in table" row (id 3).
+--------------------------------------------------------------------------------
+insert into a values (1, PADSTRING('a',1000));
+1 row inserted/updated/deleted
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test insert into non-empty btree, should get row lock on row being 
+-- inserted and an instant duration lock on the one before it.
+--------------------------------------------------------------------------------
+insert into a values (2, PADSTRING('b',1000));
+1 row inserted/updated/deleted
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,8)     |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Cause split and check locks that are obtained as part of inserting after
+-- the split.  This causes the code to get a previous lock on a previous page.
+-- 
+-- RESOLVE (mikem) - the row lock on (1,9) is a result of raw store getting
+-- a lock while it tries to fit the row on the original page record id, but
+-- there is not enough room, so it eventually allocates a new page/row and 
+-- locks that one - but the old lock is left around.
+--
+-- btree just before commit:
+-- leftmost leaf: (1,6), (1,7)
+-- next leaf:     (1,8), (2,6)
+--------------------------------------------------------------------------------
+insert into a values (3, PADSTRING('c',1000));
+1 row inserted/updated/deleted
+ij> commit;
+ij> insert into a values (4, PADSTRING('d',1000));
+1 row inserted/updated/deleted
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Cause an insert on a new page that inserts into the 1st slot on the btree
+-- page.
+--
+-- btree just before commit:
+-- leftmost leaf: (1,6), (1,7)
+-- next leaf:     (2,7), (2,6)
+--------------------------------------------------------------------------------
+drop table a;
+0 rows inserted/updated/deleted
+ij> create table a (a int, b varchar(1000));
+0 rows inserted/updated/deleted
+ij> create unique index a_idx on a (a, b) ;
+0 rows inserted/updated/deleted
+ij> insert into a values (1, PADSTRING('a',1000));
+1 row inserted/updated/deleted
+ij> insert into a values (2, PADSTRING('b',1000));
+1 row inserted/updated/deleted
+ij> insert into a values (3, PADSTRING('c',1000));
+1 row inserted/updated/deleted
+ij> insert into a values (4, PADSTRING('d',1000));
+1 row inserted/updated/deleted
+ij> select a from a;
+A          
+-----------
+1          
+2          
+3          
+4          
+ij> delete from a where a = 3;
+1 row inserted/updated/deleted
+ij> select a from a;
+A          
+-----------
+1          
+2          
+4          
+ij> commit;
+ij> insert into a values (3, PADSTRING('c',1000));
+1 row inserted/updated/deleted
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,9)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,7)     |GRANT|ACTIVE  
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> create table a (a int, b char(200));
+0 rows inserted/updated/deleted
+ij> create unique index a_idx on a (a);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 'a');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 'b');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 'c');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 'd');
+1 row inserted/updated/deleted
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Do full covered index scan.
+--------------------------------------------------------------------------------
+select a from a;
+A          
+-----------
+1          
+2          
+3          
+4          
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |S   |A           |Tablelock |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Do single probe into covered index (first key in table).
+--------------------------------------------------------------------------------
+select a from a where a = 1;
+A          
+-----------
+1          
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Do single probe into covered index (last key in table).
+--------------------------------------------------------------------------------
+select a from a where a = 4;
+A          
+-----------
+4          
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,10)    |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Do set of range scans that all return 1 row from covered index.
+--------------------------------------------------------------------------------
+select a from a where a <= 1;
+A          
+-----------
+1          
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,3)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+ij> commit;
+ij> select a from a where a >= 2 and a < 3;
+A          
+-----------
+2          
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+ij> commit;
+ij> select a from a where a > 3;
+A          
+-----------
+4          
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,10)    |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,9)     |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Do range scans that all return 0 row from covered index.
+--------------------------------------------------------------------------------
+select a from a where a < 1;
+A          
+-----------
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,3)     |GRANT|ACTIVE  
+ij> commit;
+ij> select a from a where a > 4;
+A          
+-----------
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,10)    |GRANT|ACTIVE  
+ij> commit;
+ij> select a from a where a > 2 and a < 3;
+A          
+-----------
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Verify that create index does table level locking
+--------------------------------------------------------------------------------
+drop table a;
+0 rows inserted/updated/deleted
+ij> create table a (a int, b char(200));
+0 rows inserted/updated/deleted
+ij> create table b (a int, b char(200));
+0 rows inserted/updated/deleted
+ij> insert into a values (1, 'a');
+1 row inserted/updated/deleted
+ij> insert into a values (2, 'b');
+1 row inserted/updated/deleted
+ij> insert into a values (3, 'c');
+1 row inserted/updated/deleted
+ij> insert into a values (4, 'd');
+1 row inserted/updated/deleted
+ij> commit;
+ij> create unique index a_idx on a (a);
+0 rows inserted/updated/deleted
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |4   |S   |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> commit;
+ij> select a from a;
+A          
+-----------
+1          
+2          
+3          
+4          
+ij> select a from b;
+A          
+-----------
+ij> commit;
+ij> -- clean up
+autocommit on;
+ij> drop index a_idx;
+0 rows inserted/updated/deleted
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> drop table b;
+0 rows inserted/updated/deleted
+ij> 

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/RowLockIso.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/RowLockIso.out?view=auto&rev=109265
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/RowLockIso.out	Tue Nov 30 16:23:58 2004
@@ -0,0 +1,744 @@
+ij> -- Very basic single user testing of row locking, verify that the right locks
+-- are obtained for simple operations.  This test only looks at table and
+-- row logical locks, it does not verify physical latches or lock ordering.
+-- The basic methodology is:
+--    start transaction
+--    simple operation
+--    print lock table which should match the master
+--    end transation
+-- 
+run resource 'createTestProcedures.subsql';
+ij> CREATE FUNCTION  PADSTRING (DATA VARCHAR(32000), LENGTH INTEGER) RETURNS VARCHAR(32000) EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.Formatters.padString' LANGUAGE JAVA PARAMETER STYLE JAVA;
+0 rows inserted/updated/deleted
+ij> CREATE PROCEDURE WAIT_FOR_POST_COMMIT() DYNAMIC RESULT SETS 0 LANGUAGE JAVA EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.T_Access.waitForPostCommitToFinish' PARAMETER STYLE JAVA;
+0 rows inserted/updated/deleted
+ij> run  resource 'LockTableQuery.subsql';
+ij> create view lock_table as
+select 
+    cast(username as char(8)) as username,
+    cast(t.type as char(8)) as trantype,
+    cast(l.type as char(8)) as type,
+    cast(lockcount as char(3)) as cnt,
+    mode,
+    cast(tablename as char(12)) as tabname,
+    cast(lockname as char(10)) as lockname,
+    state,
+    status
+from 
+    new org.apache.derby.diag.LockTable() l  right outer join new org.apache.derby.diag.TransactionTable() t
+on l.xid = t.xid where l.tableType <> 'S' and t.type='UserTransaction';
+0 rows inserted/updated/deleted
+ij> --on l.xid = t.xid where l.tableType <> 'S' or l.tableType is null
+-- order by
+--     tabname, type desc, mode, cnt, lockname
+-- lock table with system catalog locks included.
+create view full_lock_table as
+select 
+    cast(username as char(8)) as username,
+    cast(t.type as char(8)) as trantype,
+    cast(l.type as char(8)) as type,
+    cast(lockcount as char(3)) as cnt,
+    mode,
+    cast(tablename as char(12)) as tabname,
+    cast(lockname as char(10)) as lockname,
+    state,
+    status
+from 
+    new org.apache.derby.diag.LockTable() l right outer join new org.apache.derby.diag.TransactionTable() t
+on l.xid = t.xid where l.tableType <> 'S' ;
+0 rows inserted/updated/deleted
+ij> -- lock table with no join.
+create view lock_table2 as
+select 
+    cast(l.xid as char(8)) as xid,
+    cast(l.type as char(8)) as type,
+    cast(lockcount as char(3)) as cnt,
+    mode,
+    cast(tablename as char(12)) as tabname,
+    cast(lockname as char(10)) as lockname,
+    state
+from 
+    new org.apache.derby.diag.LockTable() l  
+where l.tableType <> 'S' ;
+0 rows inserted/updated/deleted
+ij> -- transaction table with no join.
+create view tran_table as
+select 
+    *
+from 
+    new org.apache.derby.diag.TransactionTable() t ;
+0 rows inserted/updated/deleted
+ij> autocommit off;
+ij> CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', '4096');
+0 rows inserted/updated/deleted
+ij> create table a (a int, b int, c varchar(1900)) ;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> set isolation read committed;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test select from empty heap table
+--------------------------------------------------------------------------------
+select a, b from a;
+A          |B          
+-----------------------
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test select from one row heap table
+--------------------------------------------------------------------------------
+insert into a values (1, -1, PADSTRING('one',1900));
+1 row inserted/updated/deleted
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+ij> commit;
+ij> select a, b from a;
+A          |B          
+-----------------------
+1          |-1         
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test select from two row heap table - this will release one row lock as it
+-- moves to the next one.
+--------------------------------------------------------------------------------
+insert into a values (2, -2, PADSTRING('two',1900));
+1 row inserted/updated/deleted
+ij> commit;
+ij> select a,b from a;
+A          |B          
+-----------------------
+1          |-1         
+2          |-2         
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test select from three row heap table (multiple pages) - this will release 
+-- one row lock as it moves to the next one.
+--------------------------------------------------------------------------------
+insert into a values (3, -3, PADSTRING('two',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (4, -4, PADSTRING('two',1900));
+1 row inserted/updated/deleted
+ij> insert into a values (5, -5, PADSTRING('two',1900));
+1 row inserted/updated/deleted
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |3   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+ij> commit;
+ij> delete from a where a.a = 3;
+1 row inserted/updated/deleted
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(2,6)     |GRANT|ACTIVE  
+ij> commit;
+ij> select a,b from a;
+A          |B          
+-----------------------
+1          |-1         
+2          |-2         
+4          |-4         
+5          |-5         
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full read cursor scan over all the rows in the heap, no group fetch.
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','1');
+0 rows inserted/updated/deleted
+ij> -- RESOLVE: missing row locks
+-- WORKAROUND: creating an index and dropping it 
+-- to force the query 'select a, b from a' to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+ij> drop index ix1;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a, b from a';
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault', '16');
+0 rows inserted/updated/deleted
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          
+-----------------------
+1          |-1         
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          
+-----------------------
+2          |-2         
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          
+-----------------------
+4          |-4         
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          
+-----------------------
+5          |-5         
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+No current row
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+ij> close scan_cursor;
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+ij> commit;
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+ij> CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','16');
+0 rows inserted/updated/deleted
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan over all the rows in the heap, with 2 row group fetch.
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','2');
+0 rows inserted/updated/deleted
+ij> -- RESOLVE: missing row locks
+-- WORKAROUND: creating an index and dropping it 
+-- to force the query 'select a, b from a' to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+ij> drop index ix1;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a, b from a';
+ij> CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','16');
+0 rows inserted/updated/deleted
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          
+-----------------------
+1          |-1         
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          
+-----------------------
+2          |-2         
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          
+-----------------------
+4          |-4         
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          
+-----------------------
+5          |-5         
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+No current row
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+ij> close scan_cursor;
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan over all the rows in the heap, with default group fetch
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b from a';
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          
+-----------------------
+1          |-1         
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          
+-----------------------
+2          |-2         
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          
+-----------------------
+4          |-4         
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          
+-----------------------
+5          |-5         
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+No current row
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+ij> close scan_cursor;
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor for update scan over all the rows in the heap, 
+-- with default group fetch.  Group fetch should be disabled.
+--------------------------------------------------------------------------------
+get cursor scan_cursor as
+    'select a, b from a for update';
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IX  |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          
+-----------------------
+1          |-1         
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          
+-----------------------
+2          |-2         
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(1,8)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          
+-----------------------
+4          |-4         
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(2,7)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          
+-----------------------
+5          |-5         
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |U   |A           |(3,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+No current row
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IX  |A           |Tablelock |GRANT|ACTIVE  
+ij> close scan_cursor;
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IX  |A           |Tablelock |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full read cursor scan on a join over all the rows in the btree, 
+-- 2 row group fetch.
+--------------------------------------------------------------------------------
+drop table a;
+0 rows inserted/updated/deleted
+ij> create table a (a int, b int, c varchar(1900), d int, e varchar(2000)) ;
+0 rows inserted/updated/deleted
+ij> create index a_idx on a (a, b, c) ;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> create table b (a int, b int, c varchar(1900)) ;
+0 rows inserted/updated/deleted
+ij> insert into b values (1, -1, PADSTRING('one',1900));
+1 row inserted/updated/deleted
+ij> insert into b values (2, -2, PADSTRING('two',1900));
+1 row inserted/updated/deleted
+ij> insert into b values (3, -3, PADSTRING('three',1900));
+1 row inserted/updated/deleted
+ij> insert into b values (4, -4, PADSTRING('four',1900));
+1 row inserted/updated/deleted
+ij> insert into b values (5, -5, PADSTRING('five',1900));
+1 row inserted/updated/deleted
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test select from empty index
+--------------------------------------------------------------------------------
+select a, b from a;
+A          |B          
+-----------------------
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test select from one row index'd table
+--------------------------------------------------------------------------------
+insert into a values (5, -5, PADSTRING('five',1900), 5, PADSTRING('negative five',2000));
+1 row inserted/updated/deleted
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(1,7)     |GRANT|ACTIVE  
+ij> commit;
+ij> select a, b from a;
+A          |B          
+-----------------------
+5          |-5         
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test select from two row indexed heap table - this will release one row
+-- lock as it moves to the next one.
+--------------------------------------------------------------------------------
+insert into a values (4, -4, PADSTRING('four',1900), 4, PADSTRING('negative four',2000));
+1 row inserted/updated/deleted
+ij> commit;
+ij> select a,b from a;
+A          |B          
+-----------------------
+4          |-4         
+5          |-5         
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test select from three row indexed heap table (multiple pages) - this will
+-- release one row lock as it moves to the next one.
+--------------------------------------------------------------------------------
+insert into a values (3, -3, PADSTRING('three',1900), 3, PADSTRING('negative three',2000));
+1 row inserted/updated/deleted
+ij> insert into a values (2, -2, PADSTRING('two',1900),   2, PADSTRING('negative two',2000));
+1 row inserted/updated/deleted
+ij> insert into a values (1, -1, PADSTRING('one',1900),   1, PADSTRING('negtive one',2000));
+1 row inserted/updated/deleted
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |6   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(3,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(4,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |X   |A           |(5,6)     |GRANT|ACTIVE  
+ij> commit;
+ij> delete from a where a.a = 3;
+1 row inserted/updated/deleted
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |2   |IX  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |2   |X   |A           |(3,6)     |GRANT|ACTIVE  
+ij> commit;
+ij> select a,b from a;
+A          |B          
+-----------------------
+1          |-1         
+2          |-2         
+4          |-4         
+5          |-5         
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full read cursor scan over all the rows in the indexed heap, 
+-- no group fetch.  This should be a covered index scan (make sure rows come
+-- back in order sorted by index).
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','1');
+0 rows inserted/updated/deleted
+ij> -- RESOLVE: missing row locks
+-- WORKAROUND: creating an index and dropping it 
+-- to force the query 'select a, b from a' to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+ij> drop index ix1;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a, b from a';
+ij> CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','16');
+0 rows inserted/updated/deleted
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          
+-----------------------
+1          |-1         
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(5,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          
+-----------------------
+2          |-2         
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,1)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,6)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          
+-----------------------
+4          |-4         
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(2,6)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          
+-----------------------
+5          |-5         
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(1,7)     |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+No current row
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+ij> close scan_cursor;
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+ij> commit;
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan over all the rows in the index , 2 row group fetch.
+--------------------------------------------------------------------------------
+CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','2');
+0 rows inserted/updated/deleted
+ij> -- RESOLVE: missing row locks
+-- WORKAROUND: creating an index and dropping it 
+-- to force the query 'select a, b from a' to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+ij> drop index ix1;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a, b from a';
+ij> CALL SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.language.bulkFetchDefault','16');
+0 rows inserted/updated/deleted
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          
+-----------------------
+1          |-1         
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          
+-----------------------
+2          |-2         
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(4,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          
+-----------------------
+4          |-4         
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          
+-----------------------
+5          |-5         
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+APP     |UserTran|ROW     |1   |S   |A           |(3,1)     |GRANT|ACTIVE  
+ij> next scan_cursor;
+No current row
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+ij> close scan_cursor;
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test full cursor scan over all the rows in the index, with default group
+-- fetch
+--------------------------------------------------------------------------------
+-- RESOLVE: missing row locks
+-- WORKAROUND: creating an index and dropping it 
+-- to force the query 'select a, b from a' to be recompiled
+create index ix1 on a(a);
+0 rows inserted/updated/deleted
+ij> drop index ix1;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> get cursor scan_cursor as
+    'select a, b from a';
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          
+-----------------------
+1          |-1         
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          
+-----------------------
+2          |-2         
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          
+-----------------------
+4          |-4         
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+A          |B          
+-----------------------
+5          |-5         
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+ij> next scan_cursor;
+No current row
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |IS  |A           |Tablelock |GRANT|ACTIVE  
+ij> close scan_cursor;
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test getting index lock on a drop index - track 1634
+--------------------------------------------------------------------------------
+drop table a;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> create table a (a int);
+0 rows inserted/updated/deleted
+ij> create index a2 on a (a);
+0 rows inserted/updated/deleted
+ij> insert into a values (1);
+1 row inserted/updated/deleted
+ij> commit;
+ij> drop index a2;
+0 rows inserted/updated/deleted
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |X   |*** TRANSIEN|Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |2   |X   |A           |Tablelock |GRANT|ACTIVE  
+ij> commit;
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> 

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/SpaceTable.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/SpaceTable.out?view=auto&rev=109265
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/SpaceTable.out	Tue Nov 30 16:23:58 2004
@@ -0,0 +1,368 @@
+ij> -- testing Space table
+-- unfilled pages column of space table is just a guess, thus it is
+-- not consistent across runs, in particular for indexes, but also for
+-- tables. 
+-- Therefore tests do not report the numunfilledpages column
+run resource 'createTestProcedures.subsql';
+ij> CREATE FUNCTION  PADSTRING (DATA VARCHAR(32000), LENGTH INTEGER) RETURNS VARCHAR(32000) EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.Formatters.padString' LANGUAGE JAVA PARAMETER STYLE JAVA;
+0 rows inserted/updated/deleted
+ij> CREATE PROCEDURE WAIT_FOR_POST_COMMIT() DYNAMIC RESULT SETS 0 LANGUAGE JAVA EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.T_Access.waitForPostCommitToFinish' PARAMETER STYLE JAVA;
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', '4096');
+0 rows inserted/updated/deleted
+ij> create table ideleteu (a varchar(2000), b varchar(2000)) ;
+0 rows inserted/updated/deleted
+ij> insert into ideleteu values (PADSTRING('rrrrrrrrrr',2000), PADSTRING('ssssssssssssssss',2000));
+1 row inserted/updated/deleted
+ij> insert into ideleteu values (PADSTRING('rrrrrrrrrr',2000), PADSTRING('ssssssssssssssss',2000));
+1 row inserted/updated/deleted
+ij> insert into ideleteu values (PADSTRING('rrrrrrrrrr',2000), PADSTRING('ssssssssssssssss',2000));
+1 row inserted/updated/deleted
+ij> insert into ideleteu values (PADSTRING('rrrrrrrrrr',2000), PADSTRING('ssssssssssssssss',2000));
+1 row inserted/updated/deleted
+ij> insert into ideleteu values (PADSTRING('rrrrrrrrrr',2000), PADSTRING('ssssssssssssssss',2000));
+1 row inserted/updated/deleted
+ij> -- This query also tests the SpaceTable class alias
+select conglomeratename, isindex, numallocatedpages, numfreepages, pagesize, estimspacesaving
+	from new org.apache.derby.diag.SpaceTable('IDELETEU') t
+	order by conglomeratename;
+CONGLOMERATENAME                                                                                                                |ISIND&|NUMALLOCATEDPAGES   |NUMFREEPAGES        |PAGESIZE   |ESTIMSPACESAVING    
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+IDELETEU                                                                                                                        |0     |6                   |0                   |4096       |0                   
+ij> delete from ideleteu;
+5 rows inserted/updated/deleted
+ij> CALL WAIT_FOR_POST_COMMIT();
+0 rows inserted/updated/deleted
+ij> select conglomeratename, isindex, numallocatedpages, numfreepages, pagesize, estimspacesaving
+	from new org.apache.derby.diag.SpaceTable('IDELETEU') t
+	order by conglomeratename;
+CONGLOMERATENAME                                                                                                                |ISIND&|NUMALLOCATEDPAGES   |NUMFREEPAGES        |PAGESIZE   |ESTIMSPACESAVING    
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+IDELETEU                                                                                                                        |0     |1                   |5                   |4096       |20480               
+ij> select conglomeratename, isindex, numallocatedpages, numfreepages, pagesize, estimspacesaving
+	from new org.apache.derby.diag.SpaceTable('PLATYPUS') t
+	order by conglomeratename;
+CONGLOMERATENAME                                                                                                                |ISIND&|NUMALLOCATEDPAGES   |NUMFREEPAGES        |PAGESIZE   |ESTIMSPACESAVING    
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ij> create table platypus (a varchar(1000), b varchar(3500), c varchar(400), d varchar(100)) ;
+0 rows inserted/updated/deleted
+ij> create index kookaburra on platypus (a) ;
+0 rows inserted/updated/deleted
+ij> create index echidna on platypus (c) ;
+0 rows inserted/updated/deleted
+ij> create index wallaby on platypus (a,c,d) ;
+0 rows inserted/updated/deleted
+ij> select conglomeratename, isindex, numallocatedpages, numfreepages, pagesize, estimspacesaving
+	from new org.apache.derby.diag.SpaceTable('PLATYPUS') t
+	order by conglomeratename;
+CONGLOMERATENAME                                                                                                                |ISIND&|NUMALLOCATEDPAGES   |NUMFREEPAGES        |PAGESIZE   |ESTIMSPACESAVING    
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ECHIDNA                                                                                                                         |1     |1                   |0                   |4096       |0                   
+KOOKABURRA                                                                                                                      |1     |1                   |0                   |4096       |0                   
+PLATYPUS                                                                                                                        |0     |1                   |0                   |4096       |0                   
+WALLABY                                                                                                                         |1     |1                   |0                   |4096       |0                   
+ij> insert into platypus values (PADSTRING('wwwwwww',1000), PADSTRING('xxx',3500), PADSTRING('yy',400), PADSTRING('zzz',100));
+1 row inserted/updated/deleted
+ij> insert into platypus values (PADSTRING('wwwwwww',1000), PADSTRING('xxx',3500), PADSTRING('yy',400), PADSTRING('zzz',100));
+1 row inserted/updated/deleted
+ij> insert into platypus values (PADSTRING('wwwwwww',1000), PADSTRING('xxx',3500), PADSTRING('yy',400), PADSTRING('zzz',100));
+1 row inserted/updated/deleted
+ij> insert into platypus values (PADSTRING('wwwwwww',1000), PADSTRING('xxx',3500), PADSTRING('yy',400), PADSTRING('zzz',100));
+1 row inserted/updated/deleted
+ij> insert into platypus values (PADSTRING('wwwwwww',1000), PADSTRING('xxx',3500), PADSTRING('yy',400), PADSTRING('zzz',100));
+1 row inserted/updated/deleted
+ij> insert into platypus values (PADSTRING('wwwwwww',1000), PADSTRING('xxx',3500), PADSTRING('yy',400), PADSTRING('zzz',100));
+1 row inserted/updated/deleted
+ij> select conglomeratename, isindex, numallocatedpages, numfreepages, pagesize, estimspacesaving
+	from new org.apache.derby.diag.SpaceTable('PLATYPUS') t
+	order by conglomeratename;
+CONGLOMERATENAME                                                                                                                |ISIND&|NUMALLOCATEDPAGES   |NUMFREEPAGES        |PAGESIZE   |ESTIMSPACESAVING    
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ECHIDNA                                                                                                                         |1     |1                   |0                   |4096       |0                   
+KOOKABURRA                                                                                                                      |1     |4                   |0                   |4096       |0                   
+PLATYPUS                                                                                                                        |0     |13                  |0                   |4096       |0                   
+WALLABY                                                                                                                         |1     |8                   |0                   |4096       |0                   
+ij> insert into platypus values (PADSTRING('wwwwwww',1000), PADSTRING('xxx',3500), PADSTRING('yy',400), PADSTRING('zzz',100));
+1 row inserted/updated/deleted
+ij> insert into platypus values (PADSTRING('wwwwwww',1000), PADSTRING('xxx',3500), PADSTRING('yy',400), PADSTRING('zzz',100));
+1 row inserted/updated/deleted
+ij> insert into platypus values (PADSTRING('wwwwwww',1000), PADSTRING('xxx',3500), PADSTRING('yy',400), PADSTRING('zzz',100));
+1 row inserted/updated/deleted
+ij> insert into platypus values (PADSTRING('wwwwwww',1000), PADSTRING('xxx',3500), PADSTRING('yy',400), PADSTRING('zzz',100));
+1 row inserted/updated/deleted
+ij> select conglomeratename, isindex, numallocatedpages, numfreepages, pagesize, estimspacesaving
+	from new org.apache.derby.diag.SpaceTable('PLATYPUS') t
+	order by conglomeratename;
+CONGLOMERATENAME                                                                                                                |ISIND&|NUMALLOCATEDPAGES   |NUMFREEPAGES        |PAGESIZE   |ESTIMSPACESAVING    
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ECHIDNA                                                                                                                         |1     |3                   |0                   |4096       |0                   
+KOOKABURRA                                                                                                                      |1     |8                   |0                   |4096       |0                   
+PLATYPUS                                                                                                                        |0     |21                  |0                   |4096       |0                   
+WALLABY                                                                                                                         |1     |16                  |0                   |4096       |0                   
+ij> delete from platypus;
+10 rows inserted/updated/deleted
+ij> CALL WAIT_FOR_POST_COMMIT();
+0 rows inserted/updated/deleted
+ij> select conglomeratename, isindex, numallocatedpages, numfreepages, pagesize, estimspacesaving
+	from new org.apache.derby.diag.SpaceTable('PLATYPUS') t
+	order by conglomeratename;
+CONGLOMERATENAME                                                                                                                |ISIND&|NUMALLOCATEDPAGES   |NUMFREEPAGES        |PAGESIZE   |ESTIMSPACESAVING    
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ECHIDNA                                                                                                                         |1     |1                   |2                   |4096       |8192                
+KOOKABURRA                                                                                                                      |1     |1                   |7                   |4096       |28672               
+PLATYPUS                                                                                                                        |0     |1                   |20                  |4096       |81920               
+WALLABY                                                                                                                         |1     |15                  |1                   |4096       |4096                
+ij> select conglomeratename, isindex, numallocatedpages, numfreepages, numunfilledpages, pagesize, estimspacesaving
+	from new org.apache.derby.diag.SpaceTable('NONEXISTING') t
+	order by conglomeratename;
+CONGLOMERATENAME                                                                                                                |ISIND&|NUMALLOCATEDPAGES   |NUMFREEPAGES        |NUMUNFILLEDPAGES    |PAGESIZE   |ESTIMSPACESAVING    
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ij> create table "platypus2" (a varchar(10), b varchar(1500), c varchar(400), d varchar(100)) ;
+0 rows inserted/updated/deleted
+ij> insert into "platypus2" (values (PADSTRING('wwwwwww',10), PADSTRING('xxx',1500), PADSTRING('yy',400), PADSTRING('zzz',100)));
+1 row inserted/updated/deleted
+ij> insert into "platypus2" (values (PADSTRING('wwwwwww',10), PADSTRING('xxx',1500), PADSTRING('yy',400), PADSTRING('zzz',100)));
+1 row inserted/updated/deleted
+ij> insert into "platypus2" (values (PADSTRING('wwwwwww',10), PADSTRING('xxx',1500), PADSTRING('yy',400), PADSTRING('zzz',100)));
+1 row inserted/updated/deleted
+ij> insert into "platypus2" (values (PADSTRING('wwwwwww',10), PADSTRING('xxx',1500), PADSTRING('yy',400), PADSTRING('zzz',100)));
+1 row inserted/updated/deleted
+ij> insert into "platypus2" (values (PADSTRING('wwwwwww',10), PADSTRING('xxx',1500), PADSTRING('yy',400), PADSTRING('zzz',100)));
+1 row inserted/updated/deleted
+ij> insert into "platypus2" (values (PADSTRING('wwwwwww',10), PADSTRING('xxx',1500), PADSTRING('yy',400), PADSTRING('zzz',100)));
+1 row inserted/updated/deleted
+ij> create index kookaburra2 on "platypus2" (a);
+0 rows inserted/updated/deleted
+ij> create index echidna2 on "platypus2" (c);
+0 rows inserted/updated/deleted
+ij> create index wallaby2 on "platypus2" (a,c,d) ;
+0 rows inserted/updated/deleted
+ij> select conglomeratename, isindex, numallocatedpages, numfreepages, pagesize, estimspacesaving
+	from new org.apache.derby.diag.SpaceTable('platypus2') t
+	order by conglomeratename;
+CONGLOMERATENAME                                                                                                                |ISIND&|NUMALLOCATEDPAGES   |NUMFREEPAGES        |PAGESIZE   |ESTIMSPACESAVING    
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ECHIDNA2                                                                                                                        |1     |1                   |0                   |4096       |0                   
+KOOKABURRA2                                                                                                                     |1     |1                   |0                   |4096       |0                   
+WALLABY2                                                                                                                        |1     |1                   |0                   |4096       |0                   
+platypus2                                                                                                                       |0     |6                   |0                   |4096       |0                   
+ij> select conglomeratename, isindex, numallocatedpages, numfreepages, pagesize, estimspacesaving
+    from SYS.SYSSCHEMAS s,
+         SYS.SYSTABLES t,
+         new org.apache.derby.diag.SpaceTable(SCHEMANAME,TABLENAME) v
+    where s.SCHEMAID = t.SCHEMAID
+    and s.SCHEMANAME = 'APP'
+    order by conglomeratename;
+CONGLOMERATENAME                                                                                                                |ISIND&|NUMALLOCATEDPAGES   |NUMFREEPAGES        |PAGESIZE   |ESTIMSPACESAVING    
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ECHIDNA                                                                                                                         |1     |1                   |2                   |4096       |8192                
+ECHIDNA2                                                                                                                        |1     |1                   |0                   |4096       |0                   
+IDELETEU                                                                                                                        |0     |1                   |5                   |4096       |20480               
+KOOKABURRA                                                                                                                      |1     |1                   |7                   |4096       |28672               
+KOOKABURRA2                                                                                                                     |1     |1                   |0                   |4096       |0                   
+PLATYPUS                                                                                                                        |0     |1                   |20                  |4096       |81920               
+WALLABY                                                                                                                         |1     |15                  |1                   |4096       |4096                
+WALLABY2                                                                                                                        |1     |1                   |0                   |4096       |0                   
+platypus2                                                                                                                       |0     |6                   |0                   |4096       |0                   
+ij> drop table platypus;
+0 rows inserted/updated/deleted
+ij> drop table "platypus2";
+0 rows inserted/updated/deleted
+ij> autocommit off;
+ij> drop table foo_int;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'FOO_INT' because it does not exist.
+ij> create table foo_int (a int);
+0 rows inserted/updated/deleted
+ij> drop table foo_char;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'FOO_CHAR' because it does not exist.
+ij> create table foo_char (a char(100)) ;
+0 rows inserted/updated/deleted
+ij> drop table foo_varchar;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'FOO_VARCHAR' because it does not exist.
+ij> create table foo_varchar (a varchar(32000)) ;
+0 rows inserted/updated/deleted
+ij> -- let the foo_longxxx get created at 32K
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', NULL);
+0 rows inserted/updated/deleted
+ij> drop table foo_longvarchar;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'FOO_LONGVARCHAR' because it does not exist.
+ij> create table foo_longvarchar (a long varchar);
+0 rows inserted/updated/deleted
+ij> drop table foo_longvarbinary;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'FOO_LONGVARBINARY' because it does not exist.
+ij> create table foo_longvarbinary (a long varchar for bit data);
+0 rows inserted/updated/deleted
+ij> -- Back to 4K
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', '4096');
+0 rows inserted/updated/deleted
+ij> drop table foo_bit;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'FOO_BIT' because it does not exist.
+ij> create table foo_bit (a CHAR(100) FOR BIT DATA) ;
+0 rows inserted/updated/deleted
+ij> drop table foo_varbinary;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'FOO_VARBINARY' because it does not exist.
+ij> create table foo_varbinary (a VARCHAR(10000) FOR BIT DATA) ;
+0 rows inserted/updated/deleted
+ij> select v.CONGLOMERATENAME, PAGESIZE
+from SYS.SYSSCHEMAS s,
+SYS.SYSTABLES t,
+new org.apache.derby.diag.SpaceTable(SCHEMANAME,TABLENAME) v
+where s.SCHEMAID = t.SCHEMAID and CONGLOMERATENAME in  
+    ('FOO_INT', 'FOO_VARCHAR', 'FOO_CHAR', 'FOO_LONGVARCHAR', 'FOO_VARBINARY', 'FOO_LONGVARBINARY', 'FOO_BIT') order by 1;
+CONGLOMERATENAME                                                                                                                |PAGESIZE   
+--------------------------------------------------------------------------------------------------------------------------------------------
+FOO_BIT                                                                                                                         |4096       
+FOO_CHAR                                                                                                                        |4096       
+FOO_INT                                                                                                                         |4096       
+FOO_LONGVARBINARY                                                                                                               |32768      
+FOO_LONGVARCHAR                                                                                                                 |32768      
+FOO_VARBINARY                                                                                                                   |4096       
+FOO_VARCHAR                                                                                                                     |4096       
+ij> drop table foo_int;
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageReservedSpace','65');
+0 rows inserted/updated/deleted
+ij> create table foo_int (a int);
+0 rows inserted/updated/deleted
+ij> drop table foo_char;
+0 rows inserted/updated/deleted
+ij> create table foo_char (a char(100));
+0 rows inserted/updated/deleted
+ij> drop table foo_varchar;
+0 rows inserted/updated/deleted
+ij> create table foo_varchar (a varchar(10000));
+0 rows inserted/updated/deleted
+ij> -- let the foo_longxxx get created at 32K
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', NULL);
+0 rows inserted/updated/deleted
+ij> drop table foo_longvarchar;
+0 rows inserted/updated/deleted
+ij> create table foo_longvarchar (a long varchar) ;
+0 rows inserted/updated/deleted
+ij> drop table foo_longvarbinary;
+0 rows inserted/updated/deleted
+ij> create table foo_longvarbinary (a long varchar for bit data) ;
+0 rows inserted/updated/deleted
+ij> -- Back to 4K
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', '4096');
+0 rows inserted/updated/deleted
+ij> drop table foo_bit;
+0 rows inserted/updated/deleted
+ij> create table foo_bit (a CHAR(100) FOR BIT DATA ) ;
+0 rows inserted/updated/deleted
+ij> drop table foo_varbinary;
+0 rows inserted/updated/deleted
+ij> create table foo_varbinary (a VARCHAR(10000) FOR BIT DATA) ;
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageReservedSpace',NULL);
+0 rows inserted/updated/deleted
+ij> select v.CONGLOMERATENAME, PAGESIZE
+from SYS.SYSSCHEMAS s,
+SYS.SYSTABLES t,
+new org.apache.derby.diag.SpaceTable(SCHEMANAME,TABLENAME) v
+where s.SCHEMAID = t.SCHEMAID and CONGLOMERATENAME in  
+    ('FOO_INT', 'FOO_VARCHAR', 'FOO_CHAR', 'FOO_LONGVARCHAR', 'FOO_VARBINARY', 'FOO_LONGVARBINARY', 'FOO_BIT') order by 1;
+CONGLOMERATENAME                                                                                                                |PAGESIZE   
+--------------------------------------------------------------------------------------------------------------------------------------------
+FOO_BIT                                                                                                                         |4096       
+FOO_CHAR                                                                                                                        |4096       
+FOO_INT                                                                                                                         |4096       
+FOO_LONGVARBINARY                                                                                                               |32768      
+FOO_LONGVARCHAR                                                                                                                 |32768      
+FOO_VARBINARY                                                                                                                   |4096       
+FOO_VARCHAR                                                                                                                     |4096       
+ij> --  8K pagesize 
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', '8192');
+0 rows inserted/updated/deleted
+ij> drop table foo_int;
+0 rows inserted/updated/deleted
+ij> create table foo_int (a int);
+0 rows inserted/updated/deleted
+ij> drop table foo_char;
+0 rows inserted/updated/deleted
+ij> create table foo_char (a char(100));
+0 rows inserted/updated/deleted
+ij> drop table foo_varchar;
+0 rows inserted/updated/deleted
+ij> create table foo_varchar (a varchar(10000));
+0 rows inserted/updated/deleted
+ij> drop table foo_longvarchar;
+0 rows inserted/updated/deleted
+ij> create table foo_longvarchar (a long varchar);
+0 rows inserted/updated/deleted
+ij> drop table foo_bit;
+0 rows inserted/updated/deleted
+ij> create table foo_bit (a CHAR(100) FOR BIT DATA);
+0 rows inserted/updated/deleted
+ij> drop table foo_varbinary;
+0 rows inserted/updated/deleted
+ij> create table foo_varbinary (a varchar(10000) FOR BIT DATA);
+0 rows inserted/updated/deleted
+ij> drop table foo_longvarbinary;
+0 rows inserted/updated/deleted
+ij> create table foo_longvarbinary (a long varchar for bit data);
+0 rows inserted/updated/deleted
+ij> select v.CONGLOMERATENAME, PAGESIZE
+from SYS.SYSSCHEMAS s,
+SYS.SYSTABLES t,
+new org.apache.derby.diag.SpaceTable(SCHEMANAME,TABLENAME) v
+where s.SCHEMAID = t.SCHEMAID and CONGLOMERATENAME in  
+    ('FOO_INT', 'FOO_VARCHAR', 'FOO_CHAR', 'FOO_LONGVARCHAR', 'FOO_VARBINARY', 'FOO_LONGVARBINARY', 'FOO_BIT') order by 1;
+CONGLOMERATENAME                                                                                                                |PAGESIZE   
+--------------------------------------------------------------------------------------------------------------------------------------------
+FOO_BIT                                                                                                                         |8192       
+FOO_CHAR                                                                                                                        |8192       
+FOO_INT                                                                                                                         |8192       
+FOO_LONGVARBINARY                                                                                                               |8192       
+FOO_LONGVARCHAR                                                                                                                 |8192       
+FOO_VARBINARY                                                                                                                   |8192       
+FOO_VARCHAR                                                                                                                     |8192       
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', '4096');
+0 rows inserted/updated/deleted
+ij> commit;
+ij> drop table foo_int;
+0 rows inserted/updated/deleted
+ij> create table foo_int (a int);
+0 rows inserted/updated/deleted
+ij> drop table foo_char;
+0 rows inserted/updated/deleted
+ij> create table foo_char (a char(100)) ;
+0 rows inserted/updated/deleted
+ij> drop table foo_varchar;
+0 rows inserted/updated/deleted
+ij> create table foo_varchar (a varchar(10000));
+0 rows inserted/updated/deleted
+ij> drop table foo_longvarchar;
+0 rows inserted/updated/deleted
+ij> create table foo_longvarchar (a long varchar);
+0 rows inserted/updated/deleted
+ij> drop table foo_bit;
+0 rows inserted/updated/deleted
+ij> create table foo_bit (a CHAR(100) for bit data);
+0 rows inserted/updated/deleted
+ij> drop table foo_varbinary;
+0 rows inserted/updated/deleted
+ij> create table foo_varbinary (a varchar(10000) for bit data);
+0 rows inserted/updated/deleted
+ij> drop table foo_longvarbinary;
+0 rows inserted/updated/deleted
+ij> create table foo_longvarbinary (a long varchar for bit data);
+0 rows inserted/updated/deleted
+ij> select v.CONGLOMERATENAME, PAGESIZE
+from SYS.SYSSCHEMAS s,
+SYS.SYSTABLES t,
+new org.apache.derby.diag.SpaceTable(SCHEMANAME,TABLENAME) v
+where s.SCHEMAID = t.SCHEMAID and CONGLOMERATENAME in  
+    ('FOO_INT', 'FOO_VARCHAR', 'FOO_CHAR', 'FOO_LONGVARCHAR', 'FOO_VARBINARY', 'FOO_LONGVARBINARY', 'FOO_BIT') order by 1;
+CONGLOMERATENAME                                                                                                                |PAGESIZE   
+--------------------------------------------------------------------------------------------------------------------------------------------
+FOO_BIT                                                                                                                         |4096       
+FOO_CHAR                                                                                                                        |4096       
+FOO_INT                                                                                                                         |4096       
+FOO_LONGVARBINARY                                                                                                               |4096       
+FOO_LONGVARCHAR                                                                                                                 |4096       
+FOO_VARBINARY                                                                                                                   |4096       
+FOO_VARCHAR                                                                                                                     |4096       
+ij> commit;
+ij> disconnect;
+ij> 

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/TableLockBasic.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/TableLockBasic.out?view=auto&rev=109265
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/TableLockBasic.out	Tue Nov 30 16:23:58 2004
@@ -0,0 +1,582 @@
+ij> set isolation to RR;
+0 rows inserted/updated/deleted
+ij> run resource 'TableLockBasic.subsql';
+ij> -- Very basic single user testing of table locking, verify that the right locks
+-- are obtained for simple operations.  This test only looks at table and
+-- row logical locks, it does not verify physical latches or lock ordering.
+--
+-- The basic methodology is:
+--    start transaction
+--    simple operation
+--    print lock table which should match the master
+--    end transation
+-- 
+run resource 'createTestProcedures.subsql';
+ij> CREATE FUNCTION  PADSTRING (DATA VARCHAR(32000), LENGTH INTEGER) RETURNS VARCHAR(32000) EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.Formatters.padString' LANGUAGE JAVA PARAMETER STYLE JAVA;
+0 rows inserted/updated/deleted
+ij> CREATE PROCEDURE WAIT_FOR_POST_COMMIT() DYNAMIC RESULT SETS 0 LANGUAGE JAVA EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.T_Access.waitForPostCommitToFinish' PARAMETER STYLE JAVA;
+0 rows inserted/updated/deleted
+ij> run resource 'LockTableQuery.subsql';
+ij> create view lock_table as
+select 
+    cast(username as char(8)) as username,
+    cast(t.type as char(8)) as trantype,
+    cast(l.type as char(8)) as type,
+    cast(lockcount as char(3)) as cnt,
+    mode,
+    cast(tablename as char(12)) as tabname,
+    cast(lockname as char(10)) as lockname,
+    state,
+    status
+from 
+    new org.apache.derby.diag.LockTable() l  right outer join new org.apache.derby.diag.TransactionTable() t
+on l.xid = t.xid where l.tableType <> 'S' and t.type='UserTransaction';
+0 rows inserted/updated/deleted
+ij> --on l.xid = t.xid where l.tableType <> 'S' or l.tableType is null
+-- order by
+--     tabname, type desc, mode, cnt, lockname
+-- lock table with system catalog locks included.
+create view full_lock_table as
+select 
+    cast(username as char(8)) as username,
+    cast(t.type as char(8)) as trantype,
+    cast(l.type as char(8)) as type,
+    cast(lockcount as char(3)) as cnt,
+    mode,
+    cast(tablename as char(12)) as tabname,
+    cast(lockname as char(10)) as lockname,
+    state,
+    status
+from 
+    new org.apache.derby.diag.LockTable() l right outer join new org.apache.derby.diag.TransactionTable() t
+on l.xid = t.xid where l.tableType <> 'S' ;
+0 rows inserted/updated/deleted
+ij> -- lock table with no join.
+create view lock_table2 as
+select 
+    cast(l.xid as char(8)) as xid,
+    cast(l.type as char(8)) as type,
+    cast(lockcount as char(3)) as cnt,
+    mode,
+    cast(tablename as char(12)) as tabname,
+    cast(lockname as char(10)) as lockname,
+    state
+from 
+    new org.apache.derby.diag.LockTable() l  
+where l.tableType <> 'S' ;
+0 rows inserted/updated/deleted
+ij> -- transaction table with no join.
+create view tran_table as
+select 
+    *
+from 
+    new org.apache.derby.diag.TransactionTable() t ;
+0 rows inserted/updated/deleted
+ij> autocommit off;
+ij> create table heap_only (a int);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test insert into empty heap, should just get table lock 
+--------------------------------------------------------------------------------
+insert into heap_only values (1);
+1 row inserted/updated/deleted
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |X   |HEAP_ONLY   |Tablelock |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test insert into heap with one row, just get table lock 
+--------------------------------------------------------------------------------
+insert into heap_only values (2);
+1 row inserted/updated/deleted
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |X   |HEAP_ONLY   |Tablelock |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test select from a heap, should get shared table lock.
+--------------------------------------------------------------------------------
+select a from heap_only where a = 1;
+A          
+-----------
+1          
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |S   |HEAP_ONLY   |Tablelock |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test delete from a heap, should get exclusive table lock.
+--------------------------------------------------------------------------------
+delete from heap_only where a = 1;
+1 row inserted/updated/deleted
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |2   |X   |HEAP_ONLY   |Tablelock |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test update to heap, should get exclusive table lock.
+--------------------------------------------------------------------------------
+update heap_only set a = 1000 where a = 2;
+1 row inserted/updated/deleted
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |2   |X   |HEAP_ONLY   |Tablelock |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test drop of heap, should get exclusive table lock.
+--------------------------------------------------------------------------------
+drop table heap_only;
+0 rows inserted/updated/deleted
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |3   |X   |*** TRANSIEN|Tablelock |GRANT|ACTIVE  
+ij> commit;
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', '4096');
+0 rows inserted/updated/deleted
+ij> create table indexed_heap (a int, b varchar(1000));
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', NULL);
+0 rows inserted/updated/deleted
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |X   |INDEXED_HEAP|Tablelock |GRANT|ACTIVE  
+ij> commit;
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', '4096');
+0 rows inserted/updated/deleted
+ij> create index a_idx on indexed_heap (a, b);
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', NULL);
+0 rows inserted/updated/deleted
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |4   |S   |INDEXED_HEAP|Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |INDEXED_HEAP|Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |1   |X   |INDEXED_HEAP|Tablelock |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test insert into indexed heap, should just get table lock 
+--------------------------------------------------------------------------------
+insert into indexed_heap (a) values (1);
+1 row inserted/updated/deleted
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |2   |X   |INDEXED_HEAP|Tablelock |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test insert into indexed heap with one row, just get table lock 
+--------------------------------------------------------------------------------
+insert into indexed_heap (a) values (2);
+1 row inserted/updated/deleted
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |2   |X   |INDEXED_HEAP|Tablelock |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test select from a indexed heap, should get shared table lock.
+--------------------------------------------------------------------------------
+select a from indexed_heap where a = 1;
+A          
+-----------
+1          
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |S   |INDEXED_HEAP|Tablelock |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test delete from a indexed heap, should get exclusive table lock.
+--------------------------------------------------------------------------------
+delete from indexed_heap where a = 1;
+1 row inserted/updated/deleted
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |2   |X   |INDEXED_HEAP|Tablelock |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test update to indexed heap, should get exclusive table lock.
+--------------------------------------------------------------------------------
+update indexed_heap set a = 1000 where a = 2;
+1 row inserted/updated/deleted
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |4   |X   |INDEXED_HEAP|Tablelock |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test drop of indexed heap, should get exclusive table lock.
+--------------------------------------------------------------------------------
+drop table indexed_heap;
+0 rows inserted/updated/deleted
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |X   |*** TRANSIEN|Tablelock |GRANT|ACTIVE  
+APP     |UserTran|TABLE   |4   |X   |*** TRANSIEN|Tablelock |GRANT|ACTIVE  
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test LOCK TABLE statement
+--------------------------------------------------------------------------------
+create table t1(c1 int);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> prepare p1 as 'lock table t1 in exclusive mode';
+ij> execute p1;
+0 rows inserted/updated/deleted
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |X   |T1          |Tablelock |GRANT|ACTIVE  
+ij> -- verify that statement gets recompiled correctly
+drop table t1;
+0 rows inserted/updated/deleted
+ij> create table t1(c1 int);
+0 rows inserted/updated/deleted
+ij> execute p1;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> lock table t1 in share mode;
+0 rows inserted/updated/deleted
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+APP     |UserTran|TABLE   |1   |S   |T1          |Tablelock |GRANT|ACTIVE  
+ij> drop table t1;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> -- verify that lock table not allowed in sys schema
+lock table sys.systables in exclusive mode;
+ERROR 42X62: 'LOCK TABLE' is not allowed in the 'SYS' schema.
+ij> select * from lock_table order by tabname, type desc, mode, cnt, lockname;
+USERNAME|TRANTYPE|TYPE    |CNT |MODE|TABNAME     |LOCKNAME  |STATE|STATUS  
+---------------------------------------------------------------------------
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test RTS output when table locking configured
+--------------------------------------------------------------------------------
+call SYSCS_UTIL.SYSCS_SET_RUNTIMESTATISTICS(1);
+0 rows inserted/updated/deleted
+ij> maximumdisplaywidth 2000;
+ij> create table rts(c1 int);
+0 rows inserted/updated/deleted
+ij> insert into rts values 1;
+1 row inserted/updated/deleted
+ij> commit;
+ij> select * from rts with cs;
+C1         
+-----------
+1          
+ij> values SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS();
+1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+Statement Name: 
+	null
+Statement Text: 
+	select * from rts with cs
+Parse Time: 0
+Bind Time: 0
+Optimize Time: 0
+Generate Time: 0
+Compile Time: 0
+Execute Time: 0
+Begin Compilation Timestamp : null
+End Compilation Timestamp : null
+Begin Execution Timestamp : null
+End Execution Timestamp : null
+Statement Execution Plan Text: 
+Table Scan ResultSet for RTS at read committed isolation level using instantaneous share row locking chosen by the optimizer (Actual locking used: table level locking.)
+Number of opens = 1
+Rows seen = 1
+Rows filtered = 0
+Fetch Size = 16
+	constructor time (milliseconds) = 0
+	open time (milliseconds) = 0
+	next time (milliseconds) = 0
+	close time (milliseconds) = 0
+	next time in milliseconds/row = 0
+scan information: 
+	Bit set of columns fetched=All
+	Number of columns fetched=1
+	Number of pages visited=1
+	Number of rows qualified=1
+	Number of rows visited=1
+	Scan type=heap
+	start position: 
+null	stop position: 
+null	qualifiers:
+None
+ij> drop table rts;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> --------------------------------------------------------------------------------
+-- Test DDL TABLE LOCK MODE
+--------------------------------------------------------------------------------
+create table default_granularity(c1 int);
+0 rows inserted/updated/deleted
+ij> create table row_granularity(c1 int);
+0 rows inserted/updated/deleted
+ij> alter table row_granularity locksize row;
+0 rows inserted/updated/deleted
+ij> create table table_granularity(c1 int);
+0 rows inserted/updated/deleted
+ij> alter table table_granularity locksize table;
+0 rows inserted/updated/deleted
+ij> select * from default_granularity with cs;
+C1         
+-----------
+ij> values SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS();
+1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+Statement Name: 
+	null
+Statement Text: 
+	select * from default_granularity with cs
+Parse Time: 0
+Bind Time: 0
+Optimize Time: 0
+Generate Time: 0
+Compile Time: 0
+Execute Time: 0
+Begin Compilation Timestamp : null
+End Compilation Timestamp : null
+Begin Execution Timestamp : null
+End Execution Timestamp : null
+Statement Execution Plan Text: 
+Table Scan ResultSet for DEFAULT_GRANULARITY at read committed isolation level using instantaneous share row locking chosen by the optimizer (Actual locking used: table level locking.)
+Number of opens = 1
+Rows seen = 0
+Rows filtered = 0
+Fetch Size = 16
+	constructor time (milliseconds) = 0
+	open time (milliseconds) = 0
+	next time (milliseconds) = 0
+	close time (milliseconds) = 0
+scan information: 
+	Bit set of columns fetched=All
+	Number of columns fetched=1
+	Number of pages visited=1
+	Number of rows qualified=0
+	Number of rows visited=0
+	Scan type=heap
+	start position: 
+null	stop position: 
+null	qualifiers:
+None
+ij> select * from default_granularity with rr;
+C1         
+-----------
+ij> values SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS();
+1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+Statement Name: 
+	null
+Statement Text: 
+	select * from default_granularity with rr
+Parse Time: 0
+Bind Time: 0
+Optimize Time: 0
+Generate Time: 0
+Compile Time: 0
+Execute Time: 0
+Begin Compilation Timestamp : null
+End Compilation Timestamp : null
+Begin Execution Timestamp : null
+End Execution Timestamp : null
+Statement Execution Plan Text: 
+Table Scan ResultSet for DEFAULT_GRANULARITY at serializable isolation level using share table locking chosen by the optimizer
+Number of opens = 1
+Rows seen = 0
+Rows filtered = 0
+Fetch Size = 16
+	constructor time (milliseconds) = 0
+	open time (milliseconds) = 0
+	next time (milliseconds) = 0
+	close time (milliseconds) = 0
+scan information: 
+	Bit set of columns fetched=All
+	Number of columns fetched=1
+	Number of pages visited=1
+	Number of rows qualified=0
+	Number of rows visited=0
+	Scan type=heap
+	start position: 
+null	stop position: 
+null	qualifiers:
+None
+ij> select * from row_granularity with cs;
+C1         
+-----------
+ij> values SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS();
+1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+Statement Name: 
+	null
+Statement Text: 
+	select * from row_granularity with cs
+Parse Time: 0
+Bind Time: 0
+Optimize Time: 0
+Generate Time: 0
+Compile Time: 0
+Execute Time: 0
+Begin Compilation Timestamp : null
+End Compilation Timestamp : null
+Begin Execution Timestamp : null
+End Execution Timestamp : null
+Statement Execution Plan Text: 
+Table Scan ResultSet for ROW_GRANULARITY at read committed isolation level using instantaneous share row locking chosen by the optimizer (Actual locking used: table level locking.)
+Number of opens = 1
+Rows seen = 0
+Rows filtered = 0
+Fetch Size = 16
+	constructor time (milliseconds) = 0
+	open time (milliseconds) = 0
+	next time (milliseconds) = 0
+	close time (milliseconds) = 0
+scan information: 
+	Bit set of columns fetched=All
+	Number of columns fetched=1
+	Number of pages visited=1
+	Number of rows qualified=0
+	Number of rows visited=0
+	Scan type=heap
+	start position: 
+null	stop position: 
+null	qualifiers:
+None
+ij> select * from row_granularity with rr;
+C1         
+-----------
+ij> values SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS();
+1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+Statement Name: 
+	null
+Statement Text: 
+	select * from row_granularity with rr
+Parse Time: 0
+Bind Time: 0
+Optimize Time: 0
+Generate Time: 0
+Compile Time: 0
+Execute Time: 0
+Begin Compilation Timestamp : null
+End Compilation Timestamp : null
+Begin Execution Timestamp : null
+End Execution Timestamp : null
+Statement Execution Plan Text: 
+Table Scan ResultSet for ROW_GRANULARITY at serializable isolation level using share table locking chosen by the optimizer
+Number of opens = 1
+Rows seen = 0
+Rows filtered = 0
+Fetch Size = 16
+	constructor time (milliseconds) = 0
+	open time (milliseconds) = 0
+	next time (milliseconds) = 0
+	close time (milliseconds) = 0
+scan information: 
+	Bit set of columns fetched=All
+	Number of columns fetched=1
+	Number of pages visited=1
+	Number of rows qualified=0
+	Number of rows visited=0
+	Scan type=heap
+	start position: 
+null	stop position: 
+null	qualifiers:
+None
+ij> select * from table_granularity with cs;
+C1         
+-----------
+ij> values SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS();
+1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+Statement Name: 
+	null
+Statement Text: 
+	select * from table_granularity with cs
+Parse Time: 0
+Bind Time: 0
+Optimize Time: 0
+Generate Time: 0
+Compile Time: 0
+Execute Time: 0
+Begin Compilation Timestamp : null
+End Compilation Timestamp : null
+Begin Execution Timestamp : null
+End Execution Timestamp : null
+Statement Execution Plan Text: 
+Table Scan ResultSet for TABLE_GRANULARITY at read committed isolation level using instantaneous share table locking chosen by the optimizer
+Number of opens = 1
+Rows seen = 0
+Rows filtered = 0
+Fetch Size = 16
+	constructor time (milliseconds) = 0
+	open time (milliseconds) = 0
+	next time (milliseconds) = 0
+	close time (milliseconds) = 0
+scan information: 
+	Bit set of columns fetched=All
+	Number of columns fetched=1
+	Number of pages visited=1
+	Number of rows qualified=0
+	Number of rows visited=0
+	Scan type=heap
+	start position: 
+null	stop position: 
+null	qualifiers:
+None
+ij> select * from table_granularity with rr;
+C1         
+-----------
+ij> values SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS();
+1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+Statement Name: 
+	null
+Statement Text: 
+	select * from table_granularity with rr
+Parse Time: 0
+Bind Time: 0
+Optimize Time: 0
+Generate Time: 0
+Compile Time: 0
+Execute Time: 0
+Begin Compilation Timestamp : null
+End Compilation Timestamp : null
+Begin Execution Timestamp : null
+End Execution Timestamp : null
+Statement Execution Plan Text: 
+Table Scan ResultSet for TABLE_GRANULARITY at serializable isolation level using share table locking chosen by the optimizer
+Number of opens = 1
+Rows seen = 0
+Rows filtered = 0
+Fetch Size = 16
+	constructor time (milliseconds) = 0
+	open time (milliseconds) = 0
+	next time (milliseconds) = 0
+	close time (milliseconds) = 0
+scan information: 
+	Bit set of columns fetched=All
+	Number of columns fetched=1
+	Number of pages visited=1
+	Number of rows qualified=0
+	Number of rows visited=0
+	Scan type=heap
+	start position: 
+null	stop position: 
+null	qualifiers:
+None
+ij> rollback;
+ij> 

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/TransactionTable.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/TransactionTable.out?view=auto&rev=109265
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/TransactionTable.out	Tue Nov 30 16:23:58 2004
@@ -0,0 +1,238 @@
+ij> -- testing Transaction table
+maximumdisplaywidth 9000;
+ij> connect 'wombat' as c1;
+ij(C1)> set isolation to rr;
+0 rows inserted/updated/deleted
+ij(C1)> create view xactTable as
+select username, type, status, 
+case when first_instant is NULL then 'readonly' else 'not readonly' end as readOnly, cast(sql_text as varchar(512)) sql_text
+	from new org.apache.derby.diag.TransactionTable() t
+    where type != 'InternalTransaction';
+0 rows inserted/updated/deleted
+ij(C1)> commit;
+ij(C1)> select * from xactTable order by username, sql_text, status, type;
+USERNAME                                                                                                                        |TYPE                          |STATUS  |READONLY    |SQL_TEXT                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+APP                                                                                                                             |UserTransaction               |IDLE    |readonly    |select * from xactTable order by username, sql_text, status, type                                                                                                                                                                                                                                                                                                                                                                                                                                                               
+APP                                                                                                                             |UserTransaction               |IDLE    |readonly    |NULL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
+ij(C1)> create table foo (a int);
+0 rows inserted/updated/deleted
+ij(C1)> create index fooi on foo (a);
+0 rows inserted/updated/deleted
+ij(C1)> select * from xactTable order by username, sql_text, status, type;
+USERNAME                                                                                                                        |TYPE                          |STATUS  |READONLY    |SQL_TEXT                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+APP                                                                                                                             |UserTransaction               |IDLE    |readonly    |select * from xactTable order by username, sql_text, status, type                                                                                                                                                                                                                                                                                                                                                                                                                                                               
+APP                                                                                                                             |UserTransaction               |IDLE    |readonly    |NULL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
+ij(C1)> autocommit off;
+ij(C1)> select * from foo;
+A          
+-----------
+ij(C1)> select * from xactTable order by username, sql_text, status, type;
+USERNAME                                                                                                                        |TYPE                          |STATUS  |READONLY    |SQL_TEXT                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+APP                                                                                                                             |UserTransaction               |ACTIVE  |readonly    |select * from xactTable order by username, sql_text, status, type                                                                                                                                                                                                                                                                                                                                                                                                                                                               
+APP                                                                                                                             |UserTransaction               |IDLE    |readonly    |NULL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
+ij(C1)> select type, lockcount as cnt, mode, tablename, lockname, state 
+	from new org.apache.derby.diag.LockTable() t
+	where tableType <> 'S'  
+	order by lockname, mode, cnt, state;
+TYPE |CNT  |MODE|TABLENAME                                                                                                                       |LOCKNAME            |STATE
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+TABLE|1    |S   |FOO                                                                                                                             |Tablelock           |GRANT
+ij(C1)> commit;
+ij(C1)> select * from xactTable order by username, sql_text, status, type;
+USERNAME                                                                                                                        |TYPE                          |STATUS  |READONLY    |SQL_TEXT                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+APP                                                                                                                             |UserTransaction               |IDLE    |readonly    |select * from xactTable order by username, sql_text, status, type                                                                                                                                                                                                                                                                                                                                                                                                                                                               
+APP                                                                                                                             |UserTransaction               |IDLE    |readonly    |NULL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
+ij(C1)> select type, lockcount as cnt, mode, tablename, lockname, state 
+	from new org.apache.derby.diag.LockTable() t ;
+TYPE |CNT  |MODE|TABLENAME                                                                                                                       |LOCKNAME            |STATE
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ij(C1)> insert into foo values (1), (3), (5), (7), (9);
+5 rows inserted/updated/deleted
+ij(C1)> select * from xactTable order by username, sql_text, status, type;
+USERNAME                                                                                                                        |TYPE                          |STATUS  |READONLY    |SQL_TEXT                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+APP                                                                                                                             |UserTransaction               |ACTIVE  |not readonly|select * from xactTable order by username, sql_text, status, type                                                                                                                                                                                                                                                                                                                                                                                                                                                               
+APP                                                                                                                             |UserTransaction               |IDLE    |readonly    |NULL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
+ij(C1)> select type, lockcount as cnt, mode, tablename, lockname, state 
+	from new org.apache.derby.diag.LockTable() t
+	where tableType <> 'S' 
+	order by lockname, mode, cnt, state;
+TYPE |CNT  |MODE|TABLENAME                                                                                                                       |LOCKNAME            |STATE
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ROW  |1    |X   |FOO                                                                                                                             |(1,10)              |GRANT
+ROW  |1    |X   |FOO                                                                                                                             |(1,11)              |GRANT
+ROW  |1    |X   |FOO                                                                                                                             |(1,7)               |GRANT
+ROW  |1    |X   |FOO                                                                                                                             |(1,8)               |GRANT
+ROW  |1    |X   |FOO                                                                                                                             |(1,9)               |GRANT
+TABLE|2    |IX  |FOO                                                                                                                             |Tablelock           |GRANT
+ij(C1)> commit;
+ij(C1)> select * from xactTable order by username, sql_text, status, type;
+USERNAME                                                                                                                        |TYPE                          |STATUS  |READONLY    |SQL_TEXT                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+APP                                                                                                                             |UserTransaction               |IDLE    |readonly    |select * from xactTable order by username, sql_text, status, type                                                                                                                                                                                                                                                                                                                                                                                                                                                               
+APP                                                                                                                             |UserTransaction               |IDLE    |readonly    |NULL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
+ij(C1)> select type, lockcount as cnt, mode, tablename, lockname, state 
+	from new org.apache.derby.diag.LockTable() t;
+TYPE |CNT  |MODE|TABLENAME                                                                                                                       |LOCKNAME            |STATE
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ij(C1)> insert into foo values (6), (10);
+2 rows inserted/updated/deleted
+ij(C1)> -- make another connection
+connect 'wombat' as c2;
+ij(C2)> set isolation to rr;
+0 rows inserted/updated/deleted
+ij(C2)> autocommit off;
+ij(C2)> select * from xactTable	order by username, sql_text, status, type;
+USERNAME                                                                                                                        |TYPE                          |STATUS  |READONLY    |SQL_TEXT                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+APP                                                                                                                             |UserTransaction               |IDLE    |readonly    |select * from xactTable	order by username, sql_text, status, type                                                                                                                                                                                                                                                                                                                                                                                                                                                               
+APP                                                                                                                             |UserTransaction               |ACTIVE  |not readonly|NULL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
+APP                                                                                                                             |UserTransaction               |IDLE    |readonly    |NULL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
+ij(C2)> select type, lockcount as cnt, mode, tablename, lockname, state 
+	from new org.apache.derby.diag.LockTable() t 
+	where tableType <> 'S' 
+	order by lockname, mode, cnt, state;
+TYPE |CNT  |MODE|TABLENAME                                                                                                                       |LOCKNAME            |STATE
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ROW  |1    |X   |FOO                                                                                                                             |(1,12)              |GRANT
+ROW  |1    |X   |FOO                                                                                                                             |(1,13)              |GRANT
+TABLE|2    |IX  |FOO                                                                                                                             |Tablelock           |GRANT
+ij(C2)> -- make sure class alias works
+select * from xactTable	order by username, sql_text, status, type;
+USERNAME                                                                                                                        |TYPE                          |STATUS  |READONLY    |SQL_TEXT                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+APP                                                                                                                             |UserTransaction               |ACTIVE  |readonly    |-- make sure class alias works
+select * from xactTable	order by username, sql_text, status, type                                                                                                                                                                                                                                                                                                                                                                                                                               
+APP                                                                                                                             |UserTransaction               |ACTIVE  |not readonly|NULL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
+APP                                                                                                                             |UserTransaction               |IDLE    |readonly    |NULL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
+ij(C2)> select type, lockcount as cnt, mode, tablename, lockname, state 
+	from new org.apache.derby.diag.LockTable() t
+	where tableType <> 'S' 
+	order by lockname, mode, cnt, state;
+TYPE |CNT  |MODE|TABLENAME                                                                                                                       |LOCKNAME            |STATE
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ROW  |1    |X   |FOO                                                                                                                             |(1,12)              |GRANT
+ROW  |1    |X   |FOO                                                                                                                             |(1,13)              |GRANT
+TABLE|2    |IX  |FOO                                                                                                                             |Tablelock           |GRANT
+ij(C2)> autocommit off;
+ij(C2)> select * from foo where a < 2;
+A          
+-----------
+1          
+ij(C2)> select * from xactTable	order by username, sql_text, status, type;
+USERNAME                                                                                                                        |TYPE                          |STATUS  |READONLY    |SQL_TEXT                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+APP                                                                                                                             |UserTransaction               |ACTIVE  |readonly    |select * from xactTable	order by username, sql_text, status, type                                                                                                                                                                                                                                                                                                                                                                                                                                                               
+APP                                                                                                                             |UserTransaction               |ACTIVE  |not readonly|NULL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
+APP                                                                                                                             |UserTransaction               |IDLE    |readonly    |NULL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
+ij(C2)> select type, lockcount as cnt, mode, tablename, lockname, state 
+	from new org.apache.derby.diag.LockTable() t
+	where tableType <> 'S' 
+	order by lockname, mode, cnt, state;
+TYPE |CNT  |MODE|TABLENAME                                                                                                                       |LOCKNAME            |STATE
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ROW  |1    |X   |FOO                                                                                                                             |(1,12)              |GRANT
+ROW  |1    |X   |FOO                                                                                                                             |(1,13)              |GRANT
+ROW  |1    |S   |FOO                                                                                                                             |(1,3)               |GRANT
+ROW  |1    |S   |FOO                                                                                                                             |(1,7)               |GRANT
+TABLE|1    |IS  |FOO                                                                                                                             |Tablelock           |GRANT
+TABLE|2    |IX  |FOO                                                                                                                             |Tablelock           |GRANT
+ij(C2)> insert into foo values (2), (4);
+2 rows inserted/updated/deleted
+ij(C2)> select * from xactTable	order by username, sql_text, status, type;
+USERNAME                                                                                                                        |TYPE                          |STATUS  |READONLY    |SQL_TEXT                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+APP                                                                                                                             |UserTransaction               |ACTIVE  |not readonly|select * from xactTable	order by username, sql_text, status, type                                                                                                                                                                                                                                                                                                                                                                                                                                                               
+APP                                                                                                                             |UserTransaction               |ACTIVE  |not readonly|NULL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
+APP                                                                                                                             |UserTransaction               |IDLE    |readonly    |NULL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
+ij(C2)> select type, lockcount as cnt, mode, tablename, lockname, state 
+	from new org.apache.derby.diag.LockTable() t
+	where tableType <> 'S' 
+	order by lockname, mode, cnt, state;
+TYPE |CNT  |MODE|TABLENAME                                                                                                                       |LOCKNAME            |STATE
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ROW  |1    |X   |FOO                                                                                                                             |(1,12)              |GRANT
+ROW  |1    |X   |FOO                                                                                                                             |(1,13)              |GRANT
+ROW  |1    |X   |FOO                                                                                                                             |(1,14)              |GRANT
+ROW  |1    |X   |FOO                                                                                                                             |(1,15)              |GRANT
+ROW  |1    |S   |FOO                                                                                                                             |(1,3)               |GRANT
+ROW  |1    |S   |FOO                                                                                                                             |(1,7)               |GRANT
+TABLE|1    |IS  |FOO                                                                                                                             |Tablelock           |GRANT
+TABLE|2    |IX  |FOO                                                                                                                             |Tablelock           |GRANT
+TABLE|2    |IX  |FOO                                                                                                                             |Tablelock           |GRANT
+ij(C2)> -- this should block and result in a timeout
+select * from foo;
+ERROR 40XL1: A lock could not be obtained within the time requested
+ij(C2)> -- when this finished rolling back, this transaction should be IDLE
+select * from xactTable	order by username, sql_text, status, type;
+USERNAME                                                                                                                        |TYPE                          |STATUS  |READONLY    |SQL_TEXT                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+APP                                                                                                                             |UserTransaction               |IDLE    |readonly    |-- when this finished rolling back, this transaction should be IDLE
+select * from xactTable	order by username, sql_text, status, type                                                                                                                                                                                                                                                                                                                                                                                          
+APP                                                                                                                             |UserTransaction               |ACTIVE  |not readonly|NULL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
+APP                                                                                                                             |UserTransaction               |IDLE    |readonly    |NULL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
+ij(C2)> select type, lockcount as cnt, mode, tablename, lockname, state 
+	from new org.apache.derby.diag.LockTable() t
+	where tableType <> 'S' 
+	order by lockname, mode, cnt, state;
+TYPE |CNT  |MODE|TABLENAME                                                                                                                       |LOCKNAME            |STATE
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ROW  |1    |X   |FOO                                                                                                                             |(1,12)              |GRANT
+ROW  |1    |X   |FOO                                                                                                                             |(1,13)              |GRANT
+TABLE|2    |IX  |FOO                                                                                                                             |Tablelock           |GRANT
+ij(C2)> -- this should also block
+drop table foo;
+ERROR 40XL1: A lock could not be obtained within the time requested
+ij(C2)> select * from xactTable	order by username, sql_text, status, type;
+USERNAME                                                                                                                        |TYPE                          |STATUS  |READONLY    |SQL_TEXT                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+APP                                                                                                                             |UserTransaction               |IDLE    |readonly    |select * from xactTable	order by username, sql_text, status, type                                                                                                                                                                                                                                                                                                                                                                                                                                                               
+APP                                                                                                                             |UserTransaction               |ACTIVE  |not readonly|NULL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
+APP                                                                                                                             |UserTransaction               |IDLE    |readonly    |NULL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
+ij(C2)> select type, lockcount as cnt, mode, tablename, lockname, state 
+	from new org.apache.derby.diag.LockTable() t
+	where tableType <> 'S' 
+	order by lockname, mode, cnt, state;
+TYPE |CNT  |MODE|TABLENAME                                                                                                                       |LOCKNAME            |STATE
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ROW  |1    |X   |FOO                                                                                                                             |(1,12)              |GRANT
+ROW  |1    |X   |FOO                                                                                                                             |(1,13)              |GRANT
+TABLE|2    |IX  |FOO                                                                                                                             |Tablelock           |GRANT
+ij(C2)> commit;
+ij(C2)> disconnect;
+ij> set connection c1;
+ij(C1)> select * from xactTable	order by username, sql_text, status, type;
+USERNAME                                                                                                                        |TYPE                          |STATUS  |READONLY    |SQL_TEXT                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+APP                                                                                                                             |UserTransaction               |ACTIVE  |not readonly|select * from xactTable	order by username, sql_text, status, type                                                                                                                                                                                                                                                                                                                                                                                                                                                               
+APP                                                                                                                             |UserTransaction               |IDLE    |readonly    |NULL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
+ij(C1)> select type, lockcount as cnt, mode, tablename, lockname, state 
+	from new org.apache.derby.diag.LockTable() t
+	where tableType <> 'S'
+	order by lockname, mode, cnt, state;
+TYPE |CNT  |MODE|TABLENAME                                                                                                                       |LOCKNAME            |STATE
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ROW  |1    |X   |FOO                                                                                                                             |(1,12)              |GRANT
+ROW  |1    |X   |FOO                                                                                                                             |(1,13)              |GRANT
+TABLE|2    |IX  |FOO                                                                                                                             |Tablelock           |GRANT
+ij(C1)> drop table foo;
+0 rows inserted/updated/deleted
+ij(C1)> commit;
+ij(C1)> select * from xactTable	order by username, sql_text, status, type;
+USERNAME                                                                                                                        |TYPE                          |STATUS  |READONLY    |SQL_TEXT                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+APP                                                                                                                             |UserTransaction               |IDLE    |readonly    |select * from xactTable	order by username, sql_text, status, type                                                                                                                                                                                                                                                                                                                                                                                                                                                               
+APP                                                                                                                             |UserTransaction               |IDLE    |readonly    |NULL                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
+ij(C1)> select l.type, lockcount as cnt, mode, tablename, lockname, state 
+	from   new org.apache.derby.diag.LockTable() l right outer join new org.apache.derby.diag.TransactionTable() t
+       on l.xid = t.xid where l.tableType <> 'S' and t.type='UserTransaction'
+	order by lockname, mode, cnt, state;
+TYPE |CNT  |MODE|TABLENAME                                                                                                                       |LOCKNAME            |STATE
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ij(C1)> commit;
+ij(C1)> disconnect;
+ij> 

Added: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/access.out
Url: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/access.out?view=auto&rev=109265
==============================================================================
--- (empty file)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/access.out	Tue Nov 30 16:23:58 2004
@@ -0,0 +1,5170 @@
+ij> set isolation to RR;
+0 rows inserted/updated/deleted
+ij> run resource 'createTestProcedures.subsql';
+ij> CREATE FUNCTION  PADSTRING (DATA VARCHAR(32000), LENGTH INTEGER) RETURNS VARCHAR(32000) EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.Formatters.padString' LANGUAGE JAVA PARAMETER STYLE JAVA;
+0 rows inserted/updated/deleted
+ij> CREATE PROCEDURE WAIT_FOR_POST_COMMIT() DYNAMIC RESULT SETS 0 LANGUAGE JAVA EXTERNAL NAME 'org.apache.derbyTesting.functionTests.util.T_Access.waitForPostCommitToFinish' PARAMETER STYLE JAVA;
+0 rows inserted/updated/deleted
+ij> -- by default, holdability of ResultSet objects created using this Connection object is true. Following will set it to false for this connection.
+NoHoldForConnection;
+ij> autocommit off;
+ij> --------------------------------------------------------------------------
+-- test qualifier skip code on fields with length having the 8th bit set in low
+-- order length byte.
+--------------------------------------------------------------------------
+drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', '32768');
+0 rows inserted/updated/deleted
+ij> create table a
+    (
+        i1      int,
+        col00   varchar(384),
+        col01   varchar(390),
+        i2      int
+    );
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', NULL);
+0 rows inserted/updated/deleted
+ij> insert into a values (1, PADSTRING('10',384), PADSTRING('100',390), 1000);
+1 row inserted/updated/deleted
+ij> insert into a values (2, PADSTRING('20',384), PADSTRING('200',390), 2000);
+1 row inserted/updated/deleted
+ij> insert into a values (3, PADSTRING('30',384), PADSTRING('300',390), 3000);
+1 row inserted/updated/deleted
+ij> select i1, i2 from a where i2 = 3000;
+I1         |I2         
+-----------------------
+3          |3000       
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> -- test case for track 2590
+--    The problem was that the btree split would self deadlock while trying
+--    to reclaim rows during the split.  Fixed by just giving up if btree 
+--    can't get the locks during the reclaim try.
+create table foo (a int, b varchar(900), c int);
+0 rows inserted/updated/deleted
+ij> insert into foo values (1, PADSTRING('1',900), 1);
+1 row inserted/updated/deleted
+ij> insert into foo values (2, PADSTRING('2',900), 1);
+1 row inserted/updated/deleted
+ij> insert into foo values (3, PADSTRING('3',900), 1);
+1 row inserted/updated/deleted
+ij> insert into foo values (4, PADSTRING('4',900), 1);
+1 row inserted/updated/deleted
+ij> insert into foo values (5, PADSTRING('5',900), 1);
+1 row inserted/updated/deleted
+ij> insert into foo values (6, PADSTRING('6',900), 1);
+1 row inserted/updated/deleted
+ij> insert into foo values (7, PADSTRING('7',900), 1);
+1 row inserted/updated/deleted
+ij> insert into foo values (8, PADSTRING('8',900), 1);
+1 row inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', '4096');
+0 rows inserted/updated/deleted
+ij> create index foox on foo (a, b);
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', NULL);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> delete from foo where foo.a <> 2;
+7 rows inserted/updated/deleted
+ij> -- Test full cursor for update scan over all the rows in the heap, 
+-- with default group fetch.  Group fetch should be disabled.
+--------------------------------------------------------------------------------
+-- force index until optimizer fixes problem where it does not pick index.
+get cursor scan_cursor as
+    'select a, b, c from foo for update of c';
+ij> next scan_cursor;
+A          |B                                                                                                                               |C          
+--------------------------------------------------------------------------------------------------------------------------------------------------------
+2          |2                                                                                                                              &|1          
+ij> -- these inserts would cause a lock wait timeout before the bug fix.
+insert into foo values (1, PADSTRING('11',900), 1);
+1 row inserted/updated/deleted
+ij> insert into foo values (1, PADSTRING('12',900), 1);
+1 row inserted/updated/deleted
+ij> insert into foo values (1, PADSTRING('13',900), 1);
+1 row inserted/updated/deleted
+ij> insert into foo values (1, PADSTRING('14',900), 1);
+1 row inserted/updated/deleted
+ij> insert into foo values (1, PADSTRING('15',900), 1);
+1 row inserted/updated/deleted
+ij> commit;
+ij> drop table foo;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> -- test case for track 735
+--    The problem was that when the level of btree grew, raw store would
+--    incorrectly report that there was not enough space to move all the
+--    rows from the root page to a newly allocated leaf page, so the create
+--    index operation would fail with a message saying that a row was too
+--    big.
+-- create and load a table with values from 1024 down to 1, the reverse order
+-- is important to reproduce the bug.
+create table foo (a int);
+0 rows inserted/updated/deleted
+ij> insert into foo values (1024);
+1 row inserted/updated/deleted
+ij> insert into foo (select foo.a - 1   from foo);
+1 row inserted/updated/deleted
+ij> insert into foo (select foo.a - 2   from foo);
+2 rows inserted/updated/deleted
+ij> insert into foo (select foo.a - 4   from foo);
+4 rows inserted/updated/deleted
+ij> insert into foo (select foo.a - 8   from foo);
+8 rows inserted/updated/deleted
+ij> insert into foo (select foo.a - 16  from foo);
+16 rows inserted/updated/deleted
+ij> insert into foo (select foo.a - 32  from foo);
+32 rows inserted/updated/deleted
+ij> insert into foo (select foo.a - 64  from foo);
+64 rows inserted/updated/deleted
+ij> insert into foo (select foo.a - 128 from foo);
+128 rows inserted/updated/deleted
+ij> insert into foo (select foo.a - 256 from foo);
+256 rows inserted/updated/deleted
+ij> insert into foo (select foo.a - 512 from foo);
+512 rows inserted/updated/deleted
+ij> -- this create index use to fail.
+create index a on foo (a);
+0 rows inserted/updated/deleted
+ij> -- Check the consistency of the indexes
+VALUES SYSCS_UTIL.SYSCS_CHECK_TABLE('APP', 'FOO');
+1          
+-----------
+1          
+ij> -- a delete of the whole table also exercises the index well.
+delete from foo;
+1024 rows inserted/updated/deleted
+ij> drop table foo;
+0 rows inserted/updated/deleted
+ij> -- ----------------------------------------------------------------------------
+-- stress the conglomerate directory.  abort of an alter table will clear
+-- the cache.
+-- ----------------------------------------------------------------------------
+autocommit off;
+ij> create table a (a int);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> alter table a add column c1 int;
+0 rows inserted/updated/deleted
+ij> rollback;
+ij> select * from a;
+A          
+-----------
+ij> drop table a;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> -- ----------------------------------------------------------------------------
+-- test case for partial row runtime statistics.
+-- ----------------------------------------------------------------------------
+create table foo (a int, b int, c int, d int, e int);
+0 rows inserted/updated/deleted
+ij> insert into foo values (1, 2, 3, 4, 5);
+1 row inserted/updated/deleted
+ij> insert into foo values (10, 20, 30, 40, 50);
+1 row inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_SET_RUNTIMESTATISTICS(1);
+0 rows inserted/updated/deleted
+ij> maximumdisplaywidth 2500;
+ij> -- all the columns
+select * from foo;
+A          |B          |C          |D          |E          
+-----------------------------------------------------------
+1          |2          |3          |4          |5          
+10         |20         |30         |40         |50         
+ij> values SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS();
+1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+Statement Name: 
+	null
+Statement Text: 
+	-- all the columns
+select * from foo
+Parse Time: 0
+Bind Time: 0
+Optimize Time: 0
+Generate Time: 0
+Compile Time: 0
+Execute Time: 0
+Begin Compilation Timestamp : null
+End Compilation Timestamp : null
+Begin Execution Timestamp : null
+End Execution Timestamp : null
+Statement Execution Plan Text: 
+Table Scan ResultSet for FOO at serializable isolation level using share table locking chosen by the optimizer
+Number of opens = 1
+Rows seen = 2
+Rows filtered = 0
+Fetch Size = 16
+	constructor time (milliseconds) = 0
+	open time (milliseconds) = 0
+	next time (milliseconds) = 0
+	close time (milliseconds) = 0
+	next time in milliseconds/row = 0
+scan information: 
+	Bit set of columns fetched=All
+	Number of columns fetched=5
+	Number of pages visited=1
+	Number of rows qualified=2
+	Number of rows visited=2
+	Scan type=heap
+	start position: 
+null	stop position: 
+null	qualifiers:
+None
+ij> -- just last column - should be 5 and 50
+select e from foo;
+E          
+-----------
+5          
+50         
+ij> values SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS();
+1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+Statement Name: 
+	null
+Statement Text: 
+	-- just last column - should be 5 and 50
+select e from foo
+Parse Time: 0
+Bind Time: 0
+Optimize Time: 0
+Generate Time: 0
+Compile Time: 0
+Execute Time: 0
+Begin Compilation Timestamp : null
+End Compilation Timestamp : null
+Begin Execution Timestamp : null
+End Execution Timestamp : null
+Statement Execution Plan Text: 
+Table Scan ResultSet for FOO at serializable isolation level using share table locking chosen by the optimizer
+Number of opens = 1
+Rows seen = 2
+Rows filtered = 0
+Fetch Size = 16
+	constructor time (milliseconds) = 0
+	open time (milliseconds) = 0
+	next time (milliseconds) = 0
+	close time (milliseconds) = 0
+	next time in milliseconds/row = 0
+scan information: 
+	Bit set of columns fetched={4}
+	Number of columns fetched=1
+	Number of pages visited=1
+	Number of rows qualified=2
+	Number of rows visited=2
+	Scan type=heap
+	start position: 
+null	stop position: 
+null	qualifiers:
+None
+ij> -- as subset of columns - should be 5,3,1 and 50,30,10
+select e, c, a from foo;
+E          |C          |A          
+-----------------------------------
+5          |3          |1          
+50         |30         |10         
+ij> values SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS();
+1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+Statement Name: 
+	null
+Statement Text: 
+	-- as subset of columns - should be 5,3,1 and 50,30,10
+select e, c, a from foo
+Parse Time: 0
+Bind Time: 0
+Optimize Time: 0
+Generate Time: 0
+Compile Time: 0
+Execute Time: 0
+Begin Compilation Timestamp : null
+End Compilation Timestamp : null
+Begin Execution Timestamp : null
+End Execution Timestamp : null
+Statement Execution Plan Text: 
+Project-Restrict ResultSet (2):
+Number of opens = 1
+Rows seen = 2
+Rows filtered = 0
+restriction = false
+projection = true
+	constructor time (milliseconds) = 0
+	open time (milliseconds) = 0
+	next time (milliseconds) = 0
+	close time (milliseconds) = 0
+	restriction time (milliseconds) = 0
+	projection time (milliseconds) = 0
+Source result set:
+	Table Scan ResultSet for FOO at serializable isolation level using share table locking chosen by the optimizer
+	Number of opens = 1
+	Rows seen = 2
+	Rows filtered = 0
+	Fetch Size = 16
+		constructor time (milliseconds) = 0
+		open time (milliseconds) = 0
+		next time (milliseconds) = 0
+		close time (milliseconds) = 0
+		next time in milliseconds/row = 0
+	scan information: 
+		Bit set of columns fetched={0, 2, 4}
+		Number of columns fetched=3
+		Number of pages visited=1
+		Number of rows qualified=2
+		Number of rows visited=2
+		Scan type=heap
+		start position: 
+null		stop position: 
+null		qualifiers:
+None
+ij> -- as subset of columns, with qualifier in list - should be 5,3,1 and 50,30,10
+select e, c, a from foo where foo.e = 5;
+E          |C          |A          
+-----------------------------------
+5          |3          |1          
+ij> values SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS();
+1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+Statement Name: 
+	null
+Statement Text: 
+	-- as subset of columns, with qualifier in list - should be 5,3,1 and 50,30,10
+select e, c, a from foo where foo.e = 5
+Parse Time: 0
+Bind Time: 0
+Optimize Time: 0
+Generate Time: 0
+Compile Time: 0
+Execute Time: 0
+Begin Compilation Timestamp : null
+End Compilation Timestamp : null
+Begin Execution Timestamp : null
+End Execution Timestamp : null
+Statement Execution Plan Text: 
+Project-Restrict ResultSet (2):
+Number of opens = 1
+Rows seen = 1
+Rows filtered = 0
+restriction = false
+projection = true
+	constructor time (milliseconds) = 0
+	open time (milliseconds) = 0
+	next time (milliseconds) = 0
+	close time (milliseconds) = 0
+	restriction time (milliseconds) = 0
+	projection time (milliseconds) = 0
+Source result set:
+	Table Scan ResultSet for FOO at serializable isolation level using share table locking chosen by the optimizer
+	Number of opens = 1
+	Rows seen = 1
+	Rows filtered = 0
+	Fetch Size = 16
+		constructor time (milliseconds) = 0
+		open time (milliseconds) = 0
+		next time (milliseconds) = 0
+		close time (milliseconds) = 0
+		next time in milliseconds/row = 0
+	scan information: 
+		Bit set of columns fetched={0, 2, 4}
+		Number of columns fetched=3
+		Number of pages visited=1
+		Number of rows qualified=1
+		Number of rows visited=2
+		Scan type=heap
+		start position: 
+null		stop position: 
+null		qualifiers:
+Column[0][0] Id: 4
+Operator: =
+Ordered nulls: false
+Unknown return value: false
+Negate comparison result: false
+ij> -- as subset of columns, with qualifier not in list 
+--   - should be 5,3,1 and 50,30,10
+select e, c, a from foo where foo.b = 20;
+E          |C          |A          
+-----------------------------------
+50         |30         |10         
+ij> values SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS();
+1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+Statement Name: 
+	null
+Statement Text: 
+	-- as subset of columns, with qualifier not in list 
+--   - should be 5,3,1 and 50,30,10
+select e, c, a from foo where foo.b = 20
+Parse Time: 0
+Bind Time: 0
+Optimize Time: 0
+Generate Time: 0
+Compile Time: 0
+Execute Time: 0
+Begin Compilation Timestamp : null
+End Compilation Timestamp : null
+Begin Execution Timestamp : null
+End Execution Timestamp : null
+Statement Execution Plan Text: 
+Project-Restrict ResultSet (2):
+Number of opens = 1
+Rows seen = 1
+Rows filtered = 0
+restriction = false
+projection = true
+	constructor time (milliseconds) = 0
+	open time (milliseconds) = 0
+	next time (milliseconds) = 0
+	close time (milliseconds) = 0
+	restriction time (milliseconds) = 0
+	projection time (milliseconds) = 0
+Source result set:
+	Table Scan ResultSet for FOO at serializable isolation level using share table locking chosen by the optimizer
+	Number of opens = 1
+	Rows seen = 1
+	Rows filtered = 0
+	Fetch Size = 16
+		constructor time (milliseconds) = 0
+		open time (milliseconds) = 0
+		next time (milliseconds) = 0
+		close time (milliseconds) = 0
+		next time in milliseconds/row = 0
+	scan information: 
+		Bit set of columns fetched={0, 1, 2, 4}
+		Number of columns fetched=4
+		Number of pages visited=1
+		Number of rows qualified=1
+		Number of rows visited=2
+		Scan type=heap
+		start position: 
+null		stop position: 
+null		qualifiers:
+Column[0][0] Id: 1
+Operator: =
+Ordered nulls: false
+Unknown return value: false
+Negate comparison result: false
+ij> -- as subset of columns - should be 1,2 and 10,20
+select a, b from foo;
+A          |B          
+-----------------------
+1          |2          
+10         |20         
+ij> values SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS();
+1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+Statement Name: 
+	null
+Statement Text: 
+	-- as subset of columns - should be 1,2 and 10,20
+select a, b from foo
+Parse Time: 0
+Bind Time: 0
+Optimize Time: 0
+Generate Time: 0
+Compile Time: 0
+Execute Time: 0
+Begin Compilation Timestamp : null
+End Compilation Timestamp : null
+Begin Execution Timestamp : null
+End Execution Timestamp : null
+Statement Execution Plan Text: 
+Table Scan ResultSet for FOO at serializable isolation level using share table locking chosen by the optimizer
+Number of opens = 1
+Rows seen = 2
+Rows filtered = 0
+Fetch Size = 16
+	constructor time (milliseconds) = 0
+	open time (milliseconds) = 0
+	next time (milliseconds) = 0
+	close time (milliseconds) = 0
+	next time in milliseconds/row = 0
+scan information: 
+	Bit set of columns fetched={0, 1}
+	Number of columns fetched=2
+	Number of pages visited=1
+	Number of rows qualified=2
+	Number of rows visited=2
+	Scan type=heap
+	start position: 
+null	stop position: 
+null	qualifiers:
+None
+ij> -- now check index scans - force the index just to 
+-- make sure it does an index scan.
+create index foo_cover on foo (e, d, c, b, a);
+0 rows inserted/updated/deleted
+ij> -- all the columns
+select * from foo;
+A          |B          |C          |D          |E          
+-----------------------------------------------------------
+1          |2          |3          |4          |5          
+10         |20         |30         |40         |50         
+ij> values SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS();
+1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+Statement Name: 
+	null
+Statement Text: 
+	-- all the columns
+select * from foo
+Parse Time: 0
+Bind Time: 0
+Optimize Time: 0
+Generate Time: 0
+Compile Time: 0
+Execute Time: 0
+Begin Compilation Timestamp : null
+End Compilation Timestamp : null
+Begin Execution Timestamp : null
+End Execution Timestamp : null
+Statement Execution Plan Text: 
+Project-Restrict ResultSet (2):
+Number of opens = 1
+Rows seen = 2
+Rows filtered = 0
+restriction = false
+projection = true
+	constructor time (milliseconds) = 0
+	open time (milliseconds) = 0
+	next time (milliseconds) = 0
+	close time (milliseconds) = 0
+	restriction time (milliseconds) = 0
+	projection time (milliseconds) = 0
+Source result set:
+	Index Scan ResultSet for FOO using index FOO_COVER at serializable isolation level using share table locking chosen by the optimizer
+	Number of opens = 1
+	Rows seen = 2
+	Rows filtered = 0
+	Fetch Size = 16
+		constructor time (milliseconds) = 0
+		open time (milliseconds) = 0
+		next time (milliseconds) = 0
+		close time (milliseconds) = 0
+		next time in milliseconds/row = 0
+	scan information: 
+		Bit set of columns fetched={0, 1, 2, 3, 4}
+		Number of columns fetched=5
+		Number of deleted rows visited=0
+		Number of pages visited=1
+		Number of rows qualified=2
+		Number of rows visited=2
+		Scan type=btree
+		Tree height=1
+		start position: 
+	None
+		stop position: 
+	None
+		qualifiers:
+None
+ij> -- just last column - should be 5 and 50
+select e from foo;
+E          
+-----------
+5          
+50         
+ij> values SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS();
+1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+Statement Name: 
+	null
+Statement Text: 
+	-- just last column - should be 5 and 50
+select e from foo
+Parse Time: 0
+Bind Time: 0
+Optimize Time: 0
+Generate Time: 0
+Compile Time: 0
+Execute Time: 0
+Begin Compilation Timestamp : null
+End Compilation Timestamp : null
+Begin Execution Timestamp : null
+End Execution Timestamp : null
+Statement Execution Plan Text: 
+Index Scan ResultSet for FOO using index FOO_COVER at serializable isolation level using share table locking chosen by the optimizer
+Number of opens = 1
+Rows seen = 2
+Rows filtered = 0
+Fetch Size = 16
+	constructor time (milliseconds) = 0
+	open time (milliseconds) = 0
+	next time (milliseconds) = 0
+	close time (milliseconds) = 0
+	next time in milliseconds/row = 0
+scan information: 
+	Bit set of columns fetched={0}
+	Number of columns fetched=1
+	Number of deleted rows visited=0
+	Number of pages visited=1
+	Number of rows qualified=2
+	Number of rows visited=2
+	Scan type=btree
+	Tree height=1
+	start position: 
+	None
+	stop position: 
+	None
+	qualifiers:
+None
+ij> -- as subset of columns - should be 5,3,1 and 50,30,10
+select e, c, a from foo;
+E          |C          |A          
+-----------------------------------
+5          |3          |1          
+50         |30         |10         
+ij> values SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS();
+1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+Statement Name: 
+	null
+Statement Text: 
+	-- as subset of columns - should be 5,3,1 and 50,30,10
+select e, c, a from foo
+Parse Time: 0
+Bind Time: 0
+Optimize Time: 0
+Generate Time: 0
+Compile Time: 0
+Execute Time: 0
+Begin Compilation Timestamp : null
+End Compilation Timestamp : null
+Begin Execution Timestamp : null
+End Execution Timestamp : null
+Statement Execution Plan Text: 
+Project-Restrict ResultSet (3):
+Number of opens = 1
+Rows seen = 2
+Rows filtered = 0
+restriction = false
+projection = true
+	constructor time (milliseconds) = 0
+	open time (milliseconds) = 0
+	next time (milliseconds) = 0
+	close time (milliseconds) = 0
+	restriction time (milliseconds) = 0
+	projection time (milliseconds) = 0
+Source result set:
+	Project-Restrict ResultSet (2):
+	Number of opens = 1
+	Rows seen = 2
+	Rows filtered = 0
+	restriction = false
+	projection = true
+		constructor time (milliseconds) = 0
+		open time (milliseconds) = 0
+		next time (milliseconds) = 0
+		close time (milliseconds) = 0
+		restriction time (milliseconds) = 0
+		projection time (milliseconds) = 0
+	Source result set:
+		Index Scan ResultSet for FOO using index FOO_COVER at serializable isolation level using share table locking chosen by the optimizer
+		Number of opens = 1
+		Rows seen = 2
+		Rows filtered = 0
+		Fetch Size = 16
+			constructor time (milliseconds) = 0
+			open time (milliseconds) = 0
+			next time (milliseconds) = 0
+			close time (milliseconds) = 0
+			next time in milliseconds/row = 0
+		scan information: 
+			Bit set of columns fetched={0, 2, 4}
+			Number of columns fetched=3
+			Number of deleted rows visited=0
+			Number of pages visited=1
+			Number of rows qualified=2
+			Number of rows visited=2
+			Scan type=btree
+			Tree height=1
+			start position: 
+	None
+			stop position: 
+	None
+			qualifiers:
+None
+ij> -- as subset of columns, with qualifier in list - should be 5,3,1 and 50, 30, 10
+select e, c, a from foo where foo.e = 5;
+E          |C          |A          
+-----------------------------------
+5          |3          |1          
+ij> values SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS();
+1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+Statement Name: 
+	null
+Statement Text: 
+	-- as subset of columns, with qualifier in list - should be 5,3,1 and 50, 30, 10
+select e, c, a from foo where foo.e = 5
+Parse Time: 0
+Bind Time: 0
+Optimize Time: 0
+Generate Time: 0
+Compile Time: 0
+Execute Time: 0
+Begin Compilation Timestamp : null
+End Compilation Timestamp : null
+Begin Execution Timestamp : null
+End Execution Timestamp : null
+Statement Execution Plan Text: 
+Project-Restrict ResultSet (3):
+Number of opens = 1
+Rows seen = 1
+Rows filtered = 0
+restriction = false
+projection = true
+	constructor time (milliseconds) = 0
+	open time (milliseconds) = 0
+	next time (milliseconds) = 0
+	close time (milliseconds) = 0
+	restriction time (milliseconds) = 0
+	projection time (milliseconds) = 0
+Source result set:
+	Project-Restrict ResultSet (2):
+	Number of opens = 1
+	Rows seen = 1
+	Rows filtered = 0
+	restriction = false
+	projection = true
+		constructor time (milliseconds) = 0
+		open time (milliseconds) = 0
+		next time (milliseconds) = 0
+		close time (milliseconds) = 0
+		restriction time (milliseconds) = 0
+		projection time (milliseconds) = 0
+	Source result set:
+		Index Scan ResultSet for FOO using index FOO_COVER at serializable isolation level using share row locking chosen by the optimizer
+		Number of opens = 1
+		Rows seen = 1
+		Rows filtered = 0
+		Fetch Size = 16
+			constructor time (milliseconds) = 0
+			open time (milliseconds) = 0
+			next time (milliseconds) = 0
+			close time (milliseconds) = 0
+			next time in milliseconds/row = 0
+		scan information: 
+			Bit set of columns fetched={0, 2, 4}
+			Number of columns fetched=3
+			Number of deleted rows visited=0
+			Number of pages visited=1
+			Number of rows qualified=1
+			Number of rows visited=2
+			Scan type=btree
+			Tree height=1
+			start position: 
+	>= on first 1 column(s).
+	Ordered null semantics on the following columns: 
+			stop position: 
+	> on first 1 column(s).
+	Ordered null semantics on the following columns: 
+			qualifiers:
+None
+ij> -- as subset of columns, with qualifier not in list - should be 5,3,1 
+-- and 50, 30, 10
+select e, c, a from foo where foo.b = 20;
+E          |C          |A          
+-----------------------------------
+50         |30         |10         
+ij> values SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS();
+1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+Statement Name: 
+	null
+Statement Text: 
+	-- as subset of columns, with qualifier not in list - should be 5,3,1 
+-- and 50, 30, 10
+select e, c, a from foo where foo.b = 20
+Parse Time: 0
+Bind Time: 0
+Optimize Time: 0
+Generate Time: 0
+Compile Time: 0
+Execute Time: 0
+Begin Compilation Timestamp : null
+End Compilation Timestamp : null
+Begin Execution Timestamp : null
+End Execution Timestamp : null
+Statement Execution Plan Text: 
+Project-Restrict ResultSet (3):
+Number of opens = 1
+Rows seen = 1
+Rows filtered = 0
+restriction = false
+projection = true
+	constructor time (milliseconds) = 0
+	open time (milliseconds) = 0
+	next time (milliseconds) = 0
+	close time (milliseconds) = 0
+	restriction time (milliseconds) = 0
+	projection time (milliseconds) = 0
+Source result set:
+	Project-Restrict ResultSet (2):
+	Number of opens = 1
+	Rows seen = 1
+	Rows filtered = 0
+	restriction = false
+	projection = true
+		constructor time (milliseconds) = 0
+		open time (milliseconds) = 0
+		next time (milliseconds) = 0
+		close time (milliseconds) = 0
+		restriction time (milliseconds) = 0
+		projection time (milliseconds) = 0
+	Source result set:
+		Index Scan ResultSet for FOO using index FOO_COVER at serializable isolation level using share table locking chosen by the optimizer
+		Number of opens = 1
+		Rows seen = 1
+		Rows filtered = 0
+		Fetch Size = 16
+			constructor time (milliseconds) = 0
+			open time (milliseconds) = 0
+			next time (milliseconds) = 0
+			close time (milliseconds) = 0
+			next time in milliseconds/row = 0
+		scan information: 
+			Bit set of columns fetched={0, 2, 3, 4}
+			Number of columns fetched=4
+			Number of deleted rows visited=0
+			Number of pages visited=1
+			Number of rows qualified=1
+			Number of rows visited=2
+			Scan type=btree
+			Tree height=1
+			start position: 
+	None
+			stop position: 
+	None
+			qualifiers:
+Column[0][0] Id: 3
+Operator: =
+Ordered nulls: false
+Unknown return value: false
+Negate comparison result: false
+ij> -- as subset of columns - should be 1,2 and 10, 20
+select a, b from foo;
+A          |B          
+-----------------------
+1          |2          
+10         |20         
+ij> values SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS();
+1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+Statement Name: 
+	null
+Statement Text: 
+	-- as subset of columns - should be 1,2 and 10, 20
+select a, b from foo
+Parse Time: 0
+Bind Time: 0
+Optimize Time: 0
+Generate Time: 0
+Compile Time: 0
+Execute Time: 0
+Begin Compilation Timestamp : null
+End Compilation Timestamp : null
+Begin Execution Timestamp : null
+End Execution Timestamp : null
+Statement Execution Plan Text: 
+Project-Restrict ResultSet (2):
+Number of opens = 1
+Rows seen = 2
+Rows filtered = 0
+restriction = false
+projection = true
+	constructor time (milliseconds) = 0
+	open time (milliseconds) = 0
+	next time (milliseconds) = 0
+	close time (milliseconds) = 0
+	restriction time (milliseconds) = 0
+	projection time (milliseconds) = 0
+Source result set:
+	Index Scan ResultSet for FOO using index FOO_COVER at serializable isolation level using share table locking chosen by the optimizer
+	Number of opens = 1
+	Rows seen = 2
+	Rows filtered = 0
+	Fetch Size = 16
+		constructor time (milliseconds) = 0
+		open time (milliseconds) = 0
+		next time (milliseconds) = 0
+		close time (milliseconds) = 0
+		next time in milliseconds/row = 0
+	scan information: 
+		Bit set of columns fetched={3, 4}
+		Number of columns fetched=2
+		Number of deleted rows visited=0
+		Number of pages visited=1
+		Number of rows qualified=2
+		Number of rows visited=2
+		Scan type=btree
+		Tree height=1
+		start position: 
+	None
+		stop position: 
+	None
+		qualifiers:
+None
+ij> -- check deleted row feature
+insert into foo values (100, 2, 3, 4, 5);
+1 row inserted/updated/deleted
+ij> insert into foo values (1000, 2, 3, 4, 5);
+1 row inserted/updated/deleted
+ij> delete from foo where foo.a = 100;
+1 row inserted/updated/deleted
+ij> delete from foo where foo.a = 1000;
+1 row inserted/updated/deleted
+ij> -- now check with deleted rows involved.
+-- all the columns
+select * from foo;
+A          |B          |C          |D          |E          
+-----------------------------------------------------------
+1          |2          |3          |4          |5          
+10         |20         |30         |40         |50         
+ij> values SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS();
+1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+Statement Name: 
+	null
+Statement Text: 
+	-- now check with deleted rows involved.
+-- all the columns
+select * from foo
+Parse Time: 0
+Bind Time: 0
+Optimize Time: 0
+Generate Time: 0
+Compile Time: 0
+Execute Time: 0
+Begin Compilation Timestamp : null
+End Compilation Timestamp : null
+Begin Execution Timestamp : null
+End Execution Timestamp : null
+Statement Execution Plan Text: 
+Project-Restrict ResultSet (2):
+Number of opens = 1
+Rows seen = 2
+Rows filtered = 0
+restriction = false
+projection = true
+	constructor time (milliseconds) = 0
+	open time (milliseconds) = 0
+	next time (milliseconds) = 0
+	close time (milliseconds) = 0
+	restriction time (milliseconds) = 0
+	projection time (milliseconds) = 0
+Source result set:
+	Index Scan ResultSet for FOO using index FOO_COVER at serializable isolation level using share table locking chosen by the optimizer
+	Number of opens = 1
+	Rows seen = 2
+	Rows filtered = 0
+	Fetch Size = 16
+		constructor time (milliseconds) = 0
+		open time (milliseconds) = 0
+		next time (milliseconds) = 0
+		close time (milliseconds) = 0
+		next time in milliseconds/row = 0
+	scan information: 
+		Bit set of columns fetched={0, 1, 2, 3, 4}
+		Number of columns fetched=5
+		Number of deleted rows visited=2
+		Number of pages visited=1
+		Number of rows qualified=2
+		Number of rows visited=4
+		Scan type=btree
+		Tree height=1
+		start position: 
+	None
+		stop position: 
+	None
+		qualifiers:
+None
+ij> -- just last column - should be 5 and 50
+select e from foo;
+E          
+-----------
+5          
+50         
+ij> values SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS();
+1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+Statement Name: 
+	null
+Statement Text: 
+	-- just last column - should be 5 and 50
+select e from foo
+Parse Time: 0
+Bind Time: 0
+Optimize Time: 0
+Generate Time: 0
+Compile Time: 0
+Execute Time: 0
+Begin Compilation Timestamp : null
+End Compilation Timestamp : null
+Begin Execution Timestamp : null
+End Execution Timestamp : null
+Statement Execution Plan Text: 
+Index Scan ResultSet for FOO using index FOO_COVER at serializable isolation level using share table locking chosen by the optimizer
+Number of opens = 1
+Rows seen = 2
+Rows filtered = 0
+Fetch Size = 16
+	constructor time (milliseconds) = 0
+	open time (milliseconds) = 0
+	next time (milliseconds) = 0
+	close time (milliseconds) = 0
+	next time in milliseconds/row = 0
+scan information: 
+	Bit set of columns fetched={0}
+	Number of columns fetched=1
+	Number of deleted rows visited=2
+	Number of pages visited=1
+	Number of rows qualified=2
+	Number of rows visited=4
+	Scan type=btree
+	Tree height=1
+	start position: 
+	None
+	stop position: 
+	None
+	qualifiers:
+None
+ij> -- as subset of columns - should be 5,3,1 and 50,30,10
+select e, c, a from foo;
+E          |C          |A          
+-----------------------------------
+5          |3          |1          
+50         |30         |10         
+ij> values SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS();
+1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+Statement Name: 
+	null
+Statement Text: 
+	-- as subset of columns - should be 5,3,1 and 50,30,10
+select e, c, a from foo
+Parse Time: 0
+Bind Time: 0
+Optimize Time: 0
+Generate Time: 0
+Compile Time: 0
+Execute Time: 0
+Begin Compilation Timestamp : null
+End Compilation Timestamp : null
+Begin Execution Timestamp : null
+End Execution Timestamp : null
+Statement Execution Plan Text: 
+Project-Restrict ResultSet (3):
+Number of opens = 1
+Rows seen = 2
+Rows filtered = 0
+restriction = false
+projection = true
+	constructor time (milliseconds) = 0
+	open time (milliseconds) = 0
+	next time (milliseconds) = 0
+	close time (milliseconds) = 0
+	restriction time (milliseconds) = 0
+	projection time (milliseconds) = 0
+Source result set:
+	Project-Restrict ResultSet (2):
+	Number of opens = 1
+	Rows seen = 2
+	Rows filtered = 0
+	restriction = false
+	projection = true
+		constructor time (milliseconds) = 0
+		open time (milliseconds) = 0
+		next time (milliseconds) = 0
+		close time (milliseconds) = 0
+		restriction time (milliseconds) = 0
+		projection time (milliseconds) = 0
+	Source result set:
+		Index Scan ResultSet for FOO using index FOO_COVER at serializable isolation level using share table locking chosen by the optimizer
+		Number of opens = 1
+		Rows seen = 2
+		Rows filtered = 0
+		Fetch Size = 16
+			constructor time (milliseconds) = 0
+			open time (milliseconds) = 0
+			next time (milliseconds) = 0
+			close time (milliseconds) = 0
+			next time in milliseconds/row = 0
+		scan information: 
+			Bit set of columns fetched={0, 2, 4}
+			Number of columns fetched=3
+			Number of deleted rows visited=2
+			Number of pages visited=1
+			Number of rows qualified=2
+			Number of rows visited=4
+			Scan type=btree
+			Tree height=1
+			start position: 
+	None
+			stop position: 
+	None
+			qualifiers:
+None
+ij> -- as subset of columns, with qualifier in list - should be 5,3,1 and 50,30,10
+select e, c, a from foo where foo.e = 5;
+E          |C          |A          
+-----------------------------------
+5          |3          |1          
+ij> values SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS();
+1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+Statement Name: 
+	null
+Statement Text: 
+	-- as subset of columns, with qualifier in list - should be 5,3,1 and 50,30,10
+select e, c, a from foo where foo.e = 5
+Parse Time: 0
+Bind Time: 0
+Optimize Time: 0
+Generate Time: 0
+Compile Time: 0
+Execute Time: 0
+Begin Compilation Timestamp : null
+End Compilation Timestamp : null
+Begin Execution Timestamp : null
+End Execution Timestamp : null
+Statement Execution Plan Text: 
+Project-Restrict ResultSet (3):
+Number of opens = 1
+Rows seen = 1
+Rows filtered = 0
+restriction = false
+projection = true
+	constructor time (milliseconds) = 0
+	open time (milliseconds) = 0
+	next time (milliseconds) = 0
+	close time (milliseconds) = 0
+	restriction time (milliseconds) = 0
+	projection time (milliseconds) = 0
+Source result set:
+	Project-Restrict ResultSet (2):
+	Number of opens = 1
+	Rows seen = 1
+	Rows filtered = 0
+	restriction = false
+	projection = true
+		constructor time (milliseconds) = 0
+		open time (milliseconds) = 0
+		next time (milliseconds) = 0
+		close time (milliseconds) = 0
+		restriction time (milliseconds) = 0
+		projection time (milliseconds) = 0
+	Source result set:
+		Index Scan ResultSet for FOO using index FOO_COVER at serializable isolation level using share row locking chosen by the optimizer
+		Number of opens = 1
+		Rows seen = 1
+		Rows filtered = 0
+		Fetch Size = 16
+			constructor time (milliseconds) = 0
+			open time (milliseconds) = 0
+			next time (milliseconds) = 0
+			close time (milliseconds) = 0
+			next time in milliseconds/row = 0
+		scan information: 
+			Bit set of columns fetched={0, 2, 4}
+			Number of columns fetched=3
+			Number of deleted rows visited=2
+			Number of pages visited=1
+			Number of rows qualified=1
+			Number of rows visited=4
+			Scan type=btree
+			Tree height=1
+			start position: 
+	>= on first 1 column(s).
+	Ordered null semantics on the following columns: 
+			stop position: 
+	> on first 1 column(s).
+	Ordered null semantics on the following columns: 
+			qualifiers:
+None
+ij> -- as subset of columns, with qualifier not in list 
+--   - should be 5,3,1 and 50,30,10
+select e, c, a from foo where foo.b = 20;
+E          |C          |A          
+-----------------------------------
+50         |30         |10         
+ij> values SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS();
+1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+Statement Name: 
+	null
+Statement Text: 
+	-- as subset of columns, with qualifier not in list 
+--   - should be 5,3,1 and 50,30,10
+select e, c, a from foo where foo.b = 20
+Parse Time: 0
+Bind Time: 0
+Optimize Time: 0
+Generate Time: 0
+Compile Time: 0
+Execute Time: 0
+Begin Compilation Timestamp : null
+End Compilation Timestamp : null
+Begin Execution Timestamp : null
+End Execution Timestamp : null
+Statement Execution Plan Text: 
+Project-Restrict ResultSet (3):
+Number of opens = 1
+Rows seen = 1
+Rows filtered = 0
+restriction = false
+projection = true
+	constructor time (milliseconds) = 0
+	open time (milliseconds) = 0
+	next time (milliseconds) = 0
+	close time (milliseconds) = 0
+	restriction time (milliseconds) = 0
+	projection time (milliseconds) = 0
+Source result set:
+	Project-Restrict ResultSet (2):
+	Number of opens = 1
+	Rows seen = 1
+	Rows filtered = 0
+	restriction = false
+	projection = true
+		constructor time (milliseconds) = 0
+		open time (milliseconds) = 0
+		next time (milliseconds) = 0
+		close time (milliseconds) = 0
+		restriction time (milliseconds) = 0
+		projection time (milliseconds) = 0
+	Source result set:
+		Index Scan ResultSet for FOO using index FOO_COVER at serializable isolation level using share table locking chosen by the optimizer
+		Number of opens = 1
+		Rows seen = 1
+		Rows filtered = 0
+		Fetch Size = 16
+			constructor time (milliseconds) = 0
+			open time (milliseconds) = 0
+			next time (milliseconds) = 0
+			close time (milliseconds) = 0
+			next time in milliseconds/row = 0
+		scan information: 
+			Bit set of columns fetched={0, 2, 3, 4}
+			Number of columns fetched=4
+			Number of deleted rows visited=2
+			Number of pages visited=1
+			Number of rows qualified=1
+			Number of rows visited=4
+			Scan type=btree
+			Tree height=1
+			start position: 
+	None
+			stop position: 
+	None
+			qualifiers:
+Column[0][0] Id: 3
+Operator: =
+Ordered nulls: false
+Unknown return value: false
+Negate comparison result: false
+ij> -- as subset of columns - should be 1,2 and 10,20
+select a, b from foo;
+A          |B          
+-----------------------
+1          |2          
+10         |20         
+ij> values SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS();
+1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+Statement Name: 
+	null
+Statement Text: 
+	-- as subset of columns - should be 1,2 and 10,20
+select a, b from foo
+Parse Time: 0
+Bind Time: 0
+Optimize Time: 0
+Generate Time: 0
+Compile Time: 0
+Execute Time: 0
+Begin Compilation Timestamp : null
+End Compilation Timestamp : null
+Begin Execution Timestamp : null
+End Execution Timestamp : null
+Statement Execution Plan Text: 
+Project-Restrict ResultSet (2):
+Number of opens = 1
+Rows seen = 2
+Rows filtered = 0
+restriction = false
+projection = true
+	constructor time (milliseconds) = 0
+	open time (milliseconds) = 0
+	next time (milliseconds) = 0
+	close time (milliseconds) = 0
+	restriction time (milliseconds) = 0
+	projection time (milliseconds) = 0
+Source result set:
+	Index Scan ResultSet for FOO using index FOO_COVER at serializable isolation level using share table locking chosen by the optimizer
+	Number of opens = 1
+	Rows seen = 2
+	Rows filtered = 0
+	Fetch Size = 16
+		constructor time (milliseconds) = 0
+		open time (milliseconds) = 0
+		next time (milliseconds) = 0
+		close time (milliseconds) = 0
+		next time in milliseconds/row = 0
+	scan information: 
+		Bit set of columns fetched={3, 4}
+		Number of columns fetched=2
+		Number of deleted rows visited=2
+		Number of pages visited=1
+		Number of rows qualified=2
+		Number of rows visited=4
+		Scan type=btree
+		Tree height=1
+		start position: 
+	None
+		stop position: 
+	None
+		qualifiers:
+None
+ij> -- now check index scans - force the index just to 
+-- make sure it does an index scan.
+create index foo_cover on foo (e, d, c, b, a);
+0 rows inserted/updated/deleted
+WARNING 01504: The new index is a duplicate of an existing index: FOO_COVER.
+ij> -- all the columns
+select * from foo;
+A          |B          |C          |D          |E          
+-----------------------------------------------------------
+1          |2          |3          |4          |5          
+10         |20         |30         |40         |50         
+ij> values SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS();
+1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+Statement Name: 
+	null
+Statement Text: 
+	-- all the columns
+select * from foo
+Parse Time: 0
+Bind Time: 0
+Optimize Time: 0
+Generate Time: 0
+Compile Time: 0
+Execute Time: 0
+Begin Compilation Timestamp : null
+End Compilation Timestamp : null
+Begin Execution Timestamp : null
+End Execution Timestamp : null
+Statement Execution Plan Text: 
+Project-Restrict ResultSet (2):
+Number of opens = 1
+Rows seen = 2
+Rows filtered = 0
+restriction = false
+projection = true
+	constructor time (milliseconds) = 0
+	open time (milliseconds) = 0
+	next time (milliseconds) = 0
+	close time (milliseconds) = 0
+	restriction time (milliseconds) = 0
+	projection time (milliseconds) = 0
+Source result set:
+	Index Scan ResultSet for FOO using index FOO_COVER at serializable isolation level using share table locking chosen by the optimizer
+	Number of opens = 1
+	Rows seen = 2
+	Rows filtered = 0
+	Fetch Size = 16
+		constructor time (milliseconds) = 0
+		open time (milliseconds) = 0
+		next time (milliseconds) = 0
+		close time (milliseconds) = 0
+		next time in milliseconds/row = 0
+	scan information: 
+		Bit set of columns fetched={0, 1, 2, 3, 4}
+		Number of columns fetched=5
+		Number of deleted rows visited=2
+		Number of pages visited=1
+		Number of rows qualified=2
+		Number of rows visited=4
+		Scan type=btree
+		Tree height=1
+		start position: 
+	None
+		stop position: 
+	None
+		qualifiers:
+None
+ij> -- just last column - should be 5 and 50
+select e from foo;
+E          
+-----------
+5          
+50         
+ij> values SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS();
+1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+Statement Name: 
+	null
+Statement Text: 
+	-- just last column - should be 5 and 50
+select e from foo
+Parse Time: 0
+Bind Time: 0
+Optimize Time: 0
+Generate Time: 0
+Compile Time: 0
+Execute Time: 0
+Begin Compilation Timestamp : null
+End Compilation Timestamp : null
+Begin Execution Timestamp : null
+End Execution Timestamp : null
+Statement Execution Plan Text: 
+Index Scan ResultSet for FOO using index FOO_COVER at serializable isolation level using share table locking chosen by the optimizer
+Number of opens = 1
+Rows seen = 2
+Rows filtered = 0
+Fetch Size = 16
+	constructor time (milliseconds) = 0
+	open time (milliseconds) = 0
+	next time (milliseconds) = 0
+	close time (milliseconds) = 0
+	next time in milliseconds/row = 0
+scan information: 
+	Bit set of columns fetched={0}
+	Number of columns fetched=1
+	Number of deleted rows visited=2
+	Number of pages visited=1
+	Number of rows qualified=2
+	Number of rows visited=4
+	Scan type=btree
+	Tree height=1
+	start position: 
+	None
+	stop position: 
+	None
+	qualifiers:
+None
+ij> -- as subset of columns - should be 5,3,1 and 50,30,10
+select e, c, a from foo;
+E          |C          |A          
+-----------------------------------
+5          |3          |1          
+50         |30         |10         
+ij> values SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS();
+1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+Statement Name: 
+	null
+Statement Text: 
+	-- as subset of columns - should be 5,3,1 and 50,30,10
+select e, c, a from foo
+Parse Time: 0
+Bind Time: 0
+Optimize Time: 0
+Generate Time: 0
+Compile Time: 0
+Execute Time: 0
+Begin Compilation Timestamp : null
+End Compilation Timestamp : null
+Begin Execution Timestamp : null
+End Execution Timestamp : null
+Statement Execution Plan Text: 
+Project-Restrict ResultSet (3):
+Number of opens = 1
+Rows seen = 2
+Rows filtered = 0
+restriction = false
+projection = true
+	constructor time (milliseconds) = 0
+	open time (milliseconds) = 0
+	next time (milliseconds) = 0
+	close time (milliseconds) = 0
+	restriction time (milliseconds) = 0
+	projection time (milliseconds) = 0
+Source result set:
+	Project-Restrict ResultSet (2):
+	Number of opens = 1
+	Rows seen = 2
+	Rows filtered = 0
+	restriction = false
+	projection = true
+		constructor time (milliseconds) = 0
+		open time (milliseconds) = 0
+		next time (milliseconds) = 0
+		close time (milliseconds) = 0
+		restriction time (milliseconds) = 0
+		projection time (milliseconds) = 0
+	Source result set:
+		Index Scan ResultSet for FOO using index FOO_COVER at serializable isolation level using share table locking chosen by the optimizer
+		Number of opens = 1
+		Rows seen = 2
+		Rows filtered = 0
+		Fetch Size = 16
+			constructor time (milliseconds) = 0
+			open time (milliseconds) = 0
+			next time (milliseconds) = 0
+			close time (milliseconds) = 0
+			next time in milliseconds/row = 0
+		scan information: 
+			Bit set of columns fetched={0, 2, 4}
+			Number of columns fetched=3
+			Number of deleted rows visited=2
+			Number of pages visited=1
+			Number of rows qualified=2
+			Number of rows visited=4
+			Scan type=btree
+			Tree height=1
+			start position: 
+	None
+			stop position: 
+	None
+			qualifiers:
+None
+ij> -- as subset of columns, with qualifier in list - should be 5,3,1 and 50, 30, 10
+select e, c, a from foo where foo.e = 5;
+E          |C          |A          
+-----------------------------------
+5          |3          |1          
+ij> values SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS();
+1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+Statement Name: 
+	null
+Statement Text: 
+	-- as subset of columns, with qualifier in list - should be 5,3,1 and 50, 30, 10
+select e, c, a from foo where foo.e = 5
+Parse Time: 0
+Bind Time: 0
+Optimize Time: 0
+Generate Time: 0
+Compile Time: 0
+Execute Time: 0
+Begin Compilation Timestamp : null
+End Compilation Timestamp : null
+Begin Execution Timestamp : null
+End Execution Timestamp : null
+Statement Execution Plan Text: 
+Project-Restrict ResultSet (3):
+Number of opens = 1
+Rows seen = 1
+Rows filtered = 0
+restriction = false
+projection = true
+	constructor time (milliseconds) = 0
+	open time (milliseconds) = 0
+	next time (milliseconds) = 0
+	close time (milliseconds) = 0
+	restriction time (milliseconds) = 0
+	projection time (milliseconds) = 0
+Source result set:
+	Project-Restrict ResultSet (2):
+	Number of opens = 1
+	Rows seen = 1
+	Rows filtered = 0
+	restriction = false
+	projection = true
+		constructor time (milliseconds) = 0
+		open time (milliseconds) = 0
+		next time (milliseconds) = 0
+		close time (milliseconds) = 0
+		restriction time (milliseconds) = 0
+		projection time (milliseconds) = 0
+	Source result set:
+		Index Scan ResultSet for FOO using index FOO_COVER at serializable isolation level using share row locking chosen by the optimizer
+		Number of opens = 1
+		Rows seen = 1
+		Rows filtered = 0
+		Fetch Size = 16
+			constructor time (milliseconds) = 0
+			open time (milliseconds) = 0
+			next time (milliseconds) = 0
+			close time (milliseconds) = 0
+			next time in milliseconds/row = 0
+		scan information: 
+			Bit set of columns fetched={0, 2, 4}
+			Number of columns fetched=3
+			Number of deleted rows visited=2
+			Number of pages visited=1
+			Number of rows qualified=1
+			Number of rows visited=4
+			Scan type=btree
+			Tree height=1
+			start position: 
+	>= on first 1 column(s).
+	Ordered null semantics on the following columns: 
+			stop position: 
+	> on first 1 column(s).
+	Ordered null semantics on the following columns: 
+			qualifiers:
+None
+ij> -- as subset of columns, with qualifier not in list - should be 5,3,1 
+-- and 50, 30, 10
+select e, c, a from foo where foo.b = 20;
+E          |C          |A          
+-----------------------------------
+50         |30         |10         
+ij> values SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS();
+1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+Statement Name: 
+	null
+Statement Text: 
+	-- as subset of columns, with qualifier not in list - should be 5,3,1 
+-- and 50, 30, 10
+select e, c, a from foo where foo.b = 20
+Parse Time: 0
+Bind Time: 0
+Optimize Time: 0
+Generate Time: 0
+Compile Time: 0
+Execute Time: 0
+Begin Compilation Timestamp : null
+End Compilation Timestamp : null
+Begin Execution Timestamp : null
+End Execution Timestamp : null
+Statement Execution Plan Text: 
+Project-Restrict ResultSet (3):
+Number of opens = 1
+Rows seen = 1
+Rows filtered = 0
+restriction = false
+projection = true
+	constructor time (milliseconds) = 0
+	open time (milliseconds) = 0
+	next time (milliseconds) = 0
+	close time (milliseconds) = 0
+	restriction time (milliseconds) = 0
+	projection time (milliseconds) = 0
+Source result set:
+	Project-Restrict ResultSet (2):
+	Number of opens = 1
+	Rows seen = 1
+	Rows filtered = 0
+	restriction = false
+	projection = true
+		constructor time (milliseconds) = 0
+		open time (milliseconds) = 0
+		next time (milliseconds) = 0
+		close time (milliseconds) = 0
+		restriction time (milliseconds) = 0
+		projection time (milliseconds) = 0
+	Source result set:
+		Index Scan ResultSet for FOO using index FOO_COVER at serializable isolation level using share table locking chosen by the optimizer
+		Number of opens = 1
+		Rows seen = 1
+		Rows filtered = 0
+		Fetch Size = 16
+			constructor time (milliseconds) = 0
+			open time (milliseconds) = 0
+			next time (milliseconds) = 0
+			close time (milliseconds) = 0
+			next time in milliseconds/row = 0
+		scan information: 
+			Bit set of columns fetched={0, 2, 3, 4}
+			Number of columns fetched=4
+			Number of deleted rows visited=2
+			Number of pages visited=1
+			Number of rows qualified=1
+			Number of rows visited=4
+			Scan type=btree
+			Tree height=1
+			start position: 
+	None
+			stop position: 
+	None
+			qualifiers:
+Column[0][0] Id: 3
+Operator: =
+Ordered nulls: false
+Unknown return value: false
+Negate comparison result: false
+ij> -- as subset of columns - should be 1,2 and 10, 20
+select a, b from foo;
+A          |B          
+-----------------------
+1          |2          
+10         |20         
+ij> values SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS();
+1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+Statement Name: 
+	null
+Statement Text: 
+	-- as subset of columns - should be 1,2 and 10, 20
+select a, b from foo
+Parse Time: 0
+Bind Time: 0
+Optimize Time: 0
+Generate Time: 0
+Compile Time: 0
+Execute Time: 0
+Begin Compilation Timestamp : null
+End Compilation Timestamp : null
+Begin Execution Timestamp : null
+End Execution Timestamp : null
+Statement Execution Plan Text: 
+Project-Restrict ResultSet (2):
+Number of opens = 1
+Rows seen = 2
+Rows filtered = 0
+restriction = false
+projection = true
+	constructor time (milliseconds) = 0
+	open time (milliseconds) = 0
+	next time (milliseconds) = 0
+	close time (milliseconds) = 0
+	restriction time (milliseconds) = 0
+	projection time (milliseconds) = 0
+Source result set:
+	Index Scan ResultSet for FOO using index FOO_COVER at serializable isolation level using share table locking chosen by the optimizer
+	Number of opens = 1
+	Rows seen = 2
+	Rows filtered = 0
+	Fetch Size = 16
+		constructor time (milliseconds) = 0
+		open time (milliseconds) = 0
+		next time (milliseconds) = 0
+		close time (milliseconds) = 0
+		next time in milliseconds/row = 0
+	scan information: 
+		Bit set of columns fetched={3, 4}
+		Number of columns fetched=2
+		Number of deleted rows visited=2
+		Number of pages visited=1
+		Number of rows qualified=2
+		Number of rows visited=4
+		Scan type=btree
+		Tree height=1
+		start position: 
+	None
+		stop position: 
+	None
+		qualifiers:
+None
+ij> -- ----------------------------------------------------------------------------
+-- test case for costing - make sure optimizer picks obvious covered query.
+-- ----------------------------------------------------------------------------
+call SYSCS_UTIL.SYSCS_SET_RUNTIMESTATISTICS(1);
+0 rows inserted/updated/deleted
+ij> maximumdisplaywidth 2000;
+ij> create table base_table (a int, b varchar(1000));
+0 rows inserted/updated/deleted
+ij> insert into base_table values (1,  PADSTRING('1',1000));
+1 row inserted/updated/deleted
+ij> insert into base_table values (2,  PADSTRING('2',1000));
+1 row inserted/updated/deleted
+ij> insert into base_table values (3,  PADSTRING('3',1000));
+1 row inserted/updated/deleted
+ij> insert into base_table values (4,  PADSTRING('4',1000));
+1 row inserted/updated/deleted
+ij> insert into base_table values (5,  PADSTRING('5',1000));
+1 row inserted/updated/deleted
+ij> insert into base_table values (6,  PADSTRING('6',1000));
+1 row inserted/updated/deleted
+ij> insert into base_table values (7,  PADSTRING('7',1000));
+1 row inserted/updated/deleted
+ij> insert into base_table values (8,  PADSTRING('8',1000));
+1 row inserted/updated/deleted
+ij> insert into base_table values (9,  PADSTRING('9',1000));
+1 row inserted/updated/deleted
+ij> insert into base_table values (10, PADSTRING('10',1000));
+1 row inserted/updated/deleted
+ij> create index cover_idx on base_table(a);
+0 rows inserted/updated/deleted
+ij> -- make sure covered index is chosen
+select a from base_table;
+A          
+-----------
+1          
+2          
+3          
+4          
+5          
+6          
+7          
+8          
+9          
+10         
+ij> values SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS();
+1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+Statement Name: 
+	null
+Statement Text: 
+	-- make sure covered index is chosen
+select a from base_table
+Parse Time: 0
+Bind Time: 0
+Optimize Time: 0
+Generate Time: 0
+Compile Time: 0
+Execute Time: 0
+Begin Compilation Timestamp : null
+End Compilation Timestamp : null
+Begin Execution Timestamp : null
+End Execution Timestamp : null
+Statement Execution Plan Text: 
+Index Scan ResultSet for BASE_TABLE using index COVER_IDX at serializable isolation level using share table locking chosen by the optimizer
+Number of opens = 1
+Rows seen = 10
+Rows filtered = 0
+Fetch Size = 16
+	constructor time (milliseconds) = 0
+	open time (milliseconds) = 0
+	next time (milliseconds) = 0
+	close time (milliseconds) = 0
+	next time in milliseconds/row = 0
+scan information: 
+	Bit set of columns fetched={0}
+	Number of columns fetched=1
+	Number of deleted rows visited=0
+	Number of pages visited=1
+	Number of rows qualified=10
+	Number of rows visited=10
+	Scan type=btree
+	Tree height=1
+	start position: 
+	None
+	stop position: 
+	None
+	qualifiers:
+None
+ij> -- ----------------------------------------------------------------------------
+-- test for key too big error message.
+-- ----------------------------------------------------------------------------
+create table d (id int not null, t_bigvarchar varchar(400), unique (id));
+0 rows inserted/updated/deleted
+ij> create index t_bigvarchar_ind on d ( t_bigvarchar);
+0 rows inserted/updated/deleted
+ij> alter table d alter t_bigvarchar set data type varchar(4096);
+0 rows inserted/updated/deleted
+ij> insert into d (id, t_bigvarchar) values (1, 
+'1111111123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567
+89012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012
+34567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567
+89012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012
+34567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567
+89012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012
+34567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567
+89012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012
+34567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567
+89012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012
+34567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567
+89012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012
+34567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567
+89012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012
+34567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567
+89012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012
+34567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567
+89012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012
+34567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567
+89012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012
+34567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567
+89012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012
+34567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567
+89012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012
+34567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567
+89012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012
+34567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567
+890123456789012345678901234567890123456789012345678901234567890123456');
+ERROR XSCB6: Limitation: Record of a btree secondary index cannot be updated or inserted due to lack of space on the page.  Use the parameters derby.storage.pageSize and/or derby.storage.pageReservedSpace to work around this limitation.
+ij> -- ----------------------------------------------------------------------------
+-- test space for update
+-- ----------------------------------------------------------------------------
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', '1024');
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.minimumRecordSize', '1');
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageReservedSpace', '0');
+0 rows inserted/updated/deleted
+ij> create table testing (a varchar(100));
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', NULL);
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.minimumRecordSize', NULL);
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.minimumRecordSize', NULL);
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageReservedSpace', NULL);
+0 rows inserted/updated/deleted
+ij> insert into testing values ('a');
+1 row inserted/updated/deleted
+ij> insert into testing (select testing.a from testing);
+1 row inserted/updated/deleted
+ij> insert into testing (select testing.a from testing);
+2 rows inserted/updated/deleted
+ij> insert into testing (select testing.a from testing);
+4 rows inserted/updated/deleted
+ij> insert into testing (select testing.a from testing);
+8 rows inserted/updated/deleted
+ij> insert into testing (select testing.a from testing);
+16 rows inserted/updated/deleted
+ij> insert into testing (select testing.a from testing);
+32 rows inserted/updated/deleted
+ij> insert into testing (select testing.a from testing);
+64 rows inserted/updated/deleted
+ij> update testing set a = 'abcd' where a = 'a';
+128 rows inserted/updated/deleted
+ij> create index zz on testing (a);
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', '1024');
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.minimumRecordSize', '1');
+0 rows inserted/updated/deleted
+ij> create table t1 (a varchar(100));
+0 rows inserted/updated/deleted
+ij> insert into t1 values ('a');
+1 row inserted/updated/deleted
+ij> insert into t1 (select t1.a from t1);
+1 row inserted/updated/deleted
+ij> insert into t1 (select t1.a from t1);
+2 rows inserted/updated/deleted
+ij> insert into t1 (select t1.a from t1);
+4 rows inserted/updated/deleted
+ij> insert into t1 (select t1.a from t1);
+8 rows inserted/updated/deleted
+ij> insert into t1 (select t1.a from t1);
+16 rows inserted/updated/deleted
+ij> insert into t1 (select t1.a from t1);
+32 rows inserted/updated/deleted
+ij> insert into t1 (select t1.a from t1);
+64 rows inserted/updated/deleted
+ij> update t1 set a = 'abcd' where a = 'a';
+128 rows inserted/updated/deleted
+ij> create index zz1 on t1 (a);
+0 rows inserted/updated/deleted
+ij> -- ----------------------------------------------------------------------------
+-- test load with long columns with index creation
+-- ----------------------------------------------------------------------------
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', '1024');
+0 rows inserted/updated/deleted
+ij> create table long1 (a varchar(32000), b int, c int);
+0 rows inserted/updated/deleted
+ij> insert into long1 values ('this is a long row which will get even longer and longer to force a stream', 1, 2);
+1 row inserted/updated/deleted
+ij> insert into long1 values ('this is another long row which will get even longer and longer to force a stream', 2, 3);
+1 row inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', NULL);
+0 rows inserted/updated/deleted
+ij> update long1 set a = a||a||a||a||a||a;
+2 rows inserted/updated/deleted
+ij> update long1 set a = a||a||a||a||a||a;
+2 rows inserted/updated/deleted
+ij> update long1 set a = a||a;
+2 rows inserted/updated/deleted
+ij> select LENGTH(a) from long1;
+1          
+-----------
+5328       
+5760       
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', '1024');
+0 rows inserted/updated/deleted
+ij> create table long2 (a varchar(16384), b int, c int);
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', NULL);
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', '16384');
+0 rows inserted/updated/deleted
+ij> create index long2i1 on long2 (a);
+0 rows inserted/updated/deleted
+ij> create index long2i2 on long2 (a,b);
+0 rows inserted/updated/deleted
+ij> create index long2i3 on long2 (a,b,c);
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', NULL);
+0 rows inserted/updated/deleted
+ij> insert into long2 select * from long1;
+2 rows inserted/updated/deleted
+ij> select LENGTH(a) from long2;
+1          
+-----------
+5328       
+5760       
+ij> -- DefectId 1346 
+insert into long2 select * from long1;
+2 rows inserted/updated/deleted
+ij> select LENGTH(a) from long2;
+1          
+-----------
+5328       
+5328       
+5760       
+5760       
+ij> delete from long2;
+4 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', '1024');
+0 rows inserted/updated/deleted
+ij> create index long2small on long2 (a, c);
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', NULL);
+0 rows inserted/updated/deleted
+ij> -- this small index should cause the insert to fail
+insert into long2 select * from long1;
+ERROR XSCB6: Limitation: Record of a btree secondary index cannot be updated or inserted due to lack of space on the page.  Use the parameters derby.storage.pageSize and/or derby.storage.pageReservedSpace to work around this limitation.
+ij> -- DefectId 1346 
+-- the small index should cause this insert to also fail
+insert into long2 select * from long1;
+ERROR XSCB6: Limitation: Record of a btree secondary index cannot be updated or inserted due to lack of space on the page.  Use the parameters derby.storage.pageSize and/or derby.storage.pageReservedSpace to work around this limitation.
+ij> select LENGTH(a) from long2;
+1          
+-----------
+ij> --
+-- test case for track 1346
+drop table long1;
+0 rows inserted/updated/deleted
+ij> drop table long2;
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', '1024');
+0 rows inserted/updated/deleted
+ij> create table long1 (a varchar(32000), b int, c int);
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', NULL);
+0 rows inserted/updated/deleted
+ij> insert into long1 values
+	('this is a long row which will get even longer', 1, 2);
+1 row inserted/updated/deleted
+ij> insert into long1 values
+	('a second row that will also grow very long', 2, 3);
+1 row inserted/updated/deleted
+ij> update long1 set a = a||a||a||a||a||a;
+2 rows inserted/updated/deleted
+ij> update long1 set a = a||a||a||a||a||a;
+2 rows inserted/updated/deleted
+ij> update long1 set a = a||a;
+2 rows inserted/updated/deleted
+ij> select LENGTH(a) from long1;
+1          
+-----------
+3240       
+3024       
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', '1024');
+0 rows inserted/updated/deleted
+ij> create table long2 (a varchar(30000), b int, c int);
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', NULL);
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', '16384');
+0 rows inserted/updated/deleted
+ij> create index long2i1 on long2 (a);
+0 rows inserted/updated/deleted
+ij> create index long2i2 on long2 (b, a);
+0 rows inserted/updated/deleted
+ij> create index long2i3 on long2 (b, a, c);
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', NULL);
+0 rows inserted/updated/deleted
+ij> insert into long2 select * from long1;
+2 rows inserted/updated/deleted
+ij> insert into long2 select * from long1;
+2 rows inserted/updated/deleted
+ij> select LENGTH(a) from long2;
+1          
+-----------
+3240       
+3240       
+3024       
+3024       
+ij> drop table long1;
+0 rows inserted/updated/deleted
+ij> drop table long2;
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', '1024');
+0 rows inserted/updated/deleted
+ij> create table long1 (a varchar(32000), b int, c int);
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', NULL);
+0 rows inserted/updated/deleted
+ij> insert into long1 values
+	('this is a long row which will get even longer', 1, 2);
+1 row inserted/updated/deleted
+ij> insert into long1 values
+	('a second row that will also grow very long', 2, 3);
+1 row inserted/updated/deleted
+ij> update long1 set a = a||a||a||a||a||a;
+2 rows inserted/updated/deleted
+ij> update long1 set a = a||a||a||a||a||a;
+2 rows inserted/updated/deleted
+ij> update long1 set a = a||a;
+2 rows inserted/updated/deleted
+ij> select LENGTH(a) from long1;
+1          
+-----------
+3240       
+3024       
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', '1024');
+0 rows inserted/updated/deleted
+ij> create table long2 (a varchar(32000), b int, c int);
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', NULL);
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', '16384');
+0 rows inserted/updated/deleted
+ij> create index long2i1 on long2 (a);
+0 rows inserted/updated/deleted
+ij> create index long2i2 on long2 (b, a);
+0 rows inserted/updated/deleted
+ij> create index long2i3 on long2 (b, a, c);
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', NULL);
+0 rows inserted/updated/deleted
+ij> -- insert into the second table multiple times
+insert into long2 select * from long1;
+2 rows inserted/updated/deleted
+ij> insert into long2 select * from long1;
+2 rows inserted/updated/deleted
+ij> insert into long2 select * from long1;
+2 rows inserted/updated/deleted
+ij> insert into long2 select * from long1;
+2 rows inserted/updated/deleted
+ij> insert into long2 select * from long1;
+2 rows inserted/updated/deleted
+ij> insert into long2 select * from long1;
+2 rows inserted/updated/deleted
+ij> insert into long2 select * from long1;
+2 rows inserted/updated/deleted
+ij> insert into long2 select * from long1;
+2 rows inserted/updated/deleted
+ij> insert into long2 select * from long1;
+2 rows inserted/updated/deleted
+ij> insert into long2 select * from long1;
+2 rows inserted/updated/deleted
+ij> select LENGTH(a) from long2;
+1          
+-----------
+3240       
+3240       
+3240       
+3240       
+3240       
+3240       
+3240       
+3240       
+3240       
+3240       
+3024       
+3024       
+3024       
+3024       
+3024       
+3024       
+3024       
+3024       
+3024       
+3024       
+ij> select count(*) from long2;
+1          
+-----------
+20         
+ij> -- test case for track 1552
+--    Make sure that a full scan which needs columns not in index does not
+--    use the index.  Before the fix, access costing would make the optimizer
+--    pick the index because it incorrectly costed rows spanning pages.
+drop table a;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'A' because it does not exist.
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize','4096');
+0 rows inserted/updated/deleted
+ij> create table a (a int, b varchar(4000), c varchar(4000), d varchar(4000));
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', NULL);
+0 rows inserted/updated/deleted
+ij> create index a_idx on a (a);
+0 rows inserted/updated/deleted
+ij> insert into a values (5, PADSTRING('a',4000), PADSTRING('a',4000), PADSTRING('a',4000));
+1 row inserted/updated/deleted
+ij> insert into a values (4, PADSTRING('a',4000), PADSTRING('a',4000), PADSTRING('a',4000));
+1 row inserted/updated/deleted
+ij> insert into a values (3, PADSTRING('a',4000), PADSTRING('a',4000), PADSTRING('a',4000));
+1 row inserted/updated/deleted
+ij> insert into a values (2, PADSTRING('a',4000), PADSTRING('a',4000), PADSTRING('a',4000));
+1 row inserted/updated/deleted
+ij> insert into a values (1, PADSTRING('a',4000), PADSTRING('a',4000), PADSTRING('a',4000));
+1 row inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_SET_RUNTIMESTATISTICS(1);
+0 rows inserted/updated/deleted
+ij> maximumdisplaywidth 2000;
+ij> select a, d from a;
+A          |D                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+5          |a                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              &
+4          |a                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              &
+3          |a                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              &
+2          |a                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              &
+1          |a                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              &
+ij> values SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS();
+1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+Statement Name: 
+	null
+Statement Text: 
+	select a, d from a
+Parse Time: 0
+Bind Time: 0
+Optimize Time: 0
+Generate Time: 0
+Compile Time: 0
+Execute Time: 0
+Begin Compilation Timestamp : null
+End Compilation Timestamp : null
+Begin Execution Timestamp : null
+End Execution Timestamp : null
+Statement Execution Plan Text: 
+Table Scan ResultSet for A at serializable isolation level using share table locking chosen by the optimizer
+Number of opens = 1
+Rows seen = 5
+Rows filtered = 0
+Fetch Size = 16
+	constructor time (milliseconds) = 0
+	open time (milliseconds) = 0
+	next time (milliseconds) = 0
+	close time (milliseconds) = 0
+	next time in milliseconds/row = 0
+scan information: 
+	Bit set of columns fetched={0, 3}
+	Number of columns fetched=2
+	Number of pages visited=6
+	Number of rows qualified=5
+	Number of rows visited=5
+	Scan type=heap
+	start position: 
+null	stop position: 
+null	qualifiers:
+None
+ij> autocommit on;
+ij> -- test case for track 2241
+--    The problem was that when the level of btree grew, sometimes a long
+--    row would be chosen as the branch delimiter, and the branch code did
+--    not throw the correct error noSpaceForKey error.
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', NULL);
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.minimumRecordSize', NULL);
+0 rows inserted/updated/deleted
+ij> create table b2241 (a int, b varchar(32000));
+0 rows inserted/updated/deleted
+ij> insert into b2241 values (1024, '01234567890123456789012345678901234567890123456789');
+1 row inserted/updated/deleted
+ij> insert into b2241 (select b2241.a + 1  , b from b2241);
+1 row inserted/updated/deleted
+ij> insert into b2241 (select b2241.a + 2  , b from b2241);
+2 rows inserted/updated/deleted
+ij> insert into b2241 (select b2241.a + 4  , b from b2241);
+4 rows inserted/updated/deleted
+ij> insert into b2241 (select b2241.a + 8  , b from b2241);
+8 rows inserted/updated/deleted
+ij> insert into b2241 (select b2241.a + 16  , b from b2241);
+16 rows inserted/updated/deleted
+ij> insert into b2241 (select b2241.a + 32  , b from b2241);
+32 rows inserted/updated/deleted
+ij> insert into b2241 (select b2241.a + 64  , b from b2241);
+64 rows inserted/updated/deleted
+ij> update b2241 set b = b||b;
+128 rows inserted/updated/deleted
+ij> update b2241 set b = b||b;
+128 rows inserted/updated/deleted
+ij> update b2241 set b = b||b;
+128 rows inserted/updated/deleted
+ij> update b2241 set b = b||b;
+128 rows inserted/updated/deleted
+ij> update b2241 set b = b||b;
+128 rows inserted/updated/deleted
+ij> select LENGTH(b) from b2241 where a = 1025;
+1          
+-----------
+1600       
+ij> insert into b2241 (select 1, b||b||b||b||b||b||b||b from b2241 where a = 1024);
+1 row inserted/updated/deleted
+ij> insert into b2241 (select 8000, b||b||b||b||b||b||b||b from b2241 where a = 1024);
+1 row inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', '4096');
+0 rows inserted/updated/deleted
+ij> -- this create index use to fail with an assert - 
+-- should fail with key too big error.
+create index a on b2241 (b, a);
+ERROR XSCB6: Limitation: Record of a btree secondary index cannot be updated or inserted due to lack of space on the page.  Use the parameters derby.storage.pageSize and/or derby.storage.pageReservedSpace to work around this limitation.
+ij> -- make sure table still accessable
+create index a on b2241 (b, a);
+ERROR XSCB6: Limitation: Record of a btree secondary index cannot be updated or inserted due to lack of space on the page.  Use the parameters derby.storage.pageSize and/or derby.storage.pageReservedSpace to work around this limitation.
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', NULL);
+0 rows inserted/updated/deleted
+ij> -- delete 2 big records and then index should work.
+delete from b2241 where a = 1;
+1 row inserted/updated/deleted
+ij> delete from b2241 where a = 8000;
+1 row inserted/updated/deleted
+ij> create index a on b2241 (b, a);
+0 rows inserted/updated/deleted
+ij> -- Check the consistency of the indexes
+VALUES SYSCS_UTIL.SYSCS_CHECK_TABLE('APP', 'FOO');
+1          
+-----------
+1          
+ij> drop table b2241;
+0 rows inserted/updated/deleted
+ij> -- test case for reclaiming deleted rows during split.
+--    o insert bunch of rows with sequential keys.
+--    o create non-unique index.
+--    o delete every other one - this will make normat post commit not fire.
+--    o commit
+--    o now reinsert rows into the "holes" which before the fix would cause
+--      splits, but now will force reclaim space and reuse existing space in
+--      btree.
+autocommit off;
+ij> -- set page size back to default.
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', '4096');
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.minimumRecordSize', '1');
+0 rows inserted/updated/deleted
+ij> commit;
+ij> drop table foo;
+0 rows inserted/updated/deleted
+ij> drop table foo2;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'FOO2' because it does not exist.
+ij> -- create and load a table with values from 1024 down to 1, 
+create table foo (a int, b char(200), c int);
+0 rows inserted/updated/deleted
+ij> insert into foo values (1024,             'even', 0);
+1 row inserted/updated/deleted
+ij> insert into foo        (select foo.a - 1, 'odd' , 1 from foo);
+1 row inserted/updated/deleted
+ij> insert into foo (select foo.a - 2,   foo.b, foo.c from foo);
+2 rows inserted/updated/deleted
+ij> insert into foo (select foo.a - 4,   foo.b, foo.c from foo);
+4 rows inserted/updated/deleted
+ij> insert into foo (select foo.a - 8,   foo.b, foo.c from foo);
+8 rows inserted/updated/deleted
+ij> insert into foo (select foo.a - 16,  foo.b, foo.c from foo);
+16 rows inserted/updated/deleted
+ij> insert into foo (select foo.a - 32,  foo.b, foo.c from foo);
+32 rows inserted/updated/deleted
+ij> insert into foo (select foo.a - 64,  foo.b, foo.c from foo);
+64 rows inserted/updated/deleted
+ij> insert into foo (select foo.a - 128, foo.b, foo.c from foo);
+128 rows inserted/updated/deleted
+ij> insert into foo (select foo.a - 256, foo.b, foo.c from foo);
+256 rows inserted/updated/deleted
+ij> insert into foo (select foo.a - 512, foo.b, foo.c from foo);
+512 rows inserted/updated/deleted
+ij> -- insert into the "holes", but different keys (even2 instead of even)
+create table foo2 (a int, b char(200), c int);
+0 rows inserted/updated/deleted
+ij> insert into foo2 (select * from foo);
+1024 rows inserted/updated/deleted
+ij> delete from foo2 where foo2.c = 1;
+512 rows inserted/updated/deleted
+ij> -- create "packed" index.
+create index a on foo (a, b);
+0 rows inserted/updated/deleted
+ij> -- delete ever other row
+delete from foo where foo.c = 0;
+512 rows inserted/updated/deleted
+ij> -- turn all the deletes into "committed deletes"
+commit;
+ij> insert into foo (select foo2.a, 'even2', foo2.c from foo2);
+512 rows inserted/updated/deleted
+ij> commit;
+ij> -- insert dups 
+insert into foo (select foo2.a, 'even2', foo2.c from foo2);
+512 rows inserted/updated/deleted
+ij> commit;
+ij> -- a delete of the whole table also exercises the btree well.
+delete from foo;
+1536 rows inserted/updated/deleted
+ij> drop table foo;
+0 rows inserted/updated/deleted
+ij> drop table foo2;
+0 rows inserted/updated/deleted
+ij> -- try same test with unique index.
+-- create and load a table with values from 1024 down to 1, 
+create table foo (a int, b char(200), c int);
+0 rows inserted/updated/deleted
+ij> insert into foo values (1024,             'even', 0);
+1 row inserted/updated/deleted
+ij> insert into foo        (select foo.a - 1, 'odd' , 1 from foo);
+1 row inserted/updated/deleted
+ij> insert into foo (select foo.a - 2,   foo.b, foo.c from foo);
+2 rows inserted/updated/deleted
+ij> insert into foo (select foo.a - 4,   foo.b, foo.c from foo);
+4 rows inserted/updated/deleted
+ij> insert into foo (select foo.a - 8,   foo.b, foo.c from foo);
+8 rows inserted/updated/deleted
+ij> insert into foo (select foo.a - 16,  foo.b, foo.c from foo);
+16 rows inserted/updated/deleted
+ij> insert into foo (select foo.a - 32,  foo.b, foo.c from foo);
+32 rows inserted/updated/deleted
+ij> insert into foo (select foo.a - 64,  foo.b, foo.c from foo);
+64 rows inserted/updated/deleted
+ij> insert into foo (select foo.a - 128, foo.b, foo.c from foo);
+128 rows inserted/updated/deleted
+ij> insert into foo (select foo.a - 256, foo.b, foo.c from foo);
+256 rows inserted/updated/deleted
+ij> insert into foo (select foo.a - 512, foo.b, foo.c from foo);
+512 rows inserted/updated/deleted
+ij> -- insert into the "holes", but different keys (even2 instead of even)
+create table foo2 (a int, b char(200), c int);
+0 rows inserted/updated/deleted
+ij> insert into foo2 (select * from foo);
+1024 rows inserted/updated/deleted
+ij> delete from foo2 where foo2.c = 1;
+512 rows inserted/updated/deleted
+ij> -- create "packed" unique index.
+create unique index a on foo (a, b);
+0 rows inserted/updated/deleted
+ij> -- delete ever other row
+delete from foo where foo.c = 0;
+512 rows inserted/updated/deleted
+ij> -- turn all the deletes into "committed deletes"
+commit;
+ij> insert into foo (select foo2.a, 'even2', foo2.c from foo2);
+512 rows inserted/updated/deleted
+ij> commit;
+ij> -- insert dups will cause error
+insert into foo (select foo2.a, 'even2', foo2.c from foo2);
+ERROR 23505: The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by 'A' defined on 'FOO'.
+ij> commit;
+ij> -- a delete of the whole table also exercises the btree well.
+delete from foo;
+1024 rows inserted/updated/deleted
+ij> drop table foo;
+0 rows inserted/updated/deleted
+ij> drop table foo2;
+0 rows inserted/updated/deleted
+ij> commit;
+ij> -- another simple test of reclaim deleted row code paths.
+-- this test should not reclaim rows as deletes are not committed.
+create table foo (a int, b varchar(1100), c int);
+0 rows inserted/updated/deleted
+ij> create index a on foo (a, b);
+0 rows inserted/updated/deleted
+ij> insert into foo values (1, PADSTRING('a',1100), 1);
+1 row inserted/updated/deleted
+ij> insert into foo values (2, PADSTRING('a',1100), 1);
+1 row inserted/updated/deleted
+ij> insert into foo values (3, PADSTRING('a',1100), 1);
+1 row inserted/updated/deleted
+ij> commit;
+ij> delete from foo where foo.a = 1;
+1 row inserted/updated/deleted
+ij> delete from foo where foo.a = 2;
+1 row inserted/updated/deleted
+ij> insert into foo values (-1, PADSTRING('ab',1100), 1);
+1 row inserted/updated/deleted
+ij> insert into foo values (-2, PADSTRING('ab',1100), 1);
+1 row inserted/updated/deleted
+ij> rollback;
+ij> drop table foo;
+0 rows inserted/updated/deleted
+ij> -- another simple test of reclaim deleted row code paths.
+-- this test should reclaim rows as deletes are not committed.
+create table foo (a int, b varchar(1100), c int);
+0 rows inserted/updated/deleted
+ij> create index a on foo (a, b);
+0 rows inserted/updated/deleted
+ij> insert into foo values (1, PADSTRING('a',1100), 1);
+1 row inserted/updated/deleted
+ij> insert into foo values (2, PADSTRING('a',1100), 1);
+1 row inserted/updated/deleted
+ij> insert into foo values (3, PADSTRING('a',1100), 1);
+1 row inserted/updated/deleted
+ij> commit;
+ij> delete from foo where foo.a = 1;
+1 row inserted/updated/deleted
+ij> delete from foo where foo.a = 2;
+1 row inserted/updated/deleted
+ij> commit;
+ij> insert into foo values (-1, PADSTRING('ab',1100), 1);
+1 row inserted/updated/deleted
+ij> insert into foo values (-2, PADSTRING('ab',1100), 1);
+1 row inserted/updated/deleted
+ij> rollback;
+ij> drop table foo;
+0 rows inserted/updated/deleted
+ij> -- this test will not reclaim rows because the parent xact has table level lock.
+create table foo (a int, b varchar(1100), c int);
+0 rows inserted/updated/deleted
+ij> create index a on foo (a, b);
+0 rows inserted/updated/deleted
+ij> insert into foo values (1, PADSTRING('a',1100), 1);
+1 row inserted/updated/deleted
+ij> insert into foo values (2, PADSTRING('a',1100), 1);
+1 row inserted/updated/deleted
+ij> insert into foo values (3, PADSTRING('a',1100), 1);
+1 row inserted/updated/deleted
+ij> delete from foo where foo.a = 1;
+1 row inserted/updated/deleted
+ij> insert into foo values (0, PADSTRING('a',1100), 1);
+1 row inserted/updated/deleted
+ij> insert into foo values (1, PADSTRING('a',1100), 1);
+1 row inserted/updated/deleted
+ij> rollback;
+ij> drop table foo;
+0 rows inserted/updated/deleted
+ij> -- test case for track 2778
+--    Make sure that an update which causes a row to go from a non long row
+--    to a long row can be aborted correctly.  Prior to this fix the columns
+--    moving off the page would be corrupted.
+-- create a base table that contains 2 rows, 19 columns, that leaves just
+-- 1 byte free on the page.  freeSpace: 1, spareSpace: 10, PageSize: 2048
+drop table t2778;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'T2778' because it does not exist.
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', '2048');
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageReservedSpace', '10');
+0 rows inserted/updated/deleted
+ij> create table t2778 
+    (
+        col00 char(2),
+        col01 char(1),
+        col02 char(99),
+        col03 char(11),
+        col04 char(7),
+        col05 char(11),
+        col06 char(6),
+        col07 char(6),
+        col08 char(2),
+        col09 char(6),
+        col10 varchar(1000),
+        col11 char(2),
+        col12 char(1),
+        col13 char(7),
+        col14 char(24),
+        col15 char(1),
+        col16 char(166),
+        col17 char(207),
+        col18 char(2)
+    );
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', NULL);
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageReservedSpace', NULL);
+0 rows inserted/updated/deleted
+ij> create unique index a_idx on t2778 (col00);
+ERROR X0Y32: Index 'A_IDX' already exists in Schema 'APP'.
+ij> commit;
+ij> insert into t2778 values (
+        '0_',
+        '0',
+        '0_col02',
+        '0_col03',
+        '0_col04',
+        '0_col05',
+        '0_06',
+        '0_07',
+        '0_',
+        '0_09',
+        '0_col10llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll012340_col10lllllllllll',
+        '0_',
+        '0',
+        '0_col13',
+        '0_col14',
+        '0',
+        '0_col16',
+        '0_col17',
+        '0_'
+        );
+1 row inserted/updated/deleted
+ij> insert into t2778 values (
+        '1_',
+        '1',
+        '1_col02',
+        '1_col03',
+        '1_col04',
+        '1_col05',
+        '1_06',
+        '1_07',
+        '1_',
+        '1_09',
+        '1_col10llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll012340_col10lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll012340_col10lllllllllllxxxxxxxxxxxxxxxxxxx',
+        '1_',
+        '1',
+        '1_col13',
+        '1_col14',
+        '1',
+        '1_col16',
+        '1_col17',
+        '1_'
+        );
+1 row inserted/updated/deleted
+ij> commit;
+ij> select col16, col17, col18 from t2778;
+COL16                                                                                                                                                                 |COL17                                                                                                                                                                                                          |COL&
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+0_col16                                                                                                                                                               |0_col17                                                                                                                                                                                                        |0_  
+1_col16                                                                                                                                                               |1_col17                                                                                                                                                                                                        |1_  
+ij> commit;
+ij> update t2778 properties index = a_idx 
+    set col10 = 
+        '0_col10llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll012340_col10lllllllllllxxxxxx'
+    where col00 = '0_';
+ERROR 42X01: Syntax error: PROPERTIES.
+ij> rollback;
+ij> -- prior to the fix col17 and col18 would come back null.
+select col01, col02, col03, col04, col05,  col06, col07, col08, col09, col10, col11, col12, col13, col14, col15, col16, col17, col18 from t2778;
+COL&|COL02                                                                                              |COL03      |COL04  |COL05      |COL06 |COL07 |COL&|COL09 |COL10                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+0   |0_col02                                                                                            |0_col03    |0_col04|0_col05    |0_06  |0_07  |0_  |0_09  |0_col10llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll012340_col10lllllllllll                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |0_  |0   |0_col13|0_col14                 |0   |0_col16                                                                                                                                                               |0_col17                                                                                                                                                                                                        |0_  
+1   |1_col02                                                                                            |1_col03    |1_col04|1_col05    |1_06  |1_07  |1_  |1_09  |1_col10llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll012340_col10lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll012340_col10lllllllllllxxxxxxxxxxxxxxxxxxx                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |1_  |1   |1_col13|1_col14                 |1   |1_col16                                                                                                                                                               |1_col17                                                                                                                                                                                                        |1_  
+ij> commit;
+ij> -- buddy test case for reclaiming deleted rows during split.
+-- test space reclamation using the SpaceTable VTI.
+--    o insert bunch of rows with sequential keys.
+--    o create non-unique index.
+--    o check space usage for index using SpaceTable VTI
+--    o delete every other one less than 1000 - this will make normal post 
+--      commit not fire as no page should have all deleted rows (< 1000 avoids
+--      possible case where last page only has 1 row).
+--    o commit
+--    o now reinsert rows into the "holes" which before the fix would cause
+--      splits, but now will force reclaim space and reuse existing space in
+--      btree.
+--    o redo delete, commit and insert several times over
+--    o check space usage for index using SpaceTable VTI is same as above
+-- set page size to default.
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize', '4096');
+0 rows inserted/updated/deleted
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.minimumRecordSize', '1');
+0 rows inserted/updated/deleted
+ij> autocommit off;
+ij> commit;
+ij> drop table foo;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'FOO' because it does not exist.
+ij> drop table foo2;
+ERROR 42Y55: 'DROP TABLE' cannot be performed on 'FOO2' because it does not exist.
+ij> -- create and load a table with values from 1024 down to 1,
+create table foo (a int, b char(200), c int);
+0 rows inserted/updated/deleted
+ij> insert into foo values (1024, 'even', 0);
+1 row inserted/updated/deleted
+ij> insert into foo        (select foo.a - 1, 'odd' , 1 from foo);
+1 row inserted/updated/deleted
+ij> insert into foo (select foo.a - 2,   foo.b, foo.c from foo);
+2 rows inserted/updated/deleted
+ij> insert into foo (select foo.a - 4,   foo.b, foo.c from foo);
+4 rows inserted/updated/deleted
+ij> insert into foo (select foo.a - 8,   foo.b, foo.c from foo);
+8 rows inserted/updated/deleted
+ij> insert into foo (select foo.a - 16,  foo.b, foo.c from foo);
+16 rows inserted/updated/deleted
+ij> insert into foo (select foo.a - 32,  foo.b, foo.c from foo);
+32 rows inserted/updated/deleted
+ij> insert into foo (select foo.a - 64,  foo.b, foo.c from foo);
+64 rows inserted/updated/deleted
+ij> insert into foo (select foo.a - 128, foo.b, foo.c from foo);
+128 rows inserted/updated/deleted
+ij> insert into foo (select foo.a - 256, foo.b, foo.c from foo);
+256 rows inserted/updated/deleted
+ij> insert into foo (select foo.a - 512, foo.b, foo.c from foo);
+512 rows inserted/updated/deleted
+ij> -- insert into the "holes", but different keys (even2 instead of even)
+create table foo2 (a int, b char(200), c int);
+0 rows inserted/updated/deleted
+ij> insert into foo2 (select * from foo);
+1024 rows inserted/updated/deleted
+ij> delete from foo2 where foo2.c = 1;
+512 rows inserted/updated/deleted
+ij> delete from foo2 where foo2.a >= 1000;
+13 rows inserted/updated/deleted
+ij> -- create "packed" index.
+create index a on foo (a, b);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> create table spaceused (a int);
+0 rows inserted/updated/deleted
+ij> -- check space usage on the index
+insert into spaceused
+select numallocatedpages
+from new org.apache.derby.diag.SpaceTable('FOO') t
+where conglomeratename = 'A';
+1 row inserted/updated/deleted
+ij> -- delete every other row
+delete from foo where foo.c = 0 and foo.a < 1000;
+499 rows inserted/updated/deleted
+ij> -- turn all the deletes into "committed deletes"
+commit;
+ij> -- wait for post commit on heap deleted rows to finish, so that there is
+-- no interference between post commit heap processing, and btree reclamation
+-- during split.
+CALL WAIT_FOR_POST_COMMIT();
+0 rows inserted/updated/deleted
+ij> -- reinsert
+insert into foo (select * from foo2);
+499 rows inserted/updated/deleted
+ij> commit;
+ij> -- do the above several times
+delete from foo where foo.c = 0 and foo.a < 1000;
+499 rows inserted/updated/deleted
+ij> commit;
+ij> -- wait for post commit on heap deleted rows to finish, so that there is
+-- no interference between post commit heap processing, and btree reclamation
+-- during split.
+CALL WAIT_FOR_POST_COMMIT();
+0 rows inserted/updated/deleted
+ij> insert into foo (select * from foo2);
+499 rows inserted/updated/deleted
+ij> delete from foo where foo.c = 0 and foo.a < 1000;
+499 rows inserted/updated/deleted
+ij> commit;
+ij> -- wait for post commit on heap deleted rows to finish, so that there is
+-- no interference between post commit heap processing, and btree reclamation
+-- during split.
+CALL WAIT_FOR_POST_COMMIT();
+0 rows inserted/updated/deleted
+ij> insert into foo (select * from foo2);
+499 rows inserted/updated/deleted
+ij> delete from foo where foo.c = 0 and foo.a < 1000;
+499 rows inserted/updated/deleted
+ij> commit;
+ij> -- wait for post commit on heap deleted rows to finish, so that there is
+-- no interference between post commit heap processing, and btree reclamation
+-- during split.
+CALL WAIT_FOR_POST_COMMIT();
+0 rows inserted/updated/deleted
+ij> insert into foo (select * from foo2);
+499 rows inserted/updated/deleted
+ij> delete from foo where foo.c = 0 and foo.a < 1000;
+499 rows inserted/updated/deleted
+ij> commit;
+ij> -- wait for post commit on heap deleted rows to finish, so that there is
+-- no interference between post commit heap processing, and btree reclamation
+-- during split.
+CALL WAIT_FOR_POST_COMMIT();
+0 rows inserted/updated/deleted
+ij> insert into foo (select * from foo2);
+499 rows inserted/updated/deleted
+ij> delete from foo where foo.c = 0 and foo.a < 1000;
+499 rows inserted/updated/deleted
+ij> commit;
+ij> -- wait for post commit on heap deleted rows to finish, so that there is
+-- no interference between post commit heap processing, and btree reclamation
+-- during split.
+CALL WAIT_FOR_POST_COMMIT();
+0 rows inserted/updated/deleted
+ij> insert into foo (select * from foo2);
+499 rows inserted/updated/deleted
+ij> commit;
+ij> -- check space usage on the index
+insert into spaceused
+select numallocatedpages
+from new org.apache.derby.diag.SpaceTable('FOO') t
+where conglomeratename = 'A';
+1 row inserted/updated/deleted
+ij> -- should only be 1 distinct row in this table since space used by the
+-- index should be the same before and after
+select count(distinct a)
+from spaceused;
+1          
+-----------
+1          
+ij> -- cleanup
+drop table foo;
+0 rows inserted/updated/deleted
+ij> drop table foo2;
+0 rows inserted/updated/deleted
+ij> drop table spaceused;
+0 rows inserted/updated/deleted
+ij> -- test case for track 3149, improving max on btree optimization
+autocommit off;
+ij> create table foo (a int, b varchar(500), c int);
+0 rows inserted/updated/deleted
+ij> insert into foo values (1, PADSTRING('1',500), 1);
+1 row inserted/updated/deleted
+ij> insert into foo values (11, PADSTRING('11',500), 1);
+1 row inserted/updated/deleted
+ij> insert into foo values (12, PADSTRING('12',500), 1);
+1 row inserted/updated/deleted
+ij> insert into foo values (13, PADSTRING('13',500), 1);
+1 row inserted/updated/deleted
+ij> insert into foo values (14, PADSTRING('14',500), 1);
+1 row inserted/updated/deleted
+ij> insert into foo values (15, PADSTRING('15',500), 1);
+1 row inserted/updated/deleted
+ij> insert into foo values (16, PADSTRING('16',500), 1);
+1 row inserted/updated/deleted
+ij> insert into foo values (17, PADSTRING('17',500), 1);
+1 row inserted/updated/deleted
+ij> insert into foo values (18, PADSTRING('18',500), 1);
+1 row inserted/updated/deleted
+ij> insert into foo values (2, PADSTRING('2',500), 1);
+1 row inserted/updated/deleted
+ij> insert into foo values (3, PADSTRING('3',500), 1);
+1 row inserted/updated/deleted
+ij> insert into foo values (4, PADSTRING('4',500), 1);
+1 row inserted/updated/deleted
+ij> insert into foo values (5, PADSTRING('5',500), 1);
+1 row inserted/updated/deleted
+ij> insert into foo values (6, PADSTRING('6',500), 1);
+1 row inserted/updated/deleted
+ij> insert into foo values (7, PADSTRING('7',500), 1);
+1 row inserted/updated/deleted
+ij> insert into foo values (8, PADSTRING('8',500), 1);
+1 row inserted/updated/deleted
+ij> insert into foo values (9, PADSTRING('9',500), 1);
+1 row inserted/updated/deleted
+ij> create index foox on foo (b);
+0 rows inserted/updated/deleted
+ij> commit;
+ij> -- normal max optimization, last row in index is not deleted.
+select max(b) from foo;
+1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+9                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
Mime
View raw message